[ 
https://issues.apache.org/jira/browse/CLOUDSTACK-8088?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Saksham Srivastava updated CLOUDSTACK-8088:
-------------------------------------------
    Description: 
setup
-------
Vcenter 5.5 (esxi-5.5) setup 

steps to reproduce
------------------------
1-enable zone level setting enable.dynamic.scale.vm
2-deploy a vm which is dynamically scalable
3- try to scale up vm to medium SO (#cpu=1,cpu=1000,mem=1024)

expected
-----------
scaling up should be sucessful

actual
-------
scaling up is failing with error
com.cloud.utils.exception.CloudRuntimeException: Unable to scale vm due to 
Unable to execute ScaleVmCommand due to java.lang.NullPointerException


During scale vm command, in VmwareResource.java the following line is executed 
where there is no value sent in the 'details' map for the configuration 
parameter 'vmware.reserve.mem'. because of this NPE is occured.

int getReservedMemoryMb(VirtualMachineTO vmSpec) {
if 
(vmSpec.getDetails().get(VMwareGuru.VmwareReserveMemory.key()).equalsIgnoreCase("true"))
 { ...

In VirtualMachineManagerImpl.java ScaleVmCommand is prepared where 
VirtualMachineTO transfer object is created as following where we are not 
setting 'details' map.

public ScaleVmCommand(String vmName, int cpus, Integer minSpeed, Integer 
maxSpeed, long minRam, long maxRam, boolean limitCpuUse) {
.....
this.vm = new VirtualMachineTO(1L, vmName, null, cpus, minSpeed, maxSpeed, 
minRam, maxRam, null, null, false, limitCpuUse, null);
.....

We need to pass these configuration parameters ("vmware.reserve.cpu", 
"vmware.reserve.mem") to VMwareResource.java using VirtualMachineTO.


  was:
setup
-------
Vcenter 5.5 (esxi-5.5) setup 

steps to reproduce
------------------------
1-enable zone level setting enable.dynamic.scale.vm
2-deploy a vm which is dynamically scalable
3- try to scale up vm to medium SO (#cpu=1,cpu=1000,mem=1024)

expected
-----------
scaling up should be sucessful

actual
-------
scaling up is failing with error
com.cloud.utils.exception.CloudRuntimeException: Unable to scale vm due to 
Unable to execute ScaleVmCommand due to java.lang.NullPointerException


> VM scale up is failing in vmware with Unable to execute ScaleVmCommand due to 
> java.lang.NullPointerException
> ------------------------------------------------------------------------------------------------------------
>
>                 Key: CLOUDSTACK-8088
>                 URL: https://issues.apache.org/jira/browse/CLOUDSTACK-8088
>             Project: CloudStack
>          Issue Type: Bug
>      Security Level: Public(Anyone can view this level - this is the 
> default.) 
>    Affects Versions: 4.5.0
>            Reporter: Saksham Srivastava
>            Assignee: Saksham Srivastava
>
> setup
> -------
> Vcenter 5.5 (esxi-5.5) setup 
> steps to reproduce
> ------------------------
> 1-enable zone level setting enable.dynamic.scale.vm
> 2-deploy a vm which is dynamically scalable
> 3- try to scale up vm to medium SO (#cpu=1,cpu=1000,mem=1024)
> expected
> -----------
> scaling up should be sucessful
> actual
> -------
> scaling up is failing with error
> com.cloud.utils.exception.CloudRuntimeException: Unable to scale vm due to 
> Unable to execute ScaleVmCommand due to java.lang.NullPointerException
> During scale vm command, in VmwareResource.java the following line is 
> executed where there is no value sent in the 'details' map for the 
> configuration parameter 'vmware.reserve.mem'. because of this NPE is occured.
> int getReservedMemoryMb(VirtualMachineTO vmSpec) {
> if 
> (vmSpec.getDetails().get(VMwareGuru.VmwareReserveMemory.key()).equalsIgnoreCase("true"))
>  { ...
> In VirtualMachineManagerImpl.java ScaleVmCommand is prepared where 
> VirtualMachineTO transfer object is created as following where we are not 
> setting 'details' map.
> public ScaleVmCommand(String vmName, int cpus, Integer minSpeed, Integer 
> maxSpeed, long minRam, long maxRam, boolean limitCpuUse) {
> .....
> this.vm = new VirtualMachineTO(1L, vmName, null, cpus, minSpeed, maxSpeed, 
> minRam, maxRam, null, null, false, limitCpuUse, null);
> .....
> We need to pass these configuration parameters ("vmware.reserve.cpu", 
> "vmware.reserve.mem") to VMwareResource.java using VirtualMachineTO.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to