]> xenbits.xensource.com Git - osstest/openstack-nova.git/commitdiff
Remove sata bus for virtuozzo hypervisor
authorMikhail Feoktistov <mfeoktistov@virtuozzo.com>
Mon, 3 Oct 2016 15:07:50 +0000 (11:07 -0400)
committerMatt Riedemann <mriedem@us.ibm.com>
Wed, 23 Nov 2016 22:38:18 +0000 (22:38 +0000)
In virtuozzo 7 we have changed disk bus from sata to scsi.
Sata is not supported in virtuozzo 7.
We don't need to support sata bus for virtuozzo in nova.
Virtuozzo 6 may work with python 2.6 only and
it's not possible to run upstream nova on virtuozzo 6.
We always use this patch in our internal infrastructure
to run openstack on virtuozzo 7.
Also in this patch we have changed tests for hypervisor version.
We don't need to check libvirt version in case of Virtuozzo hypervisor.
Because Virtuozzo 7 always has libvirt with
support of 'parallels' virt type.

Docs have already been updated:

If3d2f402bb1b21bec360693a6c1e9d73e998d167

Change-Id: If3d5e39bd745c0df74316a90159fffb3221864cc

nova/tests/unit/virt/libvirt/test_blockinfo.py
nova/tests/unit/virt/libvirt/test_driver.py
nova/virt/libvirt/blockinfo.py
nova/virt/libvirt/driver.py
releasenotes/notes/supported-virtuozzo-version-569db9259a7ee579.yaml [new file with mode: 0644]

index 58d3e591fc18a9b4dff4d7fc07145b1404b33237..a1b6e9169225d056976612590b98efb8c989c641 100644 (file)
@@ -755,11 +755,15 @@ class LibvirtBlockInfoTest(test.NoDBTestCase):
                 self.assertEqual(res, bus)
 
         expected = (
-                ('scsi', None, 'disk', 'scsi'),
-                (None, 'scsi', 'cdrom', 'scsi'),
-                ('usb', None, 'disk', 'usb')
+                ('kvm', 'scsi', None, 'disk', 'scsi'),
+                ('kvm', None, 'scsi', 'cdrom', 'scsi'),
+                ('kvm', 'usb', None, 'disk', 'usb'),
+                ('parallels', 'scsi', None, 'disk', 'scsi'),
+                ('parallels', None, None, 'disk', 'scsi'),
+                ('parallels', None, 'ide', 'cdrom', 'ide'),
+                ('parallels', None, None, 'cdrom', 'ide')
                 )
-        for dbus, cbus, dev, res in expected:
+        for hv, dbus, cbus, dev, res in expected:
             props = {}
             if dbus is not None:
                 props['hw_disk_bus'] = dbus
@@ -768,7 +772,7 @@ class LibvirtBlockInfoTest(test.NoDBTestCase):
             image_meta = objects.ImageMeta.from_dict(
                 {'properties': props})
             bus = blockinfo.get_disk_bus_for_device_type(
-                instance, 'kvm', image_meta, device_type=dev)
+                instance, hv, image_meta, device_type=dev)
             self.assertEqual(res, bus)
 
         image_meta = objects.ImageMeta.from_dict(
index 25c6aea9edc5429e87f0d1eca89a9d818bc64d6f..d2e02992c24e2530dbf702cde4e1e2a4fa2a88e3 100644 (file)
@@ -14560,19 +14560,51 @@ class LibvirtConnTestCase(test.NoDBTestCase):
         string_ver = driver._version_to_string((4, 33, 173))
         self.assertEqual("4.33.173", string_ver)
 
-    def test_parallels_min_version_fail(self):
+    def test_virtuozzo_min_version_fail(self):
         self.flags(virt_type='parallels', group='libvirt')
         driver = libvirt_driver.LibvirtDriver(fake.FakeVirtAPI(), False)
-        with mock.patch.object(driver._conn, 'getLibVersion',
-                               return_value=1002011):
+        with test.nested(
+                    mock.patch.object(
+                        driver._conn, 'getVersion'),
+                    mock.patch.object(
+                        driver._conn, 'getLibVersion'))\
+            as (mock_getver, mock_getlibver):
+            mock_getver.return_value = \
+                versionutils.convert_version_to_int(
+                    libvirt_driver.MIN_VIRTUOZZO_VERSION) - 1
+            mock_getlibver.return_value = \
+                versionutils.convert_version_to_int(
+                    libvirt_driver.MIN_LIBVIRT_VIRTUOZZO_VERSION)
+
+            self.assertRaises(exception.NovaException,
+                              driver.init_host, 'wibble')
+
+            mock_getver.return_value = \
+                versionutils.convert_version_to_int(
+                    libvirt_driver.MIN_VIRTUOZZO_VERSION)
+            mock_getlibver.return_value = \
+                versionutils.convert_version_to_int(
+                    libvirt_driver.MIN_LIBVIRT_VIRTUOZZO_VERSION) - 1
+
             self.assertRaises(exception.NovaException,
                               driver.init_host, 'wibble')
 
-    def test_parallels_min_version_ok(self):
+    def test_virtuozzo_min_version_ok(self):
         self.flags(virt_type='parallels', group='libvirt')
         driver = libvirt_driver.LibvirtDriver(fake.FakeVirtAPI(), False)
-        with mock.patch.object(driver._conn, 'getLibVersion',
-                               return_value=1002012):
+        with test.nested(
+                    mock.patch.object(
+                        driver._conn, 'getVersion'),
+                    mock.patch.object(
+                        driver._conn, 'getLibVersion'))\
+            as (mock_getver, mock_getlibver):
+            mock_getver.return_value = \
+                versionutils.convert_version_to_int(
+                    libvirt_driver.MIN_VIRTUOZZO_VERSION)
+            mock_getlibver.return_value = \
+                versionutils.convert_version_to_int(
+                    libvirt_driver.MIN_LIBVIRT_VIRTUOZZO_VERSION)
+
             driver.init_host('wibble')
 
     def test_get_guest_config_parallels_vm(self):
index 6ebf6d20a4fbe143a3de2732951d4b63d5e50381..8158a2c5c01be39238a331c2c300b736bb530135 100644 (file)
@@ -209,7 +209,7 @@ def is_disk_bus_valid_for_virt(virt_type, disk_bus):
         'xen': ['xen', 'ide'],
         'uml': ['uml'],
         'lxc': ['lxc'],
-        'parallels': ['ide', 'scsi', 'sata']
+        'parallels': ['ide', 'scsi']
         }
 
     if virt_type not in valid_bus:
@@ -274,7 +274,7 @@ def get_disk_bus_for_device_type(instance,
         if device_type == "cdrom":
             return "ide"
         elif device_type == "disk":
-            return "sata"
+            return "scsi"
     else:
         # If virt-type not in list then it is unsupported
         raise exception.UnsupportedVirtType(virt=virt_type)
@@ -301,8 +301,6 @@ def get_disk_bus_for_disk_dev(virt_type, disk_dev):
         # this picks the most likely mappings
         if virt_type == "xen":
             return "xen"
-        elif virt_type == "parallels":
-            return "sata"
         else:
             return "scsi"
     elif disk_dev.startswith('vd'):
index aba3afe643a055e71a11973741977166556ccd1e..3c01f5718b24dd033ba435117825323191c64613 100644 (file)
@@ -252,8 +252,9 @@ MIN_LIBVIRT_UEFI_VERSION = (1, 2, 9)
 MIN_LIBVIRT_HYPERV_TIMER_VERSION = (1, 2, 2)
 MIN_QEMU_HYPERV_TIMER_VERSION = (2, 0, 0)
 
-# parallels driver support
-MIN_LIBVIRT_PARALLELS_VERSION = (1, 2, 12)
+# Virtuozzo driver support
+MIN_VIRTUOZZO_VERSION = (7, 0, 0)
+MIN_LIBVIRT_VIRTUOZZO_VERSION = (1, 2, 12)
 
 # Ability to set the user guest password with Qemu
 MIN_LIBVIRT_SET_ADMIN_PASSWD = (1, 2, 16)
@@ -495,12 +496,16 @@ class LibvirtDriver(driver.ComputeDriver):
                 _('Nova requires QEMU version %s or greater.') %
                 self._version_to_string(MIN_QEMU_VERSION))
 
-        if (CONF.libvirt.virt_type == 'parallels' and
-            not self._host.has_min_version(MIN_LIBVIRT_PARALLELS_VERSION)):
-            raise exception.NovaException(
-                _('Running Nova with parallels virt_type requires '
-                  'libvirt version %s') %
-                self._version_to_string(MIN_LIBVIRT_PARALLELS_VERSION))
+        if CONF.libvirt.virt_type == 'parallels':
+            if not self._host.has_min_version(hv_ver=MIN_VIRTUOZZO_VERSION):
+                raise exception.NovaException(
+                    _('Nova requires Virtuozzo version %s or greater.') %
+                    self._version_to_string(MIN_VIRTUOZZO_VERSION))
+            if not self._host.has_min_version(MIN_LIBVIRT_VIRTUOZZO_VERSION):
+                raise exception.NovaException(
+                    _('Running Nova with parallels virt_type requires '
+                      'libvirt version %s') %
+                    self._version_to_string(MIN_LIBVIRT_VIRTUOZZO_VERSION))
 
         # Give the cloud admin a heads up if we are intending to
         # change the MIN_LIBVIRT_VERSION in the next release.
diff --git a/releasenotes/notes/supported-virtuozzo-version-569db9259a7ee579.yaml b/releasenotes/notes/supported-virtuozzo-version-569db9259a7ee579.yaml
new file mode 100644 (file)
index 0000000..30e925a
--- /dev/null
@@ -0,0 +1,5 @@
+---
+upgrade:
+  - As of Ocata, the minimum version of Virtuozzo that nova compute will
+    interoperate with will be 7.0.0. Deployments using older versions of
+    Virtuozzo should upgrade.