@@ -968,8 +968,10 @@ public UserVm resetVMUserData(ResetVMUserDataCmd cmd) throws ResourceUnavailable
968968 throw new InvalidParameterValueException("Operation not supported on Shared FileSystem Instance");
969969 }
970970 if (Hypervisor.HypervisorType.External.equals(userVm.getHypervisorType())) {
971- throw new InvalidParameterValueException (String .format ("Operation not supported for %s hypervisor Instance" ,
972- Hypervisor .HypervisorType .External .name ()));
971+ logger.error("Reset VM userdata not supported for {} as it is {} hypervisor instance",
972+ userVm, Hypervisor.HypervisorType.External.name());
973+ throw new InvalidParameterValueException(String.format("Operation not supported for instance: %s",
974+ userVm.getName()));
973975 }
974976 _accountMgr.checkAccess(caller, null, true, userVm);
975977
@@ -1019,8 +1021,10 @@ public UserVm resetVMSSHKey(ResetVMSSHKeyCmd cmd) throws ResourceUnavailableExce
10191021 throw new InvalidParameterValueException("Operation not supported on Shared FileSystem Instance");
10201022 }
10211023 if (Hypervisor.HypervisorType.External.equals(userVm.getHypervisorType())) {
1022- throw new InvalidParameterValueException (String .format ("Operation not supported for %s hypervisor Instance" ,
1023- Hypervisor .HypervisorType .External .name ()));
1024+ logger.error("Reset VM SSH key not supported for {} as it is {} hypervisor instance",
1025+ userVm, Hypervisor.HypervisorType.External.name());
1026+ throw new InvalidParameterValueException(String.format("Operation not supported for instance: %s",
1027+ userVm.getName()));
10241028 }
10251029
10261030 VMTemplateVO template = _templateDao.findByIdIncludingRemoved(userVm.getTemplateId());
@@ -1954,8 +1958,10 @@ public UserVm upgradeVirtualMachine(ScaleVMCmd cmd) throws ResourceUnavailableEx
19541958 throw new InvalidParameterValueException("Unable to find VM's UUID");
19551959 }
19561960 if (Hypervisor.HypervisorType.External.equals(vm.getHypervisorType())) {
1957- throw new InvalidParameterValueException (String .format ("Operation not supported for %s hypervisor Instance" ,
1958- Hypervisor .HypervisorType .External .name ()));
1961+ logger.error("Scale VM not supported for {} as it is {} hypervisor instance",
1962+ vm, Hypervisor.HypervisorType.External.name());
1963+ throw new InvalidParameterValueException(String.format("Operation not supported for instance: %s",
1964+ vm.getName()));
19591965 }
19601966 CallContext.current().setEventDetails("Vm Id: " + vm.getUuid());
19611967
@@ -8539,8 +8545,10 @@ public UserVm restoreVM(RestoreVMCmd cmd) throws InsufficientCapacityException,
85398545 throw new InvalidParameterValueException("Operation not supported on Shared FileSystem Instance");
85408546 }
85418547 if (Hypervisor.HypervisorType.External.equals(vm.getHypervisorType())) {
8542- throw new InvalidParameterValueException (String .format ("Operation not supported for %s hypervisor Instance" ,
8543- Hypervisor .HypervisorType .External .name ()));
8548+ logger.error("Restore VM not supported for {} as it is {} hypervisor instance",
8549+ vm, Hypervisor.HypervisorType.External.name());
8550+ throw new InvalidParameterValueException(String.format("Operation not supported for instance: %s",
8551+ vm.getName()));
85448552 }
85458553 _accountMgr.checkAccess(caller, null, true, vm);
85468554
0 commit comments