As discussed on the Nova-Neutron cross project session of the Ussuri/Shanghai PTG [1]: * Nova and Neutron will need to cooperate to identify the resource providers representing the same physical NICs. * This will happen by Nova adding both RPs (created by Nova and Neutron respectively) representing the same physical NIC to one resource provider aggregate. * Resource providers have a generation attribute to detect concurrent updates to the same RP (and its traits, inventories and aggregates). * Therefore Neutron will start seeing update failures because of concurrent updates by Nova and retry its operation if it failed because of a concurrent (but otherwise irrelevant) update. NOTE: The logic added to update inventory, inventories and traits should be added to update resource provider too, but that API request does not take a generation parameter today - which is likely a bug on the placement side. Generation conflicts are signalled not just by the 409 Conflict HTTP response code but by the placement.concurrent_update error code inside the HTTP JSON body. This is only available in Placement microversions 1.23+, therefore we bump the Placement microversion used in neutron-lib to 1.23. While implementing this change I noticed that update_resource_provider_inventory and update_resource_provider_inventories translated HTTP 409 Conflicts to different neutron exception classes - which I deemed to be a bug in placement client code and corrected it in this change too. [1] https://etherpad.openstack.org/p/ptg-ussuri-xproj-nova-neutron Change-Id: I2696c9e407cd5661a49d7d8c6b0232375682f827
31 KiB
31 KiB