diff options
| author | Jenkins <jenkins@review.openstack.org> | 2013-02-12 22:13:47 +0000 |
|---|---|---|
| committer | Gerrit Code Review <review@openstack.org> | 2013-02-12 22:13:47 +0000 |
| commit | 97805adfb3d1077c12bb8f89247102e3f6fd41e4 (patch) | |
| tree | 8c5fec11b053721df0d958c16091fb4d9efe854f | |
| parent | a692ba301bc9127c79b2b32c6762f0d5e56be256 (diff) | |
| parent | ac7188f330683ce480b7b362997ec88b151b9749 (diff) | |
Merge "make vmwareapi driver pass quantum port-id to ESX"
| -rw-r--r-- | nova/tests/test_vmwareapi.py | 1 | ||||
| -rw-r--r-- | nova/virt/vmwareapi/vm_util.py | 19 | ||||
| -rw-r--r-- | nova/virt/vmwareapi/vmops.py | 1 |
3 files changed, 21 insertions, 0 deletions
diff --git a/nova/tests/test_vmwareapi.py b/nova/tests/test_vmwareapi.py index 22544fd2d..74c786a86 100644 --- a/nova/tests/test_vmwareapi.py +++ b/nova/tests/test_vmwareapi.py @@ -60,6 +60,7 @@ class VMwareAPIVMTestCase(test.TestCase): 'bridge_interface': None, 'injected': True}, {'broadcast': '192.168.0.255', + 'id': 'foo', 'dns': ['192.168.0.1'], 'gateway': '192.168.0.1', 'gateway_v6': 'dead:beef::1', diff --git a/nova/virt/vmwareapi/vm_util.py b/nova/virt/vmwareapi/vm_util.py index c1015cb13..bc3bd8a9c 100644 --- a/nova/virt/vmwareapi/vm_util.py +++ b/nova/virt/vmwareapi/vm_util.py @@ -73,6 +73,25 @@ def get_vm_create_spec(client_factory, instance, data_store_name, device_config_spec = vif_spec_list config_spec.deviceChange = device_config_spec + + # add vm-uuid and iface-id.x values for Quantum + extra_config = [] + opt = client_factory.create('ns0:OptionValue') + opt.key = "nvp.vm-uuid" + opt.value = instance['uuid'] + extra_config.append(opt) + + i = 0 + for vif_info in vif_infos: + if vif_info['iface_id']: + opt = client_factory.create('ns0:OptionValue') + opt.key = "nvp.iface-id.%d" % i + opt.value = vif_info['iface_id'] + extra_config.append(opt) + i += 1 + + config_spec.extraConfig = extra_config + return config_spec diff --git a/nova/virt/vmwareapi/vmops.py b/nova/virt/vmwareapi/vmops.py index 106de0cb0..4b8f926e3 100644 --- a/nova/virt/vmwareapi/vmops.py +++ b/nova/virt/vmwareapi/vmops.py @@ -189,6 +189,7 @@ class VMwareVMOps(object): vif_infos.append({'network_name': network_name, 'mac_address': mac_address, 'network_ref': network_ref, + 'iface_id': mapping.get('id'), }) return vif_infos |
