CLOUDSTACK-3616 [VMware] Failed to create template from volume (volume is created from snapshot of data volume)

Signed-off-by: Sateesh Chodapuneedi <sateesh@apache.org>
This commit is contained in:
Sateesh Chodapuneedi 2013-08-07 14:49:32 +05:30
parent a6076818e0
commit a470b33f97
1 changed files with 8 additions and 0 deletions

View File

@ -740,6 +740,14 @@ public class VmwareStorageProcessor implements StorageProcessor {
s_logger.debug("Unable to find the owner VM for CreatePrivateTemplateFromVolumeCommand on host " + hyperHost.getHyperHostName() + ", try within datacenter");
vmMo = hyperHost.findVmOnPeerHyperHost(volume.getVmName());
if (vmMo == null) {
// This means either the volume is on a zone wide storage pool or VM is deleted by external entity.
// Look for the VM in the datacenter.
ManagedObjectReference dcMor = hyperHost.getHyperHostDatacenter();
DatacenterMO dcMo = new DatacenterMO(context, dcMor);
vmMo = dcMo.findVm(volume.getVmName());
}
if(vmMo == null) {
String msg = "Unable to find the owner VM for volume operation. vm: " + volume.getVmName();
s_logger.error(msg);