Virtual Drives

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.

Currently antlet backups only backup virtual drives created on the same zpool as the antlet. Virtual drives only work with KVM antlets.

Add Virtual HDD

Create a new virtual disk in Antman

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

Format and mount the new disk

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 cron
apt-get install nano

CentOS:

yum install cronie
yum install e2fsprogs
yum 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 automatically 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

- 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.

Resize a Drive

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.

Last updated