Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


[HELP] Setup openvz inside kvm
New on LowEndTalk? Please Register and read our Community Rules.

All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.

[HELP] Setup openvz inside kvm

add_iTadd_iT Member

Hello

Any tutorial to setup openvz inside a KVM vps?

So i have a KVM VPS with 3 IPv4 and i want to split it for 2 or 3 openvz container

Pls help

Comments

  • PieHasBeenEatenPieHasBeenEaten Member, Host Rep

    Just install openvz like normal: https://openvz.org/Quick_installation

    Thanked by 3add_iT Ympker Carpe
  • @Jason_HOSTBD24 said:
    Just install openvz like normal: https://openvz.org/Quick_installation

    Thanks but how to set ram hdd ip quota etc ?

    Any easy automatic installation? like have panel to create container , etc

  • FlamesRunnerFlamesRunner Member
    edited April 2016

    Wow - "how to set ram cpu disk ip on openvz" can be easily googled.

    For your sake, I'll help you out.

    First, install OpenVZ with the quick install page.

    Then, download templates from https://openvz.org/Download/template/precreated.

    Create a container:

    /usr/sbin/vzctl create 101 --ostemplate centos

    Add an IP address:

    /usr/sbin/vzctl set 101 --ipadd 192.168.1.1 --save

    Start a container:

    /usr/sbin/vzctl start 101 

    Set memory limit:

    /usr/sbin/vzctl set 101 --privvmpages 256M --save 

    Set disk limit:

    /usr/sbin/vzctl set 101 --diskspace 5G:5G --save

    Those are the basics. Use the OpenVZ wiki to learn more.

    Thanked by 4_Nic add_iT Carpe ehab
  • @FlamesRunner said:
    Wow - "how to set ram cpu disk ip on openvz" can be easily googled.

    For your sake, I'll help you out.

    First, install OpenVZ with the quick install page.

    Then, download templates from https://openvz.org/Download/template/precreated.

    Create a container:

    /usr/sbin/vzctl create 101 --ostemplate centos

    Add an IP address:

    /usr/sbin/vzctl set 101 --ipadd 192.168.1.1 --save

    Start a container:

    /usr/sbin/vzctl start 101 

    Set memory limit:

    /usr/sbin/vzctl set 101 --privvmpages 256M --save 

    Set disk limit:

    /usr/sbin/vzctl set 101 --diskspace 5G:5G --save

    Those are the basics. Use the OpenVZ wiki to learn more.

    Thanks

    But how to take control those container, like start, reboot, etc

    Is is possible to install panel like openvz web panel or proxmox on this KVM ?

  • I beleive the command is vzctl enter...did you even look at the wiki

  • @add_iT
    @flamerunner already told you how to start a container....vzctl start...

  • CarpeCarpe Member

    also interested in deploying OpenVZs within a KVM, so the KVM might "have" multiple timezones

  • Just use virtualizor free trial to set it up and you will get it going right away :) if you like virtualizor just pay 1$/mo for it and be happy^^

    Thanked by 2add_iT AndrewSSD
  • edanedan Member

    Well follow this:

    
    yum update -y
    
    yum install -y wget
    
    cd /etc/yum.repos.d
    
    wget http://download.openvz.org/openvz.repo
    
    rpm --import http://download.openvz.org/RPM-GPG-Key-OpenVZ
    
    yum install -y vzkernel.x86_64
    
    yum install -y vzctl vzquota
    
    yum install -y ploop
    
    sed -i 's/kernel.sysrq = 0/kernel.sysrq = 1/g' /etc/sysctl.conf
    
    sed -i 's/net.ipv4.ip_forward = 0/net.ipv4.ip_forward = 1/g' /etc/sysctl.conf
    
    echo 'net.ipv4.conf.default.proxy_arp = 0' >> /etc/sysctl.conf
    
    echo 'net.ipv4.conf.all.rp_filter = 1' >> /etc/sysctl.conf
    
    echo 'net.ipv4.conf.default.send_redirects = 1' >> /etc/sysctl.conf
    
    echo 'net.ipv4.conf.all.send_redirects = 0' >> /etc/sysctl.conf
    
    echo 'net.ipv4.icmp_echo_ignore_broadcasts=1' >> /etc/sysctl.conf
    
    echo 'net.ipv4.conf.default.forwarding=1' >> /etc/sysctl.conf
    
    sysctl -p
    
    sed -i 's/NEIGHBOUR_DEVS=detect/NEIGHBOUR_DEVS=all/g' /etc/vz/vz.conf
    
    sed -i 's/options nf_conntrack ip_conntrack_disable_ve0=1/options nf_conntrack ip_conntrack_disable_ve0=0/g' /etc/modprobe.d/openvz.conf
    
    sed -i 's/SELINUX=enforcing/SELINUX=disabled/g' /etc/sysconfig/selinux
    
    yum install -y ntp
    
    ntpdate -u us.pool.ntp.org
    
    chkconfig ntpd on
    
    reboot
    

    And install the Ovz Web Panel:

    wget -O - https://raw.githubusercontent.com/sibprogrammer/owp/master/installer/ai.sh | sh

    Use above method for my kimsufi box [Source]

    Thanked by 1add_iT
  • edan said: And install the Ovz Web Panel:

    I have install OVZ Web Panel before but when try to login inside it said no physical server found and i cannot create any container

  • try hostguard

    Thanked by 1add_iT
  • Now i successfull installing it but i cannot connect to ovz side

    Let see if i have ip eth0 xx.xx.xx.x2 / xx.xx.xx.xx.x6 / xx.xx.xx.x9 on KVM side node

    How to assign it to each container?

  • jarjar Patron Provider, Top Host, Veteran

    @add_iT said:
    Now i successfull installing it but i cannot connect to ovz side

    Let see if i have ip eth0 xx.xx.xx.x2 / xx.xx.xx.xx.x6 / xx.xx.xx.x9 on KVM side node

    How to assign it to each container?

    Make sure the IPs are not bound to any interface and then add them to the container.

    vzctl set CTID --ipadd IPADDRESS --save

    Thanked by 1add_iT
  • aglodekaglodek Member
    edited April 2016

    Very interesting script, especially since I can't make out most of what it does starting with line 8 (first 'sed' command)… adding brief comments in it, line by line, would be very helpful (for bash newbies like me ;)

    So simple and useful… pure genius! :) A couple of suggestions, though… not much hassle to add (for bash guru), but making the script much more user friendly:

    • check for existing containers and start with next container id in line as default input

    • change OS text input to a list select input, populating it from /vz/template/cache

    EDIT: I know, I know… a couple of other things, add a web front end, and will wind up with another OpenVZ CP ;)

    Thanked by 1jar
  • jarland said: Make sure the IPs are not bound to any interface and then add them to the container.

    vzctl set CTID --ipadd IPADDRESS --save

    Thanks , im remove all additional IP from interface and it fully works now

    Really useful information

Sign In or Register to comment.