You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Unable to start instances with DATA volumes of deploy-as-is template having instance snapshots #9180
Instance deployed from deplo-as-is template. VMware vSphere 8.0
SUMMARY
While starting an instance created from deploy-as-is template cloudstack tries to tear down the data disks. Since the instance has data volumes attached before the instance snapshot vCenter declines the teardown. This design issue results in failure to start an instance having data volumes and instance snapshots.
2024-06-05 12:16:40,023 INFO [c.c.h.v.r.VmwareResource] (DirectAgent-101:ctx-79cfdac2 10.1.32.212, job-38/job-40, cmd: StartCommand) (logid:8e044e50) Tearing down datadisks for deploy-as-is VM
2024-06-05 12:16:40,121 ERROR [c.c.h.v.r.VmwareResource] (DirectAgent-101:ctx-79cfdac2 10.1.32.212, job-38/job-40, cmd: StartCommand) (logid:8e044e50) Error mapping deploy-as-is VM disks from cloned VM i-2-3-VM
java.lang.RuntimeException: Invalid configuration for device '0'.
at com.cloud.hypervisor.vmware.util.VmwareClient.waitForTask(VmwareClient.java:426)
STEPS TO REPRODUCE
1. Deploy an instance from a deploy-as-is template with a data volume( Read Instance settings from OVA selected for template).
2. Create an instance snapshot
3. Stop and then start the instance.
EXPECTED RESULTS
The user should be able to perform stop-and-start operations on instances deployed from deploy-as-is template types having data disks and instance snapshots.
ACTUAL RESULTS
The user is unable to stop and start the instance.
I am able to reproduce the issue by the following steps
register a deploy-as-is template
create a vm
create a datadisk and attach to the vm
create vm snapshot
stop the vm
start the vm, and got the same error
note
on vcenter, it shows " Invalid configuration for device '0'. Cannot remove virtual disk from the virtual machine because it or one of its parent disks is part of a snapshot of the virtual machine."
vm can be started successfully in vcenter
vm can be started successfully in cloudstack, after removing the vm snapshot.
Hi @weizhouapache as I do recall there was a similar logic for non-deploy as is VMs but reviewing the code I see those are checking for snapshots. I will review your linked PR
Activity
weizhouapache commentedon Jun 12, 2024
I am able to reproduce the issue by the following steps
note
it looks the issue is caused by
cloudstack/plugins/hypervisors/vmware/src/main/java/com/cloud/hypervisor/vmware/resource/VmwareResource.java
Lines 2835 to 2838 in 66f7f76
which is called by
cloudstack/plugins/hypervisors/vmware/src/main/java/com/cloud/hypervisor/vmware/resource/VmwareResource.java
Lines 2204 to 2207 in 66f7f76
the code was introduced in #4307 , do you remember why added it and have any idea how to improve it ? cc @nvazquez
nvazquez commentedon Jun 13, 2024
Hi @weizhouapache as I do recall there was a similar logic for non-deploy as is VMs but reviewing the code I see those are checking for snapshots. I will review your linked PR
DaanHoogland commentedon Jun 18, 2024
fixed in #9243