2.13.5. Adding Multiple Virtual Disks to Containers

Even though new containers are created with just one virtual hard disk, you can add more disks to a container and keep the corresponding ploop images at locations of your choice, be it directly attached HDDs or SSDs. Such functionality allows creating more flexible containers, in which, for example, the operating system is kept on a fast SSD and user content is stored on a capacious HDD.

To add a virtual hard disk to a container, whether stopped or running, use the prlctl set --device-add hdd command. For example:

# prlctl set MyCT --device-add hdd --image /hdd/MyCT --size 100G --mnt /userdisk

This command adds to the configuration of the container MyCT a virtual hard disk with the following parameters:

  • name: hdd<N> where <N> is the next available disk index,
  • image location: /hdd/MyCT,
  • size: 102400 MB,
  • mount point inside the container MyCT: /userdisk. A corresponding entry is also added to container’s /etc/fstab file.