]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
vmware: Fixes VMDK volume incompatibility issue
authorUnmesh Gurjar <unmesh.gurjar@hp.com>
Mon, 2 Jun 2014 13:14:55 +0000 (18:44 +0530)
committerUnmesh Gurjar <unmesh.gurjar@hp.com>
Thu, 12 Jun 2014 06:48:14 +0000 (12:18 +0530)
VMDK volume created in a cluster having ESXi 5.1 host has a high
hardware version i.e. 9; hence, fails when attached to instance
on an ESXi 5.0 host. This patch sets the hardware version to 8,
so that the volume can be attached to instances on any ESXi host
starting version 5.0 and above.

Change-Id: Ia750fd1183334005a834eb49be767451d87b338c
Closes-Bug: #1325586

cinder/tests/test_vmware_volumeops.py
cinder/volume/drivers/vmware/volumeops.py

index ab71dcb63eaa66e4fcb0514ae7e1e8e82c2accb8..5c761ecb4cc8384751a6877926599f796b1c23ab 100644 (file)
@@ -413,6 +413,7 @@ class VolumeOpsTestCase(test.TestCase):
         self.assertEqual(name, ret.name)
         self.assertEqual('[%s]' % ds_name, ret.files.vmPathName)
         self.assertEqual(1, ret.deviceChange[1].device.capacityInKB)
+        self.assertEqual("vmx-08", ret.version)
         expected = [mock.call.create('ns0:VirtualLsiLogicController'),
                     mock.call.create('ns0:VirtualDeviceConfigSpec'),
                     mock.call.create('ns0:VirtualDisk'),
index 8ba7b01f153ae5d2a8dced5c0b2eae953da33a99..e9def9e95b48fe48586a1a79c04557371ed5bdb7 100644 (file)
@@ -397,6 +397,11 @@ class VMwareVolumeOps(object):
         create_spec.memoryMB = 128
         create_spec.deviceChange = [controller_spec, disk_spec]
         create_spec.files = vm_file_info
+        # set the Hardware version to the lowest version supported by ESXi5.0
+        # and compatible with vCenter Server 5.0
+        # This ensures migration of volume created on a later ESX server
+        # works on any ESX server 5.0 and above.
+        create_spec.version = "vmx-08"
 
         if profileId:
             vmProfile = cf.create('ns0:VirtualMachineDefinedProfileSpec')