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 the zpool it is created in.
You can create and manage your own virtual drives in order to give your antlet more space. You can create virtual drives on any of your zpools.
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
yum install cronieyum install e2fsprogsyum install nano
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.
Create a directory to mount the vDrive to. This can be anywhere in your directory tree.
Mount the vDrive
mount -t ext4 /dev/vdb /mnt/disk2
Mount the vDrive automatically on reboot
If you are not familiar with the vim editor, use nano (you may need to install it).
fstab file contains a list of drives and their mount information.
Add the following line
/dev/vdb /mnt/disk2 ext4 defaults 1 2
- 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.
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.
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.