Github user pedro-martins commented on a diff in the pull request: https://github.com/apache/cloudstack/pull/868#discussion_r52022212 --- Diff: server/src/com/cloud/vm/UserVmManagerImpl.java --- @@ -1535,6 +1535,19 @@ private boolean upgradeRunningVirtualMachine(Long vmId, Long newServiceOfferingI + ",memory=," + currentMemory + ")"); } + _offeringDao.loadDetails(currentServiceOffering); + _offeringDao.loadDetails(newServiceOffering); + + Map<String, String> currentDetails = currentServiceOffering.getDetails(); + Map<String, String> newDetails = newServiceOffering.getDetails(); + String currentVgpuType = currentDetails.get("vgpuType"); + String newVgpuType = newDetails.get("vgpuType"); + if(currentVgpuType != null) { + if(newVgpuType == null || !newVgpuType.equalsIgnoreCase(currentVgpuType)) { + throw new InvalidParameterValueException("Dynamic scaling of vGPU type is not supported. VM has vGPU Type: " + currentVgpuType); + } + } + // Check resource limits --- End diff -- Hi @anshul1886, Could you extract the codes between lines 1541 - 1549 to a method with an auto described name, do some test cases to this new method and create a Javadoc explaining what the method do, what params it receive, the exceptions it throws and what can cause the exception? Ty.
--- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---