| Previous | Next |
| VDS_E_VD_ALREADY_ATTACHED | VDS_E_VD_NOT_ATTACHED_READONLY |
VDS_E_VD_ALREADY_DETACHED
This HRESULT is the duplicate-detach result. A detached virtual disk remains a backing file and can still be known to VDS, but it is no longer surfaced as an operating-system disk device. Calling detach again does not remove the file or make the state “more detached.”
Why this state matters
The VDS detach transition completes when the corresponding operating-system disk object has been removed. After that, the virtual disk returns through OPEN and, once the opened interface is released, to ADDED. This is different from DetachAndDelete, which also deletes backing files. Diagnose whether the caller confused device detachment with file deletion.
Diagnostic focus
- Confirm there is no attached disk device associated with the virtual disk and inspect its current VDS state.
- Do not retry detach when the actual goal is to delete the VHD/VHDX backing file; use the correct lifecycle and deletion operation.
- Check whether a previous detach completed asynchronously from the caller perspective before a second request was issued.
- Treat the result as state information when detach was intended to be idempotent, but preserve the HRESULT for workflow diagnostics.
Technical references
IVdsOpenVDisk::Detach · detach vdisk command · MS-VDS virtual disk state transitions · IVdsOpenVDisk · VDS_VDISK_PROPERTIES
Looking for a different code? Search another status or error code.
