Our basic KVM templates come with just one virtual drive that contains the OS. That drive is limited in size. LXC antlets, on the other hand, can by default access all space available on your your main SSDs.
You can create and manage your own virtual drives in order to give your antlet more space. You can create virtual drives on the main SSDs or choose to create it on the HDD add-on or SSD add-on. Each drive will always and automatically be mirrored over two physical drives so that your data stays safe all the time.
Also, we will automtically compress all your drives, even if you choose a disk format that offers no inherent "copy-on-write". That way, you will only use up physical space on your disks if and when needed.
Enter the antlet details page by clicking the name of the antlet
Select the 'Virtual Drives' tab
Click 'Create New Disk' button and fill in the form
​
After the virtual drive is created, note the 'Target' name, 'vdb' in this case. This is the device name in Linux antlets.
Stop and Start the antlet
After creatng a new virtual disk, you will need to format the disk in the operating system of the antlet.
- Linux antlets
Depending on the template you may need to install some packages Debian/Ubuntu:
apt-get install cronapt-get install nano
CentOS:
yum install cronieyum install e2fsprogsyum install nano
Use the target
name of the disk as seen in the 'Virtual Drives' tab, e.g. 'vdb', to create the file system.
A KVM antlet will have one virtual disk (vda) by default. An LXC antlet has no virtual disks by default.
NOTE: The first disk in a KVM antlet is 'vda' and contains the operating system. Do not format this disk! It will erase the operating system.I will use 'vdb' for the following examples. Replace with your target name.
mkfs.ext4 /dev/vdb
Create a directory to mount the vDrive to. This can be anywhere in your directory tree.
mkdir /mnt/disk2
Mount the vDrive
mount -t ext4 /dev/vdb /mnt/disk2
Mount the vDrive automaticlally on reboot
If you are not familiar with the vim editor, use nano (you may need to install it).
The fstab
file contains a list of drives and their mount information.
nano /etc/fstab
Add the following line
/dev/vdb /mnt/disk2 ext4 defaults 1 2
NOTE: Known Issue: you cannot mount a vDisk in an LXC antlet via fstab
Debian/Ubuntu LXC: Use cron to mount on reboot
EDITOR=nano crontab -e
Add the following line
@reboot /bin/mount /dev/vdb /mnt/disk2
CentOS LXC: Use rc.local to mount on reboot
nano /etc/rc.d/rc.local
Add the following line
/bin/mount -t ext4 /dev/vdb /mnt/disk2
Make sure rc.local is executable
chmod a+x /etc/rc.d/rc.local
- Windows antlets
For Windows antles you can format your new disk in 'Disk Manager'. Right click in the unallocated space of the new disk and choose 'New Simple Volume...'
Follow the prompts of the 'New Simple Volume Wizard' When complete your new virtual drive is ready for use.
antMan 0.8.1a With antMan 0.8.1a we can resize virtual drives from within antMan.
In the 'Virtual Drives' tab, click the drive 'Size'
Enter the new size and click the green check button.
Now you can partition and format the additional drive space in the OS of the antlet.
Best practice is to shutdown the antlet before resizing the vDrive. Specifically in Windows antlets, resizing while the antlet is running and then performing a 'rescan' in Disk Manager can corrupt the vDrive.
Prior to antMan 0.8.1a
To resize a drive we need to find the path to the virtual drive file.
First ssh to the Antsle. Then lets list the files in the antlets dirctory. The .qcow2 file extention represents a virtual drive.
ls /ZPOOL_NAME/ANTLET_NAME
Replace ZPOOL_NAME with the name of the zpool you created the antlet on. The default zpool name is 'antlets' if you have the hdd addon the zpool could be 'hdd'
Then to increase its size run:
qemu-img resize /antlets/ANTLET_NAME/THE_FILE.qcow2 +100G
Adjust the last option to the size you want. This will add the specifed amount of drive space.