cloudstack
cloudstack copied to clipboard
VMware VM snapshot failure in case of storage pool type datastore cluster
ISSUE TYPE
- Bug Report
COMPONENT NAME
VMware, VMsnapshot, Datastore Cluster
CLOUDSTACK VERSION
4.15.0 and above
SUMMARY
VM snapshot is failing on some VMs for which disks are created in a storage pool of type “Datastore Cluster“ in VMware. The issue is happening in a specific case as mentioned below in the reproduction steps.
STEPS TO REPRODUCE
1. Create a CloudStack environment with a storage pool of type “Datastore Cluster“ (Assume Datastore cluster has two child pools in it “pool A“ and “pool B“) and make sure DRS is enabled on the datastore cluster on vCenter.
2. Create a VM with a root disk and a data disk.
3. Create a scenario where both root and data disks are created in the same child storage pool in datastore cluster, say “pool A“
4. Let the DRS trigger on vCenter and moved the data disk from “pool A“ to “pool B“
5. Now perform VM snapshot operation from CloudStack which will fail with the below error.
```
2022-08-01 06:14:46,623 DEBUG [c.c.v.s.VMSnapshotManagerImpl] (Work-Job-Executor-6:ctx-844c99dc job-73/job-74 ctx-5482d2e8) (logid:df1e2c15) Failed to create vm snapshot: 6
com.cloud.utils.exception.CloudRuntimeException: Creating VM snapshot: i-2-5-VM_VS_20220801061435 failed due to File [783bcfa34486393f8b597e3af109a56b] i-2-5-VM was not found
```
Summary: The issue is happening when the CloudStack’s database has the details for two volumes pool_id and chain_info pointing to the same child storage pool but on vCenter, they are in different child storage pools. In other cases, even though DRS moved the volumes around, CloudStack can still take VM snapshot.
Workaround: Stop and start the VM. CloudStack will reconcile the volumes information during that process.
EXPECTED RESULTS
VM snapshot should be successful and CloudStack should update the new volumes information
ACTUAL RESULTS
VM snapshot operation is failing in the specific case as mentioned above in reproduction steps