Skip to content

Commit 6e2aee8

Browse files
Murali reddyMurali reddy
authored andcommitted
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
1 parent 9a6e0ab commit 6e2aee8

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

‎core/src/com/cloud/hypervisor/vmware/manager/VmwareStorageManagerImpl.java‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,8 @@ public Answer execute(VmwareHostService hostService, PrimaryStorageDownloadComma
109109
VmwareHypervisorHost hyperHost = hostService.getHyperHost(context, cmd);
110110

111111
String templateUuidName = UUID.nameUUIDFromBytes((templateName + "@" + cmd.getPoolUuid() + "-" + hyperHost.getMor().get_value()).getBytes()).toString();
112+
// truncate template name to 32 chars to ensure they work well with vSphere API's.
113+
templateUuidName = templateUuidName.replace("-", "");
112114

113115
DatacenterMO dcMo = new DatacenterMO(context, hyperHost.getHyperHostDatacenter());
114116
VirtualMachineMO templateMo = VmwareHelper.pickOneVmOnRunningHost(dcMo.findVmByNameAndLabel(templateUuidName), true);

0 commit comments

Comments
 (0)