XenServer: VDI is in use

From myWiki

XenServer: VDI is in use (but not really).

Find the VDI UUID for the disk:

xe vdi-list

Find the VBD UUID for it (first entry):

xe vbd-list vdi-uuid={VDI UUID}

Unplug the appropriate VBD:

xe vbd-unplug uuid={VBD UUID}

Destroy the VBD:

xe vbd-destroy uuid={VBD UUID}