From 6e2aee83209bff5d05fc86eca324161d64ca2817 Mon Sep 17 00:00:00 2001 From: Murali reddy Date: Fri, 10 Feb 2012 17:00:20 +0530 Subject: [PATCH] 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 --- .../hypervisor/vmware/manager/VmwareStorageManagerImpl.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/core/src/com/cloud/hypervisor/vmware/manager/VmwareStorageManagerImpl.java b/core/src/com/cloud/hypervisor/vmware/manager/VmwareStorageManagerImpl.java index 881a8fe04cb..02f444ec78e 100644 --- a/core/src/com/cloud/hypervisor/vmware/manager/VmwareStorageManagerImpl.java +++ b/core/src/com/cloud/hypervisor/vmware/manager/VmwareStorageManagerImpl.java @@ -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);