From: Unmesh Gurjar Date: Mon, 2 Jun 2014 13:14:55 +0000 (+0530) Subject: vmware: Fixes VMDK volume incompatibility issue X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=a23a80aeb8a35cd421fe63c984bf64f24f0dcb3c;p=openstack-build%2Fcinder-build.git vmware: Fixes VMDK volume incompatibility issue 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 --- diff --git a/cinder/tests/test_vmware_volumeops.py b/cinder/tests/test_vmware_volumeops.py index ab71dcb63..5c761ecb4 100644 --- a/cinder/tests/test_vmware_volumeops.py +++ b/cinder/tests/test_vmware_volumeops.py @@ -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'), diff --git a/cinder/volume/drivers/vmware/volumeops.py b/cinder/volume/drivers/vmware/volumeops.py index 8ba7b01f1..e9def9e95 100644 --- a/cinder/volume/drivers/vmware/volumeops.py +++ b/cinder/volume/drivers/vmware/volumeops.py @@ -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')