harikrishna-patnala opened a new pull request #3998: NPE when VM is planned to migrate to other host during dynamic scaling URL: https://github.com/apache/cloudstack/pull/3998 ## Description NPE occurred when dynamic scaling tried on VM and as part of this when MS tries to migrate VM if current host does not have capacity. Repro Steps: 1. Create a VM on host1 2. Make host1 capacity full by deploying multiple VMs 3. Try Dynamic scaling on VM on host1 4. NPE occurs when MS tries to find host to migrate the VM and then scale. 2020-03-27 05:37:15,899 WARN [c.c.v.UserVmManagerImpl] (API-Job-Executor-6:ctx-f7c76e69 job-3021 ctx-d68f535a) (logid:3189e554) Received exception while scaling java.lang.NullPointerException at com.cloud.deploy.DeploymentPlanningManagerImpl.planDeployment(DeploymentPlanningManagerImpl.java:255) at com.cloud.vm.VirtualMachineManagerImpl.findHostAndMigrate(VirtualMachineManagerImpl.java:3768) at com.cloud.vm.UserVmManagerImpl.upgradeRunningVirtualMachine(UserVmManagerImpl.java:1816) at com.cloud.vm.UserVmManagerImpl.upgradeVirtualMachine(UserVmManagerImpl.java:1702) at com.cloud.vm.UserVmManagerImpl.upgradeVirtualMachine(UserVmManagerImpl.java:1641) Root cause: VM profile is not initiated properly with serviceoffering before planning for deployment Solution: Initiate VM profile with serviceoffering and also make sure custom compute parameters are handled <!-- For new features, provide link to FS, dev ML discussion etc. --> <!-- In case of bug fix, the expected and actual behaviours, steps to reproduce. --> <!-- When "Fixes: #<id>" is specified, the issue/PR will automatically be closed when this PR gets merged --> <!-- For addressing multiple issues/PRs, use multiple "Fixes: #<id>" --> <!-- Fixes: # --> ## Types of changes <!--- What types of changes does your code introduce? Put an `x` in all the boxes that apply: --> - [ ] Breaking change (fix or feature that would cause existing functionality to change) - [ ] New feature (non-breaking change which adds functionality) - [x] Bug fix (non-breaking change which fixes an issue) - [ ] Enhancement (improves an existing feature and functionality) - [ ] Cleanup (Code refactoring and cleanup, that may add test cases) ## Screenshots (if appropriate): ## How Has This Been Tested? 1. Create a VM on host1 2. Make host1 capacity full by deploying multiple VMs 3. Try Dynamic scaling on VM on host1 4. Successfully scaled the VM after migration of VM to host2 <!-- Please describe in detail how you tested your changes. --> <!-- Include details of your testing environment, and the tests you ran to --> <!-- see how your change affects other areas of the code, etc. --> <!-- Please read the [CONTRIBUTING](https://github.com/apache/cloudstack/blob/master/CONTRIBUTING.md) document -->
---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: [email protected] With regards, Apache Git Services
