Does nova support flavors where vcpus of a single flavor can be in mixed modes where some of them are pinned and the rest dedicated ? Say, a flavor has 5 vcpus, I want 2 of them to be of dedicated type and the remaining 3 vcpus to be shared
On 28/01/2025 17:06, engineer2024 wrote:
Does nova support flavors where vcpus of a single flavor can be in mixed modes where some of them are pinned and the rest dedicated ? yes Say, a flavor has 5 vcpus, I want 2 of them to be of dedicated type and the remaining 3 vcpus to be shared
that is possibel to specify using the mixed cpu feature https://specs.openstack.org/openstack/nova-specs/specs/victoria/implemented/... in victoria we added a new cpu policy |`||hw:cpu_policy="mixed"` and a new extra spec `||hw:cpu_dedicated_mask` that allwos you to say which logical cpus are pinned/dedicated or floating/shared| |this works similarly to the realtime core mask that allwos you to define which cpu cores have realtime priority. you should also be able to use both feature togehter tecnically| |regaring your specific exampel you woudl set the following extra specs | openstack flavor create mixed_vmf --vcpus 5 --ram 512 --disk 1 --property hw:cpu_policy=mixed --property hw:cpu_dedicated_mask=3-4 this will update the flavor to the mixed policy, define cores 0,1,2 as floating/shared and cores 3 and 4 as dedicated/pinned i would also recommend setting "hw:emulator_threads_policy=share" it not requried but its always a good idea when using pinning. you shoud also alwasy set hw:mem_page_size when ever usiging pinning of any kind do `hw:mem_page_size=small` for normal small 4k pages or `hw:mem_page_size=large` for hugepages. without setting hw:mem_page_size to an allowed value, nova will not consier per numa node memory and your vm will likely get OOM killed eventually. note that to use the functionality you have to have already converted to using CPU tracking in placement https://specs.openstack.org/openstack/nova-specs/specs/train/implemented/cpu... so that means that you use cpu_dedicated_set and cpu_shared_set in your nova.conf instead of vcpu_pin_set to say which cores on the host are for pinned and unpinned guests. stephen does not have a blog post on mix cpous specifically but thease are always good referhsers on cpu pinning in nova/placment in general. https://that.guru/blog/cpu-resources/ https://that.guru/blog/cpu-resources-redux/ the feature has been there for several year now and was an evolution of the existing pinning funcitonality hopefully that helps. regards sean
As always, appreciated Sean. Thank you On Wed, 29 Jan 2025, 07:18 Sean Mooney, <smooney@redhat.com> wrote:
On 28/01/2025 17:06, engineer2024 wrote:
Does nova support flavors where vcpus of a single flavor can be in mixed modes where some of them are pinned and the rest dedicated ? yes Say, a flavor has 5 vcpus, I want 2 of them to be of dedicated type and the remaining 3 vcpus to be shared
that is possibel to specify using the mixed cpu feature
https://specs.openstack.org/openstack/nova-specs/specs/victoria/implemented/...
in victoria we added a new cpu policy |`||hw:cpu_policy="mixed"` and a new extra spec `||hw:cpu_dedicated_mask` that allwos you to say which logical cpus are pinned/dedicated or floating/shared|
|this works similarly to the realtime core mask that allwos you to define which cpu cores have realtime priority. you should also be able to use both feature togehter tecnically|
|regaring your specific exampel you woudl set the following extra specs |
openstack flavor create mixed_vmf --vcpus 5 --ram 512 --disk 1 --property hw:cpu_policy=mixed --property hw:cpu_dedicated_mask=3-4 this will update the flavor to the mixed policy, define cores 0,1,2 as floating/shared and cores 3 and 4 as dedicated/pinned i would also recommend setting "hw:emulator_threads_policy=share" it not requried but its always a good idea when using pinning. you shoud also alwasy set hw:mem_page_size when ever usiging pinning of any kind do `hw:mem_page_size=small` for normal small 4k pages or `hw:mem_page_size=large` for hugepages. without setting hw:mem_page_size to an allowed value, nova will not consier per numa node memory and your vm will likely get OOM killed eventually.
note that to use the functionality you have to have already converted to using CPU tracking in placement
https://specs.openstack.org/openstack/nova-specs/specs/train/implemented/cpu... so that means that you use cpu_dedicated_set and cpu_shared_set in your nova.conf instead of vcpu_pin_set to say which cores on the host are for pinned and unpinned guests.
stephen does not have a blog post on mix cpous specifically but thease are always good referhsers on cpu pinning in nova/placment in general.
https://that.guru/blog/cpu-resources/ https://that.guru/blog/cpu-resources-redux/
the feature has been there for several year now and was an evolution of the existing pinning funcitonality hopefully that helps.
regards
sean
participants (2)
-
engineer2024
-
Sean Mooney