Please sign in to comment.
ironic: complete the flavor data migration started in pike
Blueprint custom-resource-classes-in-flavors in Pike added support for reporting custom resource class inventory for ironic instances and the ability to schedule to ironic nodes based on that custom resource class being in flavor extra specs. The goal was to eventually stop scheduling ironic instances based on the standard VCPU, MEMORY_MB and DISK_GB resource classes and just use the single custom resource class defined on the node itself. As part of that work, a data migration was added for existing ironic instances to report their custom resource class usage in the embedded instance.flavor.extra_specs. Also in Pike the nova-scheduler started creating resource allocations during scheduling, which before Pike was handled by the ResourceTracker in the nova-compute service. Once all computes were upgraded to at least Pike, the ResourceTracker would no longer report those allocations. This was problematic for existing ironic instances created before Pike since their allocations were no longer being reported to placement which meant the scheduler could incorrectly try to schedule new instances to an already at-capacity node. This was fixed with change Ibbf65a8d817d359786abcdffa6358089ed1107f6 to always report allocations from nova-compute for ironic instances. Another problem existed because even if ironic instances had their embedded flavor migrated to report custom resource usage, the driver would still report standard resource class inventory which meant the scheduler could incorrectly try to schedule non-baremetal flavors to ironic nodes. Since the code that reported standard resource class inventory was removed in Stein with change If2b8c1a76d7dbabbac7bb359c9e572cfed510800, a stable-branch only workaround was added in Id3c74c019da29070811ffc368351e2238b3f6da5 so deployments that had completed the data migration for their ironic instances could configure nova-compute to set [workarounds]/report_ironic_standard_resource_class_inventory=False so the driver would no longer report standard resource class inventory. Note that the code to always report ironic instance allocations from the compute service was also removed in Stein with change If272365e58a583e2831a15a5c2abad2d77921729. However (now we get to the current bug), if the driver no longer reports standard resource class inventory but the standard resource class usage on existing embedded instances does not have zeroed out values for those standard resource classes, because of the fix for Ibbf65a8d817d359786abcdffa6358089ed1107f6 the ResourceTracker will try to report allocations to placement for the standard resource classes which will fail if the ironic node resource provider does not have standard resource class inventory - which happens if report_ironic_standard_resource_class_inventory=False. Given reporting standard resource class inventory and usage has been removed in Stein this is not really an issue for Stein, but the embedded flavor data migration code still exists in Stein and this change deals with zero'ing out the embedded standard resource class usage so it does not get reported to the scheduler (which as noted above can fail depending on configuration). It should also be noted that the standard resource class zero'ing out should have always been a part of the data migration introduced in Pike, there is even a comment about it in the code itself: "This code can be removed in Queens, and will need to be updated to also alter extra_specs to zero-out the old-style standard resource classes of VCPU, MEMORY_MB, and DISK_GB." This change implements the latter part of that statement. Note that even though the standard resource classes will be zeroed out in the embedded instance flavor, that only overrides what is reported to placement (it actually causes those resource classes to *not* be reported for allocations - which is the fix), the vcpus/ram/disk attributes on the flavor itself are left untouched so the user can still get them as display information about their instance in the API. Change-Id: Ic64f5362de9a930e68e1649eaca4619ecde122de Closes-Bug: #1816034 (cherry picked from commit ca9335c)
- Loading branch information...
Showing with 110 additions and 13 deletions.
|@@ -0,0 +1,14 @@|
|Ironic instances have had their embedded flavor data migrated since the|
|16.0.0 Pike in order to report custom resource class allocations to the|
|Placement service. However, that data migration did not zero out the|
|standard resource classes (``VCPU``, ``MEMORY_MB``, ``DISK_GB``) on the|
|embedded flavor which meant trying to report allocations for those classes|
|to Placement would fail if the ironic compute node resource provider itself|
|no longer reported inventory for those resource classes. A fix has been|
|made for `bug 1816034 <https://bugs.launchpad.net/nova/+bug/1816034>`_|
|which will zero out standard resource class reporting for existing ironic|
|instances even if those instances have already been migrated once to|
|account for the custom resource class allocations.|