bug 13570: vmware cant find vmroot disk because the uuid gets truncated and cloudstack cant reference

truncating template name to 32 chars so they work well with vSphere API
This commit is contained in:
Murali reddy 2012-02-10 17:00:20 +05:30
parent 9a6e0abe8c
commit 6e2aee8320

View File

@ -109,6 +109,8 @@ public class VmwareStorageManagerImpl implements VmwareStorageManager {
VmwareHypervisorHost hyperHost = hostService.getHyperHost(context, cmd);
String templateUuidName = UUID.nameUUIDFromBytes((templateName + "@" + cmd.getPoolUuid() + "-" + hyperHost.getMor().get_value()).getBytes()).toString();
// truncate template name to 32 chars to ensure they work well with vSphere API's.
templateUuidName = templateUuidName.replace("-", "");
DatacenterMO dcMo = new DatacenterMO(context, hyperHost.getHyperHostDatacenter());
VirtualMachineMO templateMo = VmwareHelper.pickOneVmOnRunningHost(dcMo.findVmByNameAndLabel(templateUuidName), true);