What does HRESULT 0x80042936 (VDS_E_VD_NOT_ATTACHED_READONLY) mean?

 
Previous Next
VDS_E_VD_ALREADY_DETACHED VDS_E_VD_IS_BEING_ATTACHED

VDS_E_VD_NOT_ATTACHED_READONLY

This status expresses an attachment-mode precondition rather than a generic read-only file error. VDS attach accepts ATTACH_VIRTUAL_DISK_FLAG_READ_ONLY, and some virtual-disk maintenance operations require the disk to be detached or attached read-only. DiskPart documents the same constraint for compacting dynamically expanding VHDs.

Why this state matters

A disk that is attached read/write does not satisfy the condition just because no application is currently writing to it. The access mode is part of the attachment established through the virtual-disk API. Diagnostics should inspect how the disk was attached and coordinate a controlled detach/reattach if a maintenance operation truly requires read-only exposure.

Diagnostic focus

  • Identify the operation that returned the HRESULT and verify its documented attachment-mode requirement.
  • Check the flags used when the current attachment was created instead of inferring mode from observed I/O activity.
  • Coordinate users of the disk before changing attachment mode; read-only reattachment is a topology and access change.
  • After detaching, reopen and attach with the documented read-only flag, then retry only the operation that requires that mode.

Technical references

IVdsOpenVDisk::Attach · IVdsOpenVDisk::Compact · compact vdisk command · VDS_VDISK_STATE · IVdsOpenVDisk


Looking for a different code? Search another status or error code.