amuck-landowner

Installing & configuring KVM on OVH with SolusVM

Shoaib_A

Member
I have seen many hosts & other individuals who want to setup KVM with OVH servers having lot of difficulties because the gateways & routing of network interfaces is different in OVH's network. Some even totally give up the idea & quit thinking about setting KVM on OVH's network. That is why I have made this tutorial so that you can benefit from it & set up KVM on OVH servers with ease.

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

2001:41d0:a:abcd::/64 = IPv6 subnet assigned to your server

CentOS = Operating System

SolusVM = VPS control Panel
First of all, we should update our OS with following command using SSH:


# yum update
Once done, please restart your system.

After that make sure IPv6 is working properly on your server, an easier way to check is pinging any popular website with IPv6


# ping6 google.com
If there is a timeout then it is possible IPv6 is not setup on the server. So first we will setup IPv6 on the server


# nano /etc/sysconfig/network
Add the the following 2 lines:

NETWORKING_IPV6=yes
IPV6FORWARDING=yes
Once done, type Ctrl + X, select YES & Enter

Now we will add our IPv6 subnet to the server:


# /sbin/ifconfig eth0 inet6 add 2001:41d0:a:abcd::1/64
# route -A inet6 add default gw 2001:41d0:a:abff:ff:ff:ff:ff dev eth0
Note: 5x FF have to be placed at the end in all cases, for more details please consulthttp://help.ovh.com/Ipv4Ipv6

Now the IPv6 should be working & we can proceed firther with our installations

Install SolusVM(or any other control panel of your choice e.g Virtualizor, Feathur etc):

For SolusVM Master server, install with no virtualization option using the following guide:

http://docs.solusvm.com/v2/Content/Installation/Installing-Master.htm

For SolusVM Slave server, install with KVM using the following guide:

http://docs.solusvm.com/v2/Content/Installation/Installing-Slave.htm

That will automatically install KVM & now we can proceed with network configurations

First of all we will edit the eth0 interface:

Type the following using SSH:


# nano /etc/sysconfig/network-scripts/ifcfg-eth0
Remove everything which is there & type or paste the following:

DEVICE="eth0"
ONBOOT="yes"
BRIDGE="br0"
Once done, type Ctrl + X, select YES & Enter

Now we have to edit the br0 interface:


# 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"
IPV6_AUTOCONF="no"
IPV6ADDR="2001:41d0:a:abcd::1/64"
ARPCHECK="no"
Save & press Enter Note: Gateway here will always be IPv4 address of your server ending in 254. If IPv6 was working on your server when you installed OS & you didn't have to add it manually, then you might have to set 


IPV6_AUTOCONF="yes"
Next step is configuring the bridging of our IPv4 subnet, the IPv4 addresses from which will be allocated to our virtual servers


# nano etc/sysconfig/network-scripts/ifcfg-br0:0
DEVICE="br0:0"
BOOTPROTO="static"
IPADDR="2.2.2.31"
NETMASK="255.255.255.224"
ONBOOT="yes"
Save & Enter

Note: Gateway here will be 2nd last IP of your subnet.

Now we do the same for IPv6:


# nano /etc/sysconfig/network-scripts/route6-br0
2001:41d0:a:abff:ff:ff:ff:ff dev br0
default via 2001:41d0:a:abff:ff:ff:ff:ff
Save & Enter

Next is configuring eth1 interface which is for our /27 Subnet:


# nano /etc/sysconfig/network-scripts/ifcfg-eth1
DEVICE=eth1
HWADDR=00:25:82:G3:7G:31
TYPE=Ethernet
UUID=21a4afc3-e2fe-405e-acd3-e16fec816ba1
ONBOOT=no
NM_CONTROLLED=yes
BOOTPROTO=dhcp
Note: Replace HWADDR & UUID with that of your server

Save & Enter

Make sure IPv4 & IPv6 forwarding is enabled:


# nano /etc/sysctl.conf
net.ipv4.ip_forward = 1
net.ipv6.conf.all.forwarding= 1
net.ipv6.conf.br0.forwarding = 1
net.ipv6.conf.default.forwarding = 1
Save & Enter

Restart the network


# etc/init.d/network restart
It is advised that you flush the IP tables also


# iptables --flush
# service iptables restart
It is better to restart the system after all these steps


# reboot
Now login to your SolusVM admin panel

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

Block Name: Whatever you wish

Gateway: 2.2.2.31

Netmask: 255.255.255.224

Nameserver: 213.186.33.99
Save

IP blocks -----> List IP blocks -----> Add IPv6 block

Block Name: Whatever you wish

Gateway: 2001:41d0:000a:abff:00ff:00ff:00ff:00ff

Nameserver: 2001:41d0:3:163::1
Note: IPv6 gateway here should be in full notation

Go to your OVH manager & generate Virtual MAC for each of your IP addresses that you are going to use for deploying your KVM virtual servers. Also put those Virtual MACs for each IP in SolusVM otherwise SolusVM will allocate MAC addresses automatically which will result in failure of your virtual servers' network hence they will not work properly.

Now, you are ready to deploy a KVM vps using SolusVM on your OVH server :)

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

MrGeneral

New Member
Thank you for such great tutorial! I'm highly interested in starting to offer KVM Containers in OVH servers, and was pretty much worried about the network, it can be a PITA to configure it!
 

Shoaib_A

Member
Thank you for your kind words guys. I believe that knowledge increases by sharing not by saving, so this was just a little effort put together during some free time :)
 

SkillerzWeb

New Member
Ok.. Great tutorial for ovh.. But what about SYS ? And also does SYS offer 16 free ip's (with a setup fee) for their servers ?

Thank you.
 

Shoaib_A

Member
Ok.. Great tutorial for ovh.. But what about SYS ? And also does SYS offer 16 free ip's (with a setup fee) for their servers ?

Thank you.
Works on SYS & Kimsufi as well since the principles of networking are same but you need to have IPs from same subnet e.g /28 from 8.8.8.1 to 8.8.8.8 & not individually allocated IPs from different subnets
 

MCH-Phil

New Member
Verified Provider
Works on SYS & Kimsufi as well since the principles of networking are same but you need to have IPs from same subnet e.g /28 from 8.8.8.1 to 8.8.8.8 & not individually allocated IPs from different subnets
Please elaborate on this limitation, I may be looking at it incorrectly.  I have a bad URI and am rightfully very drowsy.  If you are saying what I think, I will look over your guide a little more than I have and see what differs from my setup.  I use multiple subnets on each of my nodes.  I have tons of subnets all over the place.
 

Shoaib_A

Member
Please elaborate on this limitation, I may be looking at it incorrectly.  I have a bad URI and am rightfully very drowsy.  If you are saying what I think, I will look over your guide a little more than I have and see what differs from my setup.  I use multiple subnets on each of my nodes.  I have tons of subnets all over the place.
Phil, I never said that multiple subnets won't work but that individual or singular IPs from multiple subnets won't work as you won't have any way to define your gateway then.

Suppose I have 2 subnets 198.154.67.125/29 & 92.222.103.63/28 there should be no problem using them but would you do if you have 8 singular/individual IPs, each from a different subnet? 

AFAIK it might work with OpenVZ but not with KVM or XEN.

However if you see anything wrong with what I said please feel free to point it out :)
 
Last edited by a moderator:

MCH-Phil

New Member
Verified Provider
It's not a problem from a KVM point of view.  Over a bridge it's just bridge :)  I have single /32's setup in this manner and no trouble.  Should work fine with no modifications to the original guide you posted.  Just set vMAC and configure in SolusVM.  Effectively, ALL OVH are single IP's (/32) in the grand scheme of things.  It's just happens they are sometimes sequential.
 

Shoaib_A

Member
It's not a problem from a KVM point of view.  Over a bridge it's just bridge :)  I have single /32's setup in this manner and no trouble.  Should work fine with no modifications to the original guide you posted.  Just set vMAC and configure in SolusVM.  Effectively, ALL OVH are single IP's (/32) in the grand scheme of things.  It's just happens they are sometimes sequential.
Alright, thank you for adding this to my knowledge. I was honestly not sure if this is possible.
 
Last edited by a moderator:

MCH-Phil

New Member
Verified Provider
Alright, thank you for adding this to my knowledge. I was honestly not sure if this is possible.
Never a problem sir!  We will talk out of band and get this working if there are any hiccups.  :)  You know my PM inbox :D
 

jameshsi

New Member
Hi!

Thanks for this article, but what is that eth1 for ? I don't understand.

nano /etc/sysconfig/network-scripts/ifcfg-eth1
 

jameshsi

New Member
I just found I get it works now.

I omit the IPv6 part cause none of my clients request the useless IPv6, and I omit the eth1 part, and I only have 142.4.19x.xx/30 IP, and I use one of them in br0:0 for gateway, and I thought I can use only 1 IP of that 4, but actually, I can use the rest 3 of them, Great!
 

Shoaib_A

Member
I just found I get it works now.

I omit the IPv6 part cause none of my clients request the useless IPv6, and I omit the eth1 part, and I only have 142.4.19x.xx/30 IP, and I use one of them in br0:0 for gateway, and I thought I can use only 1 IP of that 4, but actually, I can use the rest 3 of them, Great!
Good to know that :)
 
Top
amuck-landowner