From 433eeac5a29d191d424b377f9bdc324a2bcc73c1 Mon Sep 17 00:00:00 2001 From: Vyacheslav Tabolin Date: Fri, 12 Aug 2016 09:59:32 +0000 Subject: [PATCH] Nova.patch update for support DVS/PG IDs for VIFs Change-Id: I1691b6f8d3b173fd7044681943346b734770e8f7 --- .../puppet/modules/vmware_dvs/files/nova.patch | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/deployment_scripts/puppet/modules/vmware_dvs/files/nova.patch b/deployment_scripts/puppet/modules/vmware_dvs/files/nova.patch index 17c6f12..f93cf72 100644 --- a/deployment_scripts/puppet/modules/vmware_dvs/files/nova.patch +++ b/deployment_scripts/puppet/modules/vmware_dvs/files/nova.patch @@ -1,11 +1,16 @@ -diff --git a/nova/virt/vmwareapi/vif.py b/nova/virt/vmwareapi/vif.py -index 3d228d7..d513a74 100644 --- a/nova/virt/vmwareapi/vif.py +++ b/nova/virt/vmwareapi/vif.py -@@ -146,6 +146,10 @@ +@@ -145,7 +145,16 @@ + def get_network_ref(session, cluster, vif, is_neutron): if is_neutron: - network_ref = _get_neutron_network(session, cluster, vif) +- network_ref = _get_neutron_network(session, cluster, vif) ++ try: ++ network_ref = {'dvsw': vif['details']['dvs_id'], ++ 'dvpg': vif['details']['pg_id'], ++ 'type': 'DistributedVirtualPortgroup'} ++ except KeyError: ++ network_ref = _get_neutron_network(session, cluster, vif) + try: + network_ref['dvs_port_key'] = vif['details']['dvs_port_key'] + except KeyError: @@ -14,10 +19,9 @@ index 3d228d7..d513a74 100644 create_vlan = vif['network'].get_meta('should_create_vlan', False) network_ref = ensure_vlan_bridge(session, vif, cluster=cluster, diff --git a/nova/virt/vmwareapi/vm_util.py b/nova/virt/vmwareapi/vm_util.py -index bbf2835..be68010 100644 --- a/nova/virt/vmwareapi/vm_util.py +++ b/nova/virt/vmwareapi/vm_util.py -@@ -339,6 +339,10 @@ def _create_vif_spec(client_factory, vif_info): +@@ -453,6 +453,10 @@ 'ns0:DistributedVirtualSwitchPortConnection') portgroup.switchUuid = network_ref['dvsw'] portgroup.portgroupKey = network_ref['dvpg']