diff options
| -rw-r--r-- | nova/network/quantum/manager.py | 1 | ||||
| -rw-r--r-- | nova/tests/test_xenapi.py | 3 | ||||
| -rw-r--r-- | nova/virt/xenapi/vif.py | 11 |
3 files changed, 10 insertions, 5 deletions
diff --git a/nova/network/quantum/manager.py b/nova/network/quantum/manager.py index 551c825e6..1b9023986 100644 --- a/nova/network/quantum/manager.py +++ b/nova/network/quantum/manager.py @@ -419,6 +419,7 @@ class QuantumManager(manager.FlatManager): network_dict = { 'cidr': v4_subnet['cidr'], 'injected': True, + 'bridge': net['bridge'], 'multi_host': False} q_tenant_id = project_id or FLAGS.quantum_default_tenant_id diff --git a/nova/tests/test_xenapi.py b/nova/tests/test_xenapi.py index 08441e19e..f0bc8c85f 100644 --- a/nova/tests/test_xenapi.py +++ b/nova/tests/test_xenapi.py @@ -339,7 +339,8 @@ class XenAPIVMTestCase(test.TestCase): 'ip': '192.168.0.100', 'netmask': '255.255.255.0'}], 'label': 'fake', - 'mac': 'DE:AD:BE:EF:00:00'}) + 'mac': 'DE:AD:BE:EF:00:00', + 'rxtx_cap': 3}) def check_vm_params_for_windows(self): self.assertEquals(self.vm['platform']['nx'], 'true') diff --git a/nova/virt/xenapi/vif.py b/nova/virt/xenapi/vif.py index 2f25efeb2..e3d7b9a7d 100644 --- a/nova/virt/xenapi/vif.py +++ b/nova/virt/xenapi/vif.py @@ -41,7 +41,6 @@ class XenAPIBridgeDriver(VIFDriver): else: network_ref = NetworkHelper.find_network_with_bridge( xenapi_session, network['bridge']) - rxtx_cap = network_mapping.pop('rxtx_cap') vif_rec = {} vif_rec['device'] = str(device) vif_rec['network'] = network_ref @@ -49,9 +48,13 @@ class XenAPIBridgeDriver(VIFDriver): vif_rec['MAC'] = network_mapping['mac'] vif_rec['MTU'] = '1500' vif_rec['other_config'] = {} - vif_rec['qos_algorithm_type'] = "ratelimit" if rxtx_cap else '' - vif_rec['qos_algorithm_params'] = \ - {"kbps": str(rxtx_cap * 1024)} if rxtx_cap else {} + if "rxtx_cap" in network_mapping: + vif_rec['qos_algorithm_type'] = "ratelimit" + vif_rec['qos_algorithm_params'] = \ + {"kbps": str(network_mapping['rxtx_cap'] * 1024)} + else: + vif_rec['qos_algorithm_type'] = "" + vif_rec['qos_algorithm_params'] = {} return vif_rec def ensure_vlan_bridge(self, xenapi_session, network): |
