delete-disk

Posted 2012-03-29 01:48 by Joe

delete-disk.pl

delete-disk.pl

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.

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

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