boolean storageMotionSupported = false;
// Check if the underlying hypervisor supports storage motion.
Long hostId = vm.getHostId();
if (hostId != null) {
HostVO host = _hostDao.findById(hostId);
HypervisorCapabilitiesVO capabilities = null;
if (host != null) {
capabilities = _hypervisorCapabilitiesDao.findByHypervisorTypeAndVersion(host.getHypervisorType(),
host.getHypervisorVersion());
} else {
s_logger.error("Details of the host on which the vm " + vm + ", to which volume "+ volume + " is "
+ "attached, couldn't be retrieved.");
}
if (capabilities != null) {
storageMotionSupported = capabilities.isStorageMotionSupported();
} else {
s_logger.error("Capabilities for host " + host + " couldn't be retrieved.");
}
}