From 43101af2924ef9ec8c7ab77a25c33ed8a053a14e Mon Sep 17 00:00:00 2001 From: Vipin Balachandran Date: Thu, 4 May 2017 11:52:49 -0700 Subject: [PATCH] VMware: Stop setting dynamicType To remove the storage policy associated with a volume in vCenter, we use a type in vSphere API called VirtualMachineEmptyProfileSpec. Prior to vSphere 6, this type has only an optional field 'dynamicType' inherited from its base class. Since oslo.vmware prunes empty types, we have to set this. But this property is now removed in vSphere 6.0+. Removing the statement to set 'dynamicType' and relying on oslo.vmware not to prune types without any fields set. Closes-bug: #1688373 Related-bug: #1688376 Change-Id: Id9d2d1b53ee4a6069d53e6f54704632354b96bbd --- cinder/tests/unit/volume/drivers/vmware/test_vmware_volumeops.py | 1 - cinder/volume/drivers/vmware/volumeops.py | 1 - 2 files changed, 2 deletions(-) diff --git a/cinder/tests/unit/volume/drivers/vmware/test_vmware_volumeops.py b/cinder/tests/unit/volume/drivers/vmware/test_vmware_volumeops.py index 0e3cb51e8c4..7b5599a4574 100644 --- a/cinder/tests/unit/volume/drivers/vmware/test_vmware_volumeops.py +++ b/cinder/tests/unit/volume/drivers/vmware/test_vmware_volumeops.py @@ -1219,7 +1219,6 @@ class VolumeOpsTestCase(test.TestCase): backing = mock.sentinel.backing self.vops.change_backing_profile(backing, None) - self.assertEqual('profile', empty_profile_spec.dynamicType) self.assertEqual([empty_profile_spec], reconfig_spec.vmProfile) get_disk_device.assert_called_once_with(backing) self.assertEqual(disk_device, disk_spec.device) diff --git a/cinder/volume/drivers/vmware/volumeops.py b/cinder/volume/drivers/vmware/volumeops.py index 27e7ffebfa4..fe55ad97601 100644 --- a/cinder/volume/drivers/vmware/volumeops.py +++ b/cinder/volume/drivers/vmware/volumeops.py @@ -1220,7 +1220,6 @@ class VMwareVolumeOps(object): if profile_id is None: vm_profile = cf.create('ns0:VirtualMachineEmptyProfileSpec') - vm_profile.dynamicType = 'profile' else: vm_profile = cf.create('ns0:VirtualMachineDefinedProfileSpec') vm_profile.profileId = profile_id.uniqueId