From fb8978b91e171bbdcb96f3cec9f9e0e9d112a2db Mon Sep 17 00:00:00 2001 From: Huan Xie Date: Wed, 29 Mar 2017 20:48:40 -0700 Subject: [PATCH] XenAPI: Don't use nicira-iface-id for XenServer VIF When using neutron polling mode, booting a VM will timeout because nova-compute cannot receive network-vif-plugged event. This is because we set vif['id'](i.e. neutron port uuid) to two different OVS ports. One is Xenserver VIF, the other is tap device qvo-XXXX which neutron ovs agent will monitor and deal with. My previous patch https://review.openstack.org/#/c/463246/ has deprecated the setting of 'nicira-iface-id' to XenServer. This patch is to remove the setting of 'nicira-iface-id'. Closes-Bug: #1732624 Change-Id: I221e89686c8e9041651f5affc4e3542d75ff55bc --- nova/tests/unit/virt/xenapi/test_vif.py | 4 +--- nova/tests/unit/virt/xenapi/test_vmops.py | 4 ++-- nova/virt/xenapi/vif.py | 4 +--- ...ated-nicira-iface-id-in-xenserver-870bfab82f22cac1.yaml | 7 +++++++ 4 files changed, 11 insertions(+), 8 deletions(-) create mode 100644 releasenotes/notes/remove-deprecated-nicira-iface-id-in-xenserver-870bfab82f22cac1.yaml diff --git a/nova/tests/unit/virt/xenapi/test_vif.py b/nova/tests/unit/virt/xenapi/test_vif.py index e5f419ca96..917a44cf21 100644 --- a/nova/tests/unit/virt/xenapi/test_vif.py +++ b/nova/tests/unit/virt/xenapi/test_vif.py @@ -47,7 +47,7 @@ def fake_call_xenapi(method, *args): return {'uuid': fake_vif['uuid'], 'MAC': fake_vif['address'], 'network': 'fake_network', - 'other_config': {'nicira-iface-id': fake_vif['id']} + 'other_config': {'neutron-port-id': fake_vif['id']} } else: raise exception.Exception("Failed get vif record") @@ -293,7 +293,6 @@ class XenAPIOpenVswitchDriverTestCase(XenVIFDriverTestBase): 'MAC': fake_vif['address'], 'network': 'fake_network', 'other_config': { - 'nicira-iface-id': 'fake-nicira-iface-id', 'neutron-port-id': 'fake-neutron-port-id'} } mock_VIF_get_record = self.mock_patch_object( @@ -327,7 +326,6 @@ class XenAPIOpenVswitchDriverTestCase(XenVIFDriverTestBase): 'MAC': fake_vif['address'], 'network': 'fake_network', 'other_config': { - 'nicira-iface-id': 'fake-nicira-iface-id', 'neutron-port-id': 'fake-neutron-port-id'} } mock_VIF_get_record = self.mock_patch_object( diff --git a/nova/tests/unit/virt/xenapi/test_vmops.py b/nova/tests/unit/virt/xenapi/test_vmops.py index 98e38468aa..2540f3165a 100644 --- a/nova/tests/unit/virt/xenapi/test_vmops.py +++ b/nova/tests/unit/virt/xenapi/test_vmops.py @@ -1793,8 +1793,8 @@ class LiveMigrateHelperTestCase(VMOpsTestBase): 'get_other_config') as mock_other_config, \ mock.patch.object(self._session.VM, 'get_VIFs') as mock_get_vif: - mock_other_config.side_effect = [{'nicira-iface-id': 'vif_id_a'}, - {'nicira-iface-id': 'vif_id_b'}] + mock_other_config.side_effect = [{'neutron-port-id': 'vif_id_a'}, + {'neutron-port-id': 'vif_id_b'}] mock_get_vif.return_value = ['vif_ref1'] vif_uuid_map = {'': 'default_net_ref'} vif_map = self.vmops._generate_vif_network_map('vm_ref', diff --git a/nova/virt/xenapi/vif.py b/nova/virt/xenapi/vif.py index ef2e19dcb0..b8c6c0cec7 100644 --- a/nova/virt/xenapi/vif.py +++ b/nova/virt/xenapi/vif.py @@ -274,9 +274,7 @@ class XenAPIOpenVswitchDriver(XenVIFDriver): vif_rec['MTU'] = '1500' vif_rec['qos_algorithm_type'] = '' vif_rec['qos_algorithm_params'] = {} - # Deprecated: 'niciria-iface-id', will remove it in the next release - vif_rec['other_config'] = {'nicira-iface-id': vif['id'], - 'neutron-port-id': vif['id']} + vif_rec['other_config'] = {'neutron-port-id': vif['id']} vif_ref = self._create_vif(vif, vif_rec, vm_ref) # call XenAPI to plug vif diff --git a/releasenotes/notes/remove-deprecated-nicira-iface-id-in-xenserver-870bfab82f22cac1.yaml b/releasenotes/notes/remove-deprecated-nicira-iface-id-in-xenserver-870bfab82f22cac1.yaml new file mode 100644 index 0000000000..6cc2ae8a96 --- /dev/null +++ b/releasenotes/notes/remove-deprecated-nicira-iface-id-in-xenserver-870bfab82f22cac1.yaml @@ -0,0 +1,7 @@ +--- +upgrade: + - | + Setting of 'nicira-iface-id' in XenServer VIF's other-config + field by XenAPI driver has been removed to avoid VM booting + timeout problem when using neutron polling mode. + It was previously deprecated in Pike.