if (vols.size() > 1) {
throw new InvalidParameterValueException(
"Data disks attached to the vm, can not migrate. Need to dettach data disks at first");
}
HypervisorType destHypervisorType = destPool.getHypervisor();
if (destHypervisorType == null) {
destHypervisorType = _clusterDao.findById(
destPool.getClusterId()).getHypervisorType();
}
if (vm.getHypervisorType() != destHypervisorType) {
throw new InvalidParameterValueException(
"hypervisor is not compatible: dest: "
+ destHypervisorType.toString() + ", vm: "
+ vm.getHypervisorType().toString());
}
_itMgr.storageMigration(vm.getUuid(), destPool);
return _vmDao.findById(vm.getId());