| Previous | Next |
| VDS_E_VDISK_NOT_OPEN | VDS_E_INVALID_PATH |
VDS_E_VDISK_INVALID_OP_STATE
VDS models virtual disks with explicit states such as ADDED, OPEN, ATTACH_PENDING, ATTACHED, DETACH_PENDING, COMPACTING, MERGING, and EXPANDING. This HRESULT is the generic state-machine rejection for an operation attempted from the wrong state. It is more useful to inspect the state transition than to treat the failure as an arbitrary provider error.
Why this state matters
The allowed state depends on the requested method. Merge and expand operate on detached virtual disks; attach begins from an opened object; compact can operate on a detached disk or an attached disk that has been opened. The same object can therefore be valid for one method and invalid for another at the same moment.
Diagnostic focus
- Capture
VDS_VDISK_PROPERTIES.Stateand the exact VDS method that returned the HRESULT. - Map the current state to the documented transition sequence for attach, detach, compact, merge, or expand instead of issuing a generic retry.
- Wait for any outstanding asynchronous operation to reach its final result before reusing the object for another state-changing method.
- Reacquire properties after the transition because the state visible before a notification or asynchronous completion can already be stale.
Technical references
VDS_VDISK_STATE · MS-VDS virtual disk state transitions · VDS_VDISK_PROPERTIES · IVdsOpenVDisk · MS-VDS error codes
Looking for a different code? Search another status or error code.
