Adds support for Quantum networking in Hyper-V

Blueprint quantum-plugin-hyper-v

Adds a VIF plugin model to decouple the Nova Hyper-V compute driver
from the actual networking service in use.
Adds a VIF plugin for Quantum and a plugin for Nova networking.

The VIF driver is selected by mapping the value of the "network_api_class"
option to the corresponding VIF driver class name, avoiding this way an
otherwise redundant configuration option.

Change-Id: If35e814e3e5e181e79249c2f9ea86e878771e4c9
This commit is contained in:
Alessandro Pilotti
2013-01-11 20:41:50 +02:00
parent 76dbdc3e01
commit 72abb67fd6
8 changed files with 7 additions and 1 deletions

View File

@@ -68,7 +68,8 @@ class HyperVAPITestCase(basetestcase.BaseTestCase):
self._setup_stubs() self._setup_stubs()
self.flags(instances_path=r'C:\Hyper-V\test\instances', self.flags(instances_path=r'C:\Hyper-V\test\instances',
vswitch_name='external') vswitch_name='external',
network_api_class='nova.network.quantumv2.api.API')
self._hypervutils = hypervutils.HyperVUtils() self._hypervutils = hypervutils.HyperVUtils()
self._conn = driver_hyperv.HyperVDriver(None) self._conn = driver_hyperv.HyperVDriver(None)
@@ -119,6 +120,7 @@ class HyperVAPITestCase(basetestcase.BaseTestCase):
from nova.virt.hyperv import hostops from nova.virt.hyperv import hostops
from nova.virt.hyperv import livemigrationops from nova.virt.hyperv import livemigrationops
from nova.virt.hyperv import snapshotops from nova.virt.hyperv import snapshotops
from nova.virt.hyperv import vif
from nova.virt.hyperv import vmops from nova.virt.hyperv import vmops
from nova.virt.hyperv import volumeops from nova.virt.hyperv import volumeops
from nova.virt.hyperv import volumeutils from nova.virt.hyperv import volumeutils
@@ -129,6 +131,7 @@ class HyperVAPITestCase(basetestcase.BaseTestCase):
basevolumeutils, basevolumeutils,
baseops, baseops,
hostops, hostops,
vif,
vmops, vmops,
vmutils, vmutils,
volumeops, volumeops,
@@ -240,6 +243,9 @@ class HyperVAPITestCase(basetestcase.BaseTestCase):
self.assertEquals(len(dvd_paths), 0) self.assertEquals(len(dvd_paths), 0)
def test_spawn_no_vswitch_exception(self): def test_spawn_no_vswitch_exception(self):
self.flags(network_api_class='nova.network.api.API')
# Reinstantiate driver, as the VIF plugin is loaded during __init__
self._conn = driver_hyperv.HyperVDriver(None)
# Set flag to a non existing vswitch # Set flag to a non existing vswitch
self.flags(vswitch_name=str(uuid.uuid4())) self.flags(vswitch_name=str(uuid.uuid4()))
self.assertRaises(vmutils.HyperVException, self._spawn_instance, True) self.assertRaises(vmutils.HyperVException, self._spawn_instance, True)