This issue occurs during VM creation
Symptoms (one or more may be present):
VC 8.0.3 P08 or earlier
This issue is caused by a race condition in the volume attachment workflow. When a volume attachment operation is initiated during VM creation, there is a window of time before the Node VM Attachment CR status is updated to reflect the in-progress operation. If the volume is removed from the VM specification during this window (either through user
1. The volume attachment completes on vCenter despite the volume being removed from the spec
2. The Node VM Attachment CR is not cleaned up
Immediate Workaround: User needs to use the following manual steps to recover from this state:
1. Identify the affected volume and VM:
Check the VM specification to confirm which volume was removed
Verify the volume is still attached in vCenter by examining the VM's storage configuration
Identify the stale Node VM Attachment CR using: kubectl get cnsnodevmattachment -A
2. Manually detach the volume from the VM:
In vCenter, navigate to the affected VM
Edit VM settings and remove the attached volume
Confirm the detachment operation completes successfully
3. Clean up the stale Node VM Attachment CR:
kubectl delete
If the CR is stuck in terminating state, remove the finalizer:
kubectl patch
4. Verify cleanup:
Confirm the volume is no longer attached to any VM in vCenter
Confirm the Node VM Attachment CR is deleted
Retry the VM creation or volume attachment operation