pinggit / dpdk-contrail-book

contrail dpdk day one book
9 stars 3 forks source link

regarding cpu allocation to Nova #21

Closed pinggit closed 3 years ago

pinggit commented 3 years ago

regarding CPU pinning to VM:

CPU allocated to Virtual Machines

Host compute CPUs used for user Virtual Machines are defined into Nova configuration file. Below, we are enforcing Nova CPU assignment:
$ openstack-config --set /etc/nova/nova.conf DEFAULT vcpu_pin_set 3,5,7,9,11-23,27,29,31,33,35-47

$ cat /etc/nova/nova.conf | grep vcpu_pin_set
vcpu_pin_set=3,5,7,9,11-23,27,29,31,33,35-47

In order to get these changes taken into consideration, Nova compute service has to be restarted:
$ sudo docker restart nova_compute

questions:

  1. is this executed in compute node?
  2. how do install this tool "openstack-config". this is not available in centos.
  3. will VM1, VM2, VM3 share these cores?
  4. shall we add a step for cpu pinning to one specific VM, say VM1 use CPU3,5,7; VM2 use CPU9,11,12.
ldurandadomia commented 3 years ago

1) vcpu_pin_set is a variable defined into /etc/nova/nova.conf. This is a file present on every compute node. 2) No idea, I do not use this command. This value is configured during OpenStack deployment by TripleO.

3) Yes. You can check this with taskset -cap .

4) VM pining in Openstack is out of the scope of this book. In my opinion. This is not so simple. There is Nova conf on one side, and VM enforced configuration provided through specific flavor in which pinning option are defined by the Cloud Administrator.

pinggit commented 3 years ago

thanks @ldurandadomia @kirankn80 do you know how to implement this in your (kolla based) setup?

kirankn80 commented 3 years ago

Yes, IMO, we can ignore cpu pinning in this book. It is an advanced topic.

PrzemekGrygiel commented 3 years ago

to check VMs CPU allocation the best is virsh vcpupin [VM id] this command can be used to relocate CPU allocation as well virsh vcpupin [VM id] [index] [new core allocation]

pinggit commented 3 years ago

@kirankn80 originally my plan is, I need this to be done so I can specify exactly which core the traffic to be sent out. I want to be specific when introducing the dpdkvifstats and dpdkinfo command, with traffic. do we know how to implement it (what laurent mentioned in ch4) in your setup? or, do you want to withdraw ch4 from the book?

pinggit commented 3 years ago

here is the file to pin cpu to nova in kolla, will close.

[root@a7s3 ~]# cat /etc/kolla/nova-compute/nova.conf | grep cpu
vcpu_pin_set=1,7,3,9,4,10