KVM Module

Server Operating System

Debian 8 64-bit must be installed on your server for everything to work correctly.

 

Server Partitioning

/boot    500 MB    ext4
/        5 GB      ext4
No swap.
Leave the rest of the disk empty.
It is important to leave the remainder of the disk empty so you can create an LVM partition later.

 

Server Installation

These commands will install the required packages on your server;

apt-get update && apt-get install curl

curl -o install_kvm.sh https://www.billic.com/files/install_kvm.sh && chmod +x install_kvm.sh && ./install_kvm.sh

 

LVM

If you partitioned your disk correctly you will be able to create a new partition while your server is running. 

This command will create a new partition: (replace /dev/sda with your hard drive)

parted /dev/sda mkpart primary ext2 2048s 100%

Make sure the partition is aligned. If it is not, you will need to research how to create an aligned partition.


 

parted /dev/sda align-check optimal 1

After you have created the partition you can setup LVM with these commands; (replace /dev/sda3 with your new partition you created)

DISK_NUM=1
DISK_PATH=/dev/sda3
pvcreate ${DISK_PATH}
vgcreate vg${DISK_NUM} ${DISK_PATH}
lvcreate -l 100%FREE --thinpool thin_vg${DISK_NUM} vg${DISK_NUM}

You can create an LVM partition on every disk inside your server. Just do the same commands but increment DISK_NUM and change DISK_PATH to the correct disk.

 

Networking

You need to configure a network bridge. To do so, edit the file /etc/network/interfaces and change every eth0 to br0

After the line iface br0 inet xxxx add the following lines; (replace AB:CD:EF:11:22:33 with your HW address which can be found using the ifconfig eth0 command)

bridge_ports eth0
bridge_hw AB:CD:EF:11:22:33
That's it! After you have done those two things, your interfaces file should look similar to this; (things in bold may be different)
iface br0 inet xxxx
        bridge_ports eth0
        bridge_hw AB:CD:EF:11:22:33
        ... Any other settings which were originally in the file should after these lines.

Restart your server and then reconnect when it has booted back up. You can confirm the bridge is setup correctly by using the command brctl show and it will show you that network card eth0 is under the bridge br0.

 

(Hint) Disabling swap post-install

If you want to remove the swap space from your server just do this command;

swapoff -a

Then remove the swap line in /etc/fstab

Reboot your server and then you can remove the swap partition if you like (not required).

 

Snapshot Storage

The KVM module will store snapshots in the folder at /mnt/snapshots

There are no limitations to what you can mount here, it could be a hard drive partition, FTP, NFS, SAN, etc... (we found using NFS would crash the server with large backups and recommend avoiding using NFS)

Here's how mount an FTP server to /mnt/snapshots - first, install curlftpfs using this command;

apt-get install curlftpfs

Then you need to write your credentials into /root/.netrc like the following; (replace IPADDRESS, USERNAME and PASSWORD with your real info for the FTP server)

machine IPADDRESS
login USERNAME
password PASSWORD

Then you can mount the snapshot folder using this command; (replace IPADDRESS with your real IP of the FTP server)

curlftpfs -o allow_other IPADDRESS /mnt/snapshots

You can verify the snapshot folder is mounted by seeing it in the list;

df -h

 




Next: Configuring Advanced Features » SolusVM
Previous: Configuring Advanced Features » Email Pipe