3.2.11.4. Hard Disk Drive Management Options

This group of options is used to manage virtual hard disks in a container.

Syntax. 

prlctl set <CT_name> --device-add hdd [--image <file>] [--size <size>]
           [--mnt <path>] [--iface <ide|scsi|virtio>] [--position <pos>]
prlctl set <CT_name> --device-set hdd<N> [--image <file>] [--size +<size>]
           [--mnt <path>] [--iface <ide|scsi|virtio>] [--position <pos>]
           [--autocompact <on|off>]
prlctl set <CT_name> --backup-add <backup_ID> [--disk <disk_name>]
prlctl set <CT_name> --device-del hdd<N> [--detach-only|--destroy-image]
prlctl set <CT_name> --backup-del {<backup_ID>|all}

Table 3.17. Options

NameDescription

<CT_name>

Container name.

--device-add hdd

Adds a virtual hard disk to the container. If no other options are specified, the command creates a new unmounted disk with the following parameters:

  • name: hdd<N> where <N> is the next available disk index.
  • size: 65536 MB
  • image location: /vz/private/<CT_UUID>/disk-<ID>.hdd.

--device-set hdd<N>

Modifies the parameters of the virtual hard disk hdd<N>.

Note

Note: For the list of disks, use the prlctl list -i command.

--image <file>

Specifies an image file that will be used to emulate the virtual disk.

  • If the specified image does not exist, it is created and used to emulate the virtual hard disk.
  • If the specified image exists, it is used to emulate the virtual hard disk.

--size <size>

Specifies the size of the virtual hard disk, in megabytes.

--mnt <path>

Specifies the mount point of the virtual hard disk inside the container. A corresponding entry is also added to container’s /etc/fstab file, so the disk is mounted automatically on container start.

--autocompact <on|off>

Enables or disables compaction for the specified disk in the container.

Note

Note: For details on how to enable or disable compaction for all disks in the container, see Section 3.2.11.1, “General Options”.

--backup-add <backup_ID>

Attach the backup with the identifier <backup_ID> to the virtual machine as a virtual hard disk. To obtain the backup ID, use the prlctl backup-list -f command.

--disk <disk_name>

Used with --backup-add. The name of the disk in the backup to attach. If a disk is not specified, all disks contained in the backup will be attached. To obtain the disk name, use the prlctl backup-list -f command.

--device-del hdd<N>

Deletes a virtual hard disk from the stopped container.

--detach-only

Removes the virtual disk from the container configuration but leaves its image file intact.

--destroy-image

Removes the virtual disk from the container configuration and deletes its image file.

--backup-del {<backup_ID>|all}

Detach either the backup with the identifier <backup_ID> or detach all backups from the virtual machine.