diff --git a/plugins/hypervisors/vmware/src/main/java/com/cloud/hypervisor/guru/VmwareVmImplementer.java b/plugins/hypervisors/vmware/src/main/java/com/cloud/hypervisor/guru/VmwareVmImplementer.java index 5c61887176c..c12c5c20e2d 100644 --- a/plugins/hypervisors/vmware/src/main/java/com/cloud/hypervisor/guru/VmwareVmImplementer.java +++ b/plugins/hypervisors/vmware/src/main/java/com/cloud/hypervisor/guru/VmwareVmImplementer.java @@ -188,8 +188,12 @@ class VmwareVmImplementer { private void setDeployAsIsInfoTO(VirtualMachineProfile vm, VirtualMachineTO to, Map details) { String configuration = details.getOrDefault(VmDetailConstants.DEPLOY_AS_IS_CONFIGURATION, null); Map properties = deployAsIsHelper.getVirtualMachineDeployAsIsProperties(vm); - String destStoragePool = deployAsIsHelper.getAllocatedVirtualMachineDestinationStoragePool(vm); - String templatePath = deployAsIsHelper.getAllocatedVirtualMachineTemplatePath(vm, configuration, destStoragePool); + String templatePath = null; + String destStoragePool = null; + if (vm.getVirtualMachine().getState() == VirtualMachine.State.Starting) { + destStoragePool = deployAsIsHelper.getAllocatedVirtualMachineDestinationStoragePool(vm); + templatePath = deployAsIsHelper.getAllocatedVirtualMachineTemplatePath(vm, configuration, destStoragePool); + } Map nicsAdapterMapping = deployAsIsHelper.getAllocatedVirtualMachineNicsAdapterMapping(vm, to.getNics()); DeployAsIsInfoTO info = new DeployAsIsInfoTO(templatePath, destStoragePool, properties, nicsAdapterMapping); to.setDeployAsIsInfo(info);