nvazquez commented on code in PR #7881:
URL: https://github.com/apache/cloudstack/pull/7881#discussion_r1310905819
##########
engine/storage/src/main/java/org/apache/cloudstack/storage/image/BaseImageStoreDriverImpl.java:
##########
@@ -220,6 +235,20 @@ protected Void
createTemplateAsyncCallback(AsyncCallbackDispatcher<? extends Bas
LOGGER.debug("Template is already in DOWNLOADED state,
ignore further incoming DownloadAnswer");
}
return null;
+ } else if (template.isMigratedFromVmwareVM() && answer != null &&
answer.getDownloadStatus() == VMTemplateStorageResourceAssoc.Status.DOWNLOADED)
{
+ OVFInformationTO ovfInformationTO =
answer.getOvfInformationTO();
+ if (ovfInformationTO != null) {
+ List<DatadiskTO> disks = ovfInformationTO.getDisks();
+ if (CollectionUtils.isNotEmpty(disks)) {
+
persistTemplateDisksAsChildrenFromMigratedVmwareVm(template.getId(), disks,
store.getId());
+ }
+ }
+ List<VMTemplateDetailVO> details =
templateDetailsDao.listDetails(template.getId());
+ if (CollectionUtils.isNotEmpty(details)) {
+ Map<String, String> params = createRemoveDetails(details);
+ HypervisorGuru vmwareGuru =
hypervisorGuruManager.getGuru(Hypervisor.HypervisorType.VMware);
+
vmwareGuru.removeHypervisorVMOutOfBand(params.get(VmDetailConstants.VMWARE_HOST),
params.get(VmDetailConstants.VMWARE_VM_NAME), params);
Review Comment:
I actually put the first two parameters trying to think on a general case,
perhaps for other hypervisor (if it would support it) it will be only enough
with the host IP and VM name instead of the parameters which include the
vCenter credentials for the VMware case
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]