VirtualMachineMO vmMo = hyperHost.findVmOnHyperHost(volume.getVmName());
if (vmMo == null) {
if(s_logger.isDebugEnabled()) {
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();