delete-disk

Remove a virtual disk from some system

This command dis-associates a real file or device with a virtual device on some system, and deletes the underlying file. The system to modify is identified with the --host flag, and the disk to remove can be set with either --real followed by the real file (like /xen/newdisk.img),
--virt followed by the device on the virtual system (like /dev/sda3), or --lv followed by the logical volume name.

If the system is running, the disk may not be really deleted until it is shutdown or restarted, and thus the disk space on the host system will not be immediately freed up.

To simply detach a disk from a virtual system without deleting the underlying image file or logical volume, use the --detach flag. The file or LV can be later attached to another system with the create-disk API command.

When detaching, you can also use the --iscsi-disconnect flag to first disconnect the iSCSI connection from the host system to the iSCSI server.
The disk can then be attached to another system on the same or different host with the attach-disk API command.

Example usage

  cloudmin delete-disk --host xencentos.home --virt /dev/sda3
  Removing virtual disk for /dev/sda3 ..
  .. done. However, the disk will not be fully removed until the system is rebooted

Command Line Help

Removes a disk device from some virtual system.

cloudmin delete-disk --host hostname
                     --real device|file | --virt device | --lv name
                    [--detach]
                    [--iscsi-disconnect]