nova/nova/compute
Stephen Finucane a62dd42c0d libvirt: Delegate OVS plug to os-vif
os-vif 1.15.0 added the ability to create an OVS port during plugging
by specifying the 'create_port' attribute in the 'port_profile' field.
By delegating port creation to os-vif, we can rely on it's 'isolate_vif'
config option [1] that will temporarily configure the VLAN to 4095
(0xfff), which is reserved for implementation use [2] and is used by
neutron to as a dead VLAN [3]. By doing this, we ensure VIFs are plugged
securely, preventing guests from accessing other tenants' networks
before the neutron OVS agent can wire up the port.

This change requires a little dance as part of the live migration flow.
Since we can't be certain the destination host has a version of os-vif
that supports this feature, we need to use a sentinel to indicate when
it does. Typically we would do so with a field in
'LibvirtLiveMigrateData', such as the 'src_supports_numa_live_migration'
and 'dst_supports_numa_live_migration' fields used to indicate support
for NUMA-aware live migration. However, doing this prevents us
backporting this important fix since o.vo changes are not backportable.
Instead, we (somewhat evilly) rely on the free-form nature of the
'VIFMigrateData.profile_json' string field, which stores JSON blobs and
is included in 'LibvirtLiveMigrateData' via the 'vifs' attribute, to
transport this sentinel. This is a hack but is necessary to work around
the lack of a free-form "capabilities" style dict that would allow us do
backportable fixes to live migration features.

Note that this change has the knock on effect of modifying the XML
generated for OVS ports: when hybrid plug is false will now be of type
'ethernet' rather than 'bridge' as before. This explains the larger than
expected test damage but should not affect users.

[1] https://opendev.org/openstack/os-vif/src/tag/2.4.0/vif_plug_ovs/ovs.py#L90-L93
[2] https://en.wikipedia.org/wiki/IEEE_802.1Q#Frame_format
[3] https://answers.launchpad.net/neutron/+question/231806

Change-Id: I11fb5d3ada7f27b39c183157ea73c8b72b4e672e
Depends-On: Id12486b3127ab4ac8ad9ef2b3641da1b79a25a50
Closes-Bug: #1734320
Closes-Bug: #1815989
2021-04-30 12:51:35 +01:00
..
monitors Remove six.add_metaclass 2020-08-15 07:45:39 +00:00
__init__.py Remove nova.compute.*API() shims 2019-06-12 16:09:46 +01:00
api.py compute: Reject requests to commit intermediary snapshot of an inactive instance 2021-03-24 16:06:06 +00:00
build_results.py
claims.py objects: Add MigrationTypeField 2020-05-08 14:45:54 +01:00
flavors.py Remove six.text_type (1/2) 2020-12-13 11:25:31 +00:00
instance_actions.py api: Log os-resetState as an instance action 2021-01-18 09:19:58 +00:00
instance_list.py Plumbing for ignoring list_records_by_skipping_down_cells 2019-02-08 16:28:28 -05:00
manager.py libvirt: Delegate OVS plug to os-vif 2021-04-30 12:51:35 +01:00
migration_list.py Refactor scatter-gather utility to return exception objects 2018-10-31 15:18:07 -04:00
multi_cell_list.py Remove six.add_metaclass 2020-08-15 07:45:39 +00:00
power_state.py Removed enum duplication from nova.compute 2016-09-02 07:30:44 +00:00
provider_config.py Provider Config File: Coding style and test cases improvement 2020-09-01 01:05:34 +00:00
provider_tree.py Remove six.iteritems/itervalues/iterkeys 2020-11-07 03:25:26 +00:00
resource_tracker.py pci manager: replace node_id parameter with compute_node 2021-03-08 15:18:46 -05:00
rpcapi.py Bump the Compute RPC API to version 6.0 2021-03-25 11:23:07 +01:00
stats.py Change consecutive build failure limit to a weigher 2018-06-06 15:18:50 -07:00
task_states.py Fix resource tracker updates during instance evacuation 2018-09-12 13:05:29 +03:00
utils.py Merge "Refactor update_pci_request_spec_with_allocated_interface_name" 2021-01-28 22:20:03 +00:00
vm_states.py Removed enum duplication from nova.compute 2016-09-02 07:30:44 +00:00