[nova] Spec: Standardize CPU resource tracking

Stephen Finucane sfinucan at redhat.com
Mon Jun 17 10:10:28 UTC 2019


[Cleaning up the 'To' field since Jay isn't working on OpenStack
anymore and everyone else is on openstack-discuss already]

On Fri, 2019-06-14 at 08:35 +0000, Shewale, Bhagyashri wrote:
> > cpu_share_set in stien was used for vm emulator thread and required
> > the instnace to be pinned for it to take effect. i.e. the 
> > hw:emulator_thread_policy extra spcec currently only works if you 
> > had hw_cpu_policy=dedicated so we should not error if vcpu_pin_set 
> > and cpu_shared_set are defined, it was valid. what we can do is 
> > ignore teh cpu_shared_set for schduling and not report 0 VCPUs
> > for this host and use vcpu_pinned_set as PCPUs.

> Thinking of backward compatibility, I agree both of these
> configuration options ``cpu_shared_set``, ``vcpu_pinned_set`` should
> be allowed in Train release as well.
> 
> Few possible combinations in train:
> A) What if only ``cpu_shared_set`` is set on a new compute node?
> Report VCPU inventory.

I think this is _very_ unlikely to happen in the real world since the
lack of a 'vcpu_pin_set' option means an instances pinned CPUs could
co-exist on the same cores as the emulator threats, which defeats the
whole point of placing emulator threads on a separate core. That said,
it's possible so we do have to deal with it.

Ignore 'cpu_shared_set' in this case and issue a warning saying that
the user has to configure 'cpu_dedicated_set'.

> B) what if  ``cpu_shared_set`` and ``cpu_dedicated_set``  are set on
> a new compute node?  Report VCPU  and PCPU inventory. In fact, we
> want to support both these options so that instance can request both
> VCPU and PCPU at the same time. If flavor requests VCPU or 
> hw:emulator_thread_policy=share, in both the cases, it will float on
> CPUs set in ``cpu_shared_set`` config option.

We should report both VCPU and PCPU inventory, yes. However, please
don't add the ability to create a single instance with combined VCPU
and PCPU inventory. I dropped this from the spec intentionally to make
it easier for something (_anything_) to land. We can iterate on this
once we have the basics done.

> C) What if  ``cpu_shared_set`` and ``vcpu_pin_set``  are set on a new
> compute node?  Ignore cpu_shared_set and report vcpu_pinned_set as
> VCPU or PCPU?

As above, ignore 'cpu_shared_set' but issue a warning. Use the value of
'vcpu_pin_set' to report both VCPU and PCPU inventory. Note that
'vcpu_pin_set' is already used to calculate VCPU inventory.

https://opendev.org/openstack/nova/src/branch/master/nova/virt/libvirt/driver.py#L5808-L5811

> D) What if  ``cpu_shared_set`` and ``vcpu_pin_set``  are set on a
> upgraded compute node? As you have mentioned, ignore cpu_shared_set
> and report vcpu_pinned_set as PCPUs provided  ``NumaTopology``
> ,``pinned_cpus`` attribute  is not empty otherwise VCPU.

Ignore 'cpu_shared_set' but issue a warning. Use the value of
'vcpu_pin_set' to report both VCPU and PCPU inventory. Note that
'vcpu_pin_set' is already used to calculate VCPU inventory.

> > we explctly do not want to have the behavior in 3 and 4 specificly 
> > the logic of checking the instances.
> 
> Here we are checking Host ``NumaTopology`` ,``pinned_cpus``
> attribute  and not directly instances ( if that attribute is not
> empty that means some instance are running) and this logic will be
> needed to address above #D case.

You shouldn't need to do this. Rely solely on configuration options to
determine inventory, even if it means reporting more inventory than we
actually have (reporting of a host core as both units of VCPU and PCPU)
and hope that operators have correctly used host aggregrates to isolate
NUMA-based instances from non-NUMA-based instances.

I realize this is very much in flux but could you please push what you
have up for review, marked as WIP or such. Debating this stuff in the
code might be easier.

Stephen




More information about the openstack-discuss mailing list