Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Calling scaleVirtualMachine fails due to incorrect power state examination. #3749

Closed
meysamfarazmand opened this issue Dec 7, 2019 · 3 comments

Comments

@meysamfarazmand
Copy link

ISSUE TYPE
  • Bug Report
COMPONENT NAME
CloudStack Manager
CLOUDSTACK VERSION
4.13.0
CONFIGURATION
OS / ENVIRONMENT

vCenter 5.5
CloudStack 4.13 on CentOS 6

SUMMARY

Calling scaleVirtualMachine fails due to incorrect power state examination.

STEPS TO REPRODUCE

1- Shutdown VM.
2- Wait until shutdown has been completed.
3- Immediately downgrade VM with scaleVirtualMachine API call.
4- Start VM

apiKey=vNacmEAZP1kZluwMvwur2UtXWDDaTmj_qw6r7ZPYCzo85RQcsgIZkCvAnZAeCLN3hfJCnKcGutECQREJyu7pig&command=scaleVirtualMachine&details[0].cpuNumber=2&details[0].cpuSpeed=1000&details[0].memory=2048&id=aa8c9928-4269-49fc-9d43-01f84e66e920&response=json&serviceofferingid=188a8d30-ac07-4093-9435-d2eaa4d20776&signature=vaP7uhJ8jsU45eGd61P3eGENqII%3D
EXPECTED RESULTS
scale virtual machine without failing related job.
ACTUAL RESULTS

Job fails due to incorrect power state

2019-12-07 10:18:47,324 ERROR [c.c.s.VolumeApiServiceImpl] (API-Job-Executor-25:ctx-40931858 job-91715 ctx-f6746e26) (logid:cfce0759)  For ROOT volume resize VM should be in Power Off state.
@meysamfarazmand
Copy link
Author

meysamfarazmand commented Dec 7, 2019

In cloudstack 4.9.3 there is no issue with scaleVirtualMachine.
also an alternate way to scale down a VM is using changeServiceForVirtualMachine api call and it will end up without job failing because it checks VM state by calling getState() function instead of getPowerState().
in addition this bug has been appeared after this commit:
https://github.com/apache/cloudstack/blame/4.13.0.0/server/src/main/java/com/cloud/storage/VolumeApiServiceImpl.java#L1081

calling changeServiceForVirtualMachine works as it should be:
https://github.com/apache/cloudstack/blob/4.13.0.0/engine/orchestration/src/main/java/com/cloud/vm/VirtualMachineManagerImpl.java#L3337

@DaanHoogland
Copy link
Contributor

@meysamfarazmand I think this was fixed in 4.14 can you check?

@DaanHoogland
Copy link
Contributor

closing this, please reopen if the issue re-occurs @meysamfarazmand

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants