Installing & configuring KVM on OVH with SolusVM

Discussion in 'Tutorials and Guides' started by Shoaib_A, Aug 6, 2014.

  1. Shoaib_A

    Shoaib_A Member

    51
    28
    Dec 15, 2013
    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:

    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:

    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:

    Once done, type Ctrl + X, select YES & Enter

    Now we have to edit the br0 interface:


    # nano /etc/sysconfig/network-scripts/ifcfg-br0
    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
    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
    Save & Enter

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


    # nano /etc/sysconfig/network-scripts/ifcfg-eth1
    Note: Replace HWADDR & UUID with that of your server

    Save & Enter

    Make sure IPv4 & IPv6 forwarding is enabled:


    # nano /etc/sysctl.conf
    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

    Save

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

    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: Aug 6, 2014
  2. CentralHosts

    CentralHosts New Member Verified Provider

    15
    1
    Jul 13, 2014
    This is very detailed, thank you for putting it together. 
     
    Shoaib_A likes this.
  3. MrGeneral

    MrGeneral New Member

    4
    2
    Feb 12, 2014
    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 likes this.
  4. Shoaib_A

    Shoaib_A Member

    51
    28
    Dec 15, 2013
    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 :)
     
  5. Epidrive

    Epidrive New Member Verified Provider

    277
    44
    May 16, 2013
    Thanks for the tutorial. This helps a lot :)
     
  6. SkillerzWeb

    SkillerzWeb New Member

    10
    1
    Aug 13, 2014
    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.
     
  7. Shoaib_A

    Shoaib_A Member

    51
    28
    Dec 15, 2013
    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
     
  8. MCH-Phil

    MCH-Phil New Member Verified Provider

    256
    55
    May 21, 2013
    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.
     
  9. Shoaib_A

    Shoaib_A Member

    51
    28
    Dec 15, 2013
    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: Sep 7, 2014
  10. MCH-Phil

    MCH-Phil New Member Verified Provider

    256
    55
    May 21, 2013
    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.
     
  11. Shoaib_A

    Shoaib_A Member

    51
    28
    Dec 15, 2013
    Alright, thank you for adding this to my knowledge. I was honestly not sure if this is possible.
     
    Last edited by a moderator: Sep 9, 2014
    MCH-Phil likes this.
  12. MCH-Phil

    MCH-Phil New Member Verified Provider

    256
    55
    May 21, 2013
    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
     
  13. Jasson.Pass

    Jasson.Pass New Member

    83
    19
    Aug 20, 2014
    Thanks! This guide just helped me setup a new server! :D :D :D :D :D
     
    Shoaib_A likes this.
  14. micronetvps

    micronetvps New Member

    4
    1
    Sep 10, 2014
    Nice guide.
     
    Shoaib_A likes this.
  15. jameshsi

    jameshsi New Member

    4
    0
    Nov 16, 2014
    Hi!

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

    nano /etc/sysconfig/network-scripts/ifcfg-eth1
     
  16. jameshsi

    jameshsi New Member

    4
    0
    Nov 16, 2014
    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!
     
  17. Shoaib_A

    Shoaib_A Member

    51
    28
    Dec 15, 2013
    You may ignore it& follow this guide :
     
  18. Shoaib_A

    Shoaib_A Member

    51
    28
    Dec 15, 2013
    Good to know that :)