File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed
server/src/main/java/com/cloud/vm Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -6589,10 +6589,7 @@ private VMInstanceVO preVmStorageMigrationCheck(Long vmId) {
65896589 }
65906590
65916591 HypervisorType hypervisorType = vm .getHypervisorType ();
6592- if (vm .getType () != VirtualMachine .Type .User &&
6593- (!hypervisorType .isFunctionalitySupported (HypervisorType .Functionality .VmStorageMigration )
6594- || hypervisorType .equals (HypervisorType .XenServer ))) {
6595-
6592+ if (!hypervisorSupportsNonUserVMStorageMigration (vm , hypervisorType )) {
65966593 List <HypervisorType > supportedHypervisors = HypervisorType .getListOfHypervisorsSupportingFunctionality (HypervisorType .Functionality .VmStorageMigration )
65976594 .stream ().filter (hypervisor -> !hypervisor .equals (HypervisorType .XenServer )).collect (Collectors .toList ());
65986595 throw new InvalidParameterValueException (String .format (
@@ -6614,6 +6611,12 @@ private VMInstanceVO preVmStorageMigrationCheck(Long vmId) {
66146611 return vm ;
66156612 }
66166613
6614+ private boolean hypervisorSupportsNonUserVMStorageMigration (VirtualMachine vm , HypervisorType hypervisorType ) {
6615+ return vm .getType () == VirtualMachine .Type .User ||
6616+ (hypervisorType .isFunctionalitySupported (HypervisorType .Functionality .VmStorageMigration )
6617+ && !hypervisorType .equals (HypervisorType .XenServer ));
6618+ }
6619+
66176620 private VirtualMachine findMigratedVm (long vmId , VirtualMachine .Type vmType ) {
66186621 if (VirtualMachine .Type .User .equals (vmType )) {
66196622 return _vmDao .findById (vmId );
You can’t perform that action at this time.
0 commit comments