Reviewed: https://review.opendev.org/688603 Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=569ad1402e2447ef72672934947541c81b3d5ef7 Submitter: Zuul Branch: master
commit 569ad1402e2447ef72672934947541c81b3d5ef7 Author: Wang Huaqiang <[email protected]> Date: Tue Oct 15 18:13:12 2019 +0800 Set instance CPU policy to 'share' through image property Before the introduce of 'CPU resource', a 'cpu_policy' of None is same as a 'cpu_policy' of 'shared' effectively. But these two CPU policies ('shared' and None) have some difference now, checking the code in 'hardware.numa_get_constraints', if the variable 'cpu_policy' is not set, which means 'cpu_policy==None', it still possible to get the instance CPU policy through the setting of 'resources:VCPU' and 'resources:PCPU'. We should return the 'cpu_policy==shared' if 'hw_cpu_policy==share' and 'hw:cpu_policy' is not defined. Otherwise, if you want to set a 'shared' policy through 'hw_cpu_policy', but it might be alerted by the setting of 'resources:PCPU'. Change-Id: I0e2d90d83180e91c3217f5a806a48e518ab235e8 Closes-Bug: #1848308 ** Changed in: nova Status: In Progress => Fix Released -- You received this bug notification because you are a member of Yahoo! Engineering Team, which is subscribed to OpenStack Compute (nova). https://bugs.launchpad.net/bugs/1848308 Title: Impossible to set instance CPU policy to 'shared' through flavor image property Status in OpenStack Compute (nova): Fix Released Bug description: According to the content defined in doc https://docs.openstack.org/nova/latest/admin/cpu-topologies.html #customizing-instance-cpu-pinning-policies, the instance CPU allocation policy could be explicitly set through instance flavor property 'hw:cpu_policy', or its corresponding image property 'hw_cpu_policy'. One general rule to solve the conflict between these two properties, if I understand it correctly, is if 'hw:cpu_policy' is not given with any policy, then it should take the policy from 'hw_cpu_policy'. But currently, if 'hw_cpu_policy' is set as 'shared' and no value set in 'hw:cpu_policy' the logic in 'hardware.get_cpu_policy_constraint' tells that there is no CPU policy (throug return a value of None). In this case, it should return the "shared" policy. This issue is first reported in https://review.opendev.org/#/c/688603/ but without tracking with a bug ID. To manage notifications about this bug go to: https://bugs.launchpad.net/nova/+bug/1848308/+subscriptions -- Mailing list: https://launchpad.net/~yahoo-eng-team Post to : [email protected] Unsubscribe : https://launchpad.net/~yahoo-eng-team More help : https://help.launchpad.net/ListHelp

