create-disk

Adds a virtual disk to some system

This command adds a new virtual disk to a system managed by Cloudmin, typically a Xen instance. Normally, a virtual disk is a file on the host system that is mapped to a device on the instance, like /dev/sda3. However, it can also be a real disk device on the host system (such as a partiton, or a logical volume).

The system to add the disk to is specified with the --host parameter. The disk file on the host can either be set with --real followed by a filename like /xen/newdisk.img, or you can have Cloudmin choose a filename automatically with the --auto-real flag.

If your host system supports LVM and has it configured in Cloudmin, you can instead use the --lv flag followed by the name of a new logical volume to create.

The device file on the virtual system can either be set with --virt followed by a device name, or you can use --auto-virt to have Cloudmin choose an un-used device.

When adding a new file as a disk, the --size parameter must be given and followed by a disk size in megabytes. If you want it formatted with a filesystem, use the --format flag followed by a type like ext3. To have it mounted on the virtual system, use --mount flag followed by a mount point like /mnt/disk2.

For some virtualization types, you can specify if the disk is a hard disk or CD-ROM with the --media flag. This allows you to attach an existing ISO image as a CD, which will appear as a actual CD-ROM drive within the virtual system. On KVM the supported media types are disk and cdrom.

Some virtualization types allow you to specify the caching type for the disk image with the --cache flag, followed by a mode like on or off or writeback. This can be used to trade of disk performance for host memory usage.

By default disk creation will fail if the specified file or logical volume already exists on the host system. You can instead force deletion of any existing file with the --overwrite flag.

If possible, Cloudmin will add the new disk to a running system and mount it on the specific directory. However, in some cases this may not be possible without rebooting the system - to have this done automatically, use the --reboot flag.

Example usage

  cloudmin create-disk --host xencentos.home --auto-virt --auto-real --size 500
  Creating virtual disk for /dev/sda3 ..
  .. done. However, the disk will not be visible until the system is rebooted

Command Line Help

Adds a disk device to some virtual system.

cloudmin create-disk --host hostname
                     --real device|file | --auto-real | --lv name
                     --virt device | --auto-virt
                    [--size MB]
                    [--device]
                    [--format filesystem]
                    [--mount directory|"swap"]
                    [--media type]
                    [--cache mode]
                    [--storage id|"name"]
                    [--overwrite]
                    [--reboot]