KVM on OVH/SYS using recommended configuration with Virtualizor & SolusVM

Shoaib_A

Member
Thank you for the appreciation on my previous tutorials. The network settings which I had used in my previous tutorial bypass what is recommended by OVH but they work perfectly. But some people requested for writing a tutorial with OVH's recommended network configuration so here it is :)

 

Note: Special thanks to @MCH-Phil who has always been very encouraging & helpful to me in hosting related matters.

 

Following assumptions have been made to make it easy for you to understand:

 


1.1.1.1 = Primary IPv4 of your server

2.2.2.1/27 = /27(32 addresses but it does not matter what subnet you have e.g /26, /25, /24 etc)IPv4 subnet assigned to your server

CentOS = Operating System

Virtualizor or SolusVM = VPS control Panel
 

-----------------------------

When you receive your dedicated server, please install the OS(in this case CentOS) with native kernel of that OS. Never use OVH kernels as they do not support hypervisors well.

-----------------------------

 

First of all, please check for updates & install them

 


Code:
# yum update
 

After the update is complete, please reboot your system:

 


Code:
# reboot
 

General rule for network configuration within VMs:

 

If the main IPv4 address of your dedicated server is 1.1.1.1 then inside VMs:

 


Code:
# nano /etc/sysconfig/network-scripts/ifcfg-eth0
 


DEVICE=eth0

BOOTPROTO=static

ONBOOT=yes

IPADDR=2.2.2.1

NETMASK=255.255.255.255

GATEWAY=1.1.1.254

HWADDR="00:19:BB:24:9F:89"
 



 

CTRL + X to save

 

GATEWAY = Main IP of your dedicated server but last octet will be replaced by 254

NETMASK = This will always be 255.255.255.255 regardless of whatever subnet you have. This is because at OVH's network treats every IP as a single one even if it is part of /24 or whatever subnet.

HWADDR = This will be the virtual MAC of your VM's IP which you will generate through OVH manager.

IPADDR = You may use any IP from the subnet which you got allocated to your server for the purpose of creating VMs.

 

-------------------------

Virtualizor

-------------------------

Installing & configuring KVM with Virtualizor is very simple. It is my personal favorite to use with OVH servers as it provides it supports the out of way routed network configuration on OVH really well. Virtualizor have really improved in last year or so & number of VPS providers using it is increasing day by day.

 

Following partition scheme is recommended for your dedicated server:

 


 

/ = 100 GB

SWAP = 8 GB

LVG = Rest of space

 

If you did not create the volume group during Cent0S installtion from CD/ISO(or used a template with no options to install a volume group), you can do so by issuing 2 simple commands:

 


Code:
# pvcreate /dev/sdb3
# vgcreate vg /dev/sdb3
 

sdb3 represents the partition of the hard drive where you want to create the volume group & vg is the name of volume group

 

First of all, make sure that your eth0 interface file has following things present(usually it is not required to make any changes to it as everything required is already present in eth0 file after the OS is installed):

 


Code:
# nano /etc/sysconfig/network-scripts/ifcfg-eth0
 


 

DEVICE="eth0"

BOOTPROTO="dhcp"

HWADDR="00:25:90:H3:7F:48"

IPADDR="1.1.1.1"

NETMASK="255.255.255.0"

GATEWAY="1.1.1.254"

IPV6INIT="yes"

ONBOOT="yes"

TYPE="Ethernet"

 

CTRL + X to save

 

Note:Replace the values in HWADDR with MAC address of the network interface you are using.

 

Open a Shell Terminal (e.g. PuTTY) and SSH to your server. Run the following commands:

 


Code:
# wget -N http://files.virtualizor.com/install.sh
# chmod 0755 install.sh
# ./install.sh [email protected] kernel=kvm lvg=VOLUME_GROUP_NAME
 

email = The Admin Email Address

kernel = In this case its kvm

lvg = The Volume Group that will be used for the VPS storage e.g. defaults to vg. It should have some OR ALL unallocated space to create LVMs for the VPS.

 

That is it. Now virtualizor script will install everything needed including the bridge automatically

 

After installation is complete, reboot the server & once it is back up again login to Virtualizor admin panel at https://IPofyourserver:4085

 

In case you are using a network interface other than eth0 e.g. eth1 or eth2 etc then you need to change the change the settings from

 

Virtualizor Admin Panel -> Configuration -> General Settings  -> Network Interface

 

After doing that, issue the following command(required only if you changed the network interface to something other than eth0

 


Code:
# service virtnetwork restart
 

Then create an IP Pool with following parameters:

 

Name = Anything you wish

Gateway = 1.1.1.254

Netmask = 255.255.255.255

Nameserver 1 = 213.186.33.99

Nameserver 2 = 8.8.8.8

 

Note: Don't forget to check the routed network option. Add IPs one by one after generating their macs from OVH manager. If you wish to to use more than one IP in a VPS, set mac address of all secondary IPs same as the original IP of that particular VM. Configure other settings, download templates/ISOs through the template browser & then you can proceed with installing VMs.

 

--------------------------------------------------------------

SolusVM

--------------------------------------------------------------

 

With SolusVM, partition scheme should be same as what I described for Virtualizor & you need to configure your eth0 interface in the following way

 


Code:
# nano /etc/sysconfig/network-scripts/ifcfg-eth0
 


DEVICE="eth0"

ONBOOT="yes"

BRIDGE="br0"

 

And bridge should be configured as:

 

# nano /etc/sysconfig/network-scripts/ifcfg-br0

 


DEVICE="br0"

TYPE="Bridge"

BOOTPROTO="static"

IPADDR="1.1.1.1"

NETMASK="255.255.255.0"

ONBOOT="yes"

GATEWAY="1.1.1.254"

DELAY="0"

IPV6INIT="yes"
 



 

Restart the network network:

 


Code:
# /etc/init.d/network restart
 

Install SolusVM master with no virtualization option using the following guide:

http://docs.solusvm.com/v2/Default.htm#Installation/Installing-Master.htm%3FTocPath%3DInstallation%7C_____4

 

Install SolusVM slave with no virtualization option using the following guide:

http://docs.solusvm.com/v2/Default.htm#Installation/Installing-Slave.htm%3FTocPath%3DInstallation%7C_____5

 

Reboot your system after installation

 

Now login to your SolusVM admin panel

IP blocks -----> List IP blocks -----> Add IPv4 block

 


Block Name: Whatever you wish

Gateway: 1.1.1.254

Netmask: 255.255.255.255

Nameserver: 213.186.33.99

 

For all your OS templates, choose NOT to configure networking automatically. This way, all your VMs will use DHCP & that is the only possible way to make OVH's recommended network settings work with SolusVM. Add IPs one by one after generating their macs from OVH manager.If you wish to to use more than one IP in a VPS, set mac address of all secondary IPs same as the original IP of that particular VM.

 

Note: If you wish to use IPv6 also with SolusVM, I have described it in detail in 

 

That is it. I have tried to cover everything in this short tutorial yet if someone is not able to understand something, he can contact me.
 
Last edited by a moderator:

libro22

Member
Well this answers my concern on whether to use LV or disk image on KVM guests, nice tutorial by the way :)

Is it possible to install virtualizor on nodes with existing guests already or is it advisable to begin from scratch?
 

Shoaib_A

Member
Well this answers my concern on whether to use LV or disk image on KVM guests, nice tutorial by the way :)

Is it possible to install virtualizor on nodes with existing guests already or is it advisable to begin from scratch?
Both Virtualizor & SolusVM create LV's themselves at time of VPS creation, you just need to create LVG/. I had started with scratch but if you contact Virtualizor support, they might have some script for you in order to migrate from another control panel( or even if you created it manually with virsh ).
 
Last edited by a moderator:

eva2000

Active Member
@ curious any differences to above steps for just OVH/SYS + Virtualizor without SolusVM ? Also for root / partition sizing, how much space does a default install of CentOS/Virtualizor actually use and how much disk space free based on 100GB / ? I ask I going to try with with my SoYouStart server and only have 3x120GB SSDs, so of course root / partition size needs adjusting for my disk capacity available. Just a test server to play with Virtualizor + KVM

Only plan for using CentOS 6.6, CentOS 7.0 and Debian latest ISOs

cheers
 
Last edited by a moderator:

jameshsi

New Member
Hi!

Nice article, I follow all instructions here, and still when I create a new vm in solusvm, I need to follow the OVH documentation says, to add a route-eth0 in the Linux VM, I don't quite sure what else should I do before it will be automatically connect to Internet after vm created.
 

Shoaib_A

Member
@ curious any differences to above steps for just OVH/SYS + Virtualizor without SolusVM ? Also for root / partition sizing, how much space does a default install of CentOS/Virtualizor actually use and how much disk space free based on 100GB / ? I ask I going to try with with my SoYouStart server and only have 3x120GB SSDs, so of course root / partition size needs adjusting for my disk capacity available. Just a test server to play with Virtualizor + KVM

Only plan for using CentOS 6.6, CentOS 7.0 and Debian latest ISOs

cheers
Partition / saves your ISOs & templates, Virtualizor templates are much bigger in size than SolusVM(1+ GB compared to 200-400 Mb to SolusVM 2nd generation templates). 100 GB is recommended but if you feel you can save all your templates/ISOs in 40 or 50 GB then it should be fine. I have / partition's size set to 50 GB in one of my servers which I use for testing. Since you want to use a handful of templates only, even less than 50 GB would do :)
 

Shoaib_A

Member
Hi!

Nice article, I follow all instructions here, and still when I create a new vm in solusvm, I need to follow the OVH documentation says, to add a route-eth0 in the Linux VM, I don't quite sure what else should I do before it will be automatically connect to Internet after vm created.
Make sure dhcp server is running on your server & you do not check "configure networking" with your templates. If you still face problems after doing that, you can contact me on skype(can be found in profile on the forum) & I will help you to the best of my abilities.
 

centoslgd

New Member
Thanks for your valuable help with correct network configuration with vps on my ovh dedicated server. I request admins to include it in library to save others from the headache which I had to go through in order to find a nice tutorial for ovh network configuration. I contacted ovh support multiple times in last 3 days but all they did was redirecting me to their guides which didn't help much. I found this tutorial which helped but I had a couple of questions which the OP answered over skype & now vps on my ovh server are working perfectly :)
 
Top