cloudstack
cloudstack copied to clipboard
Unable to live migrate VMware VMs with snapshot
ISSUE TYPE
- Bug Report
COMPONENT NAME
Core
CLOUDSTACK VERSION
4.19.0.1
CONFIGURATION
OS / ENVIRONMENT
vSphere 7.0
SUMMARY
If I try to live migrate a VM with storage and the VM has a snapshot, the live migration does not start with the following error:
DEBUG [o.a.c.f.j.i.AsyncJobManagerImpl] (API-Job-Executor-47:ctx-e8daf7c5 job-50058) (logid:28b2b6fb) Complete async job-5 0058, jobStatus: FAILED, resultCode: 431, result: org.apache.cloudstack.api.response.ExceptionResponse/null/{"uuidList":[],"errorcode":"431","erro rtext":"VM with VM Snapshots cannot be migrated with storage, please remove all VM snapshots"}
STEPS TO REPRODUCE
In a VMware cluster, try to live migrate with storage a VM with at lease an active snapshot
EXPECTED RESULTS
The VM is correctly migrated
Live storage migration with VM with snapshot is supported in vSphere from version 5.0 so I guess it should be possible to perform the operation --> https://knowledge.broadcom.com/external/article?legacyId=1035550
ACTUAL RESULTS
You receive an error before the migration start.
This is not a bug @cdfgallo, but a design limitation. The same way, you can not attach/detach volumes/NICs etc (please read the docs about different limitations on the allowed operations on VMs that have VM snapshots)
@andrijapanicsb ok, got it. But why this implementation if I may ask? In case what work-around do you use to migrate VMs without touching the snapshot?
@cdfgallo I can't advise from the top of my head, probably a technical limitation, due to consistency issues etc. However, the way around is to remove all VM snapshots, do your actions, and then create VM snapshots again. (is this KVM or VMware?)
I tried this out, seems like merely removing the check at https://github.com/apache/cloudstack/blob/19f96355ac0b8bb1051c4e8fa2672b6e2f090703/server/src/main/java/com/cloud/vm/UserVmManagerImpl.java#L7211-L7213 most likely solves the issue. From Vmware end, it is possible to live migrate a VM with storage even if it has a VM snapshot.
sounds good @Pearl1594 , any idea about the other hypervisors?
I haven't tested on other hypervisors - I'll do that and keep you'll posted.
I haven't tested on other hypervisors - I'll do that and keep you'll posted.
great, thanks @Pearl1594
so sh-/could we move this into milestone 4.20?
@Pearl1594 would it be worth checking if snapshot actions from CloudStack work if the VM is migrated (after removing the check you shared)?
@Pearl1594 thanks for checking this. @shwstppr I think it should work fine. I've deployed an env, took a snapshot of a VM, then migrated it with storage directly in vCenter, and ACS could still manage fine the snapshots.
@DaanHoogland I'd say yes, 4.20.
@shwstppr I had tested that - yes reverting to another snapshot worked I believe
@shwstppr I had tested that - yes reverting to another snapshot worked I believe
so we can remove the restriction for vmware ?
@shwstppr I'd say yes, according to mine and @Pearl1594 's tests.
cc @cdfgallo