Vyhledávání


vytiskni pdf
Proxmox


DESCRIPTION

Proxmox is a virtualisation distribution which offers the ability to manage virtual servers (VPS) technology with the Linux OpenVZ and KVM. Management is made easy with a few clicks through the web interface which is accessible after installation on your server.
Connect to the interface you will find under https://yourserver.ovh.net with the username root and the password.


KVM

Import an ISO

Linux KVM is the "full virtualization" and requires a processor with (VMX) virtualization flags. This allows you to install the operating system of your choice from a file. ISO is created from an installation CD.

To import an ISO you need to go Proxmox > ISO Images
Then click on Browse to select your ISO.

Or

Place the .ISO into the folder /var/lib/vz/template/iso/ on your server so you can select it from the web interface.

Create a vm bridge (recommended)

To create a virtual machine bridge, you must go to Proxmox> Virtual Machines> Create tab.

You have the creation form:



Edit the form:

- to select: install media (your iso).

Then fill in:
- disk space needed.
- Name (hostname of the server)
- the amount of required memory for the virtual machine
- the disc type
- the type of guest
- the number of cpu

For the network part:

In the dropdown select vmbr0
In mac address specify the virtual mac createed from the manager v3 for the ip of this virtual machine.

To create a virtual mac address go to this guid http://help.ovh.co.uk/DedieMac

Finally click create.

Once the virtual machine created, you must run the virtual machine to start the installation.

In Proxmox> Virtual Machines> click the virtual machine and click Start. And finally click on Open VNC console to interact and start installing the system. Once the virtual machine created, you must run the virtual machine to start the installation.

Installation should be done without configuring the network. Network configuration will be done after installing the system by following this guide:

http://help.ovh.co.uk/BridgeClient


Create routed vm

To create a virtual machine routed, you must go to Proxmox> Virtual Machines> Create tab.

You have the creation form:



Modify the form:

- to select: install media (your iso).

Then fill in:
- disk space needed.
- Name (hostname of the server)
- the amount of required memory for the virtual machine
- the type of disc
- the type of guest
- the number of cpu

For the network section:

drop-down list select the vmbr1.

Finally click create.

Once the virtual machine created, you must run the virtual machine to start the installation.

In Proxmox> Virtual Machines> click the virtual machine and click Start. And finally on Open VNC console to interact and begin installing the system.

The installation should be done without configuring the network. network configuration will be done after system installation. The gateway is the IP address of the Proxmox host

example configuration of a virtual machine on debian:
in /etc/network/interfaces :

auto lo eth0
iface lo inet loopback
iface eth0 inet static
address IP.FAIL.OVER
netmask 255.255.255.255
broadcast IP.FAIL.OVER
post-up route add IP.YOUR.DEDI dev eth0
post-up route add default gw IP.YOUR.DEDI
post-down route del IP.YOUR.DEDI dev eth0
post-down route del default gw IP.YOUR.DEDI


and run this command:
echo "nameserver 213.186.33.99" > /etc/resolv.conf # configure the DNS

for other systems you must adapt to get the same result for the network configuration.

Info !
For Windows 2003 : The netmask is 255.255.255.255 is not accepted by windows here is the procedure:
  • Configure windows with IP failover. the netmask (255.255.255.255) will not be accepted, so temporarily
configure windows with IP failover. the IP failover. the "255.255.255.0"
  • ange the - netmask + + - with the registry editor in order to avoid problems in the future:
    • Click "Start" -> "Run"
    • type "regedit" and confirm
    • looking in HKEY_LOCAL_MACHINE\SYSTEM\key "SubnetMask" with the value "255.255.255.0" and change it to "255.255.255.255"



Finally run this command replacing IP.FAIL.OVER in ssh on the host Proxmox:
ip route add IP.FAIL.OVER dev vmbr1



Create a vm nat

To create a vm nat you should create a bridge planned for this purpose:

SSH in as root on the host change the file : /etc/network/interfaces

vi /etc/network/interfaces


and add this:


auto vmbr2
iface vmbr2 inet static
address 192.168.0.254
netmask 255.255.255.0
bridge_ports none
bridge_stp off
bridge_fd 0
post-up echo 1 > /proc/sys/net/ipv4/ip_forward
post-up iptables -t nat -A POSTROUTING -s '192.168.0.0/24' -o vmbr0 -j MASQUERADE
post-down iptables -t nat -D POSTROUTING -s '192.168.0.0/24' -o vmbr0 -j MASQUERADE


activate the brige created:
ifup vmbr2


then create your virtual machine like this:



modifier le formulaire :

- To select: install media (your iso). Modify the form:

Then fill in:
- disk space needed.
- Name (hostname of the server)
- the amount of required memory for the virtual machine
- the type of disc
- the type of guest
- the number of cpu

for the network section:

drop-down list select the vmbr2.

Finally click create.

Once the virtual machine created, you must run the virtual machine to start the installation.

In Proxmox> Virtual Machines> click the virtual machine and click Start. And finally on Open VNC console to interact and begin installing the system.

In the network configuration of the virtual machine indicate this in relation to our example (these can be configured during installation of the virtual machine):

ip : 192.168.0.1
netmask 255.255.255.0
broadcast 192.168.0.255
gateway : 192.168.0.254 (ip vmbr2 on the host)
server de nom : 213.86.33.99


Once installed your virtual machine will be functional and will have access to the outside network.

If you want to make your virtual machine is accessible via ssh for example must forward a port of the host to port your ssh vm.

For this you need to run an iptables rule:
iptables -t nat -A PREROUTING -i vmbr0 -p tcp --dport 1022 -j DNAT --to 192.168.0.1:22


This example: redirect port 1022 to host on port 22 of the virtual machine. Therefore the virtual machine will be available by contacting the ip ssh host on port 1022.

For this rule to take effect after every reboot, the file /etc/network/interfaces

The change to have this level of vmbr2:

auto vmbr2
iface vmbr2 inet static
address 192.168.0.254
netmask 255.255.255.0
bridge_ports none
bridge_stp off
bridge_fd 0
post-up echo 1 > /proc/sys/net/ipv4/ip_forward
post-up iptables -t nat -A POSTROUTING -s '192.168.0.0/24' -o vmbr0 -j MASQUERADE
post-down iptables -t nat -D POSTROUTING -s '192.168.0.0/24' -o vmbr0 -j MASQUERADE
post-up iptables -t nat -A PREROUTING -i vmbr0 -p tcp --dport 1022 -j DNAT --to 192.168.0.1:22
post-down iptables -t nat -D PREROUTING -i vmbr0 -p tcp --dport 1022 -j DNAT --to 192.168.0.1:22



OpenVZ


Description

OpenVZ is a very powerful insulation technology. Each VE (Virtual Environment) has its own network card and hardware, and can use a different distribution. Although, it is not possible to install operating systems other than Linux (Windows, * BSD, ...) or different kernels in the VE.

Upon installation, you have "templates" (prepared by OVH Linux distributions for use in OpenVZ VE) that you can use to create a VPS with the web interface. This allows you to start the first VPS in 3 clicks and less than 2 minutes after installing your server with Proxmox!

Create a VM routed
The easiest way to put a VE (virtual environment) network is to use a block of IPs or IP failover. OpenVZ supports the routing configuration.

To do this click on virtual machines> create and complete the form as follows:



Select type: Container (openvz)
In model select the template you want for this virtual machine

Then fill in:
- Disk space needed.
- Name (hostname of the server)
- The amount of required memory for the virtual machine
- The size of swap memory
- The root password of the server
- The size of disk

Network level, enter your IP FailOver? and Network Type "Virtual Network (venet)" to create.

Then just to start the virtual machine to start using it.

In Proxmox> Virtual Machines> Click the virtual machine and click Start.

Create a VM NAT

To create a vm for openvz with nat simply fill in the form of creation like this: create a vm nat



Select type: Container (openvz)
In model select the template you want for this virtual machine.

Then fill in:
- disk space needed.
- Name (hostname of the server)
- memory for the virtual machine wanted
- the size of swap memory
- the root password of the server
- Disk Size


Network level, specify a private IP (eg 10.0.0.1) and Network Type "Virtual Network (venet)" to create.

Then run this command in ssh on the host:

iptables -t nat -A POSTROUTING -s 10.0.0.0/24 -o vmbr0 -j SNAT --to IP.de.votre.serveur_hote


Then just to start the virtual machine to start using it.

n Proxmox> Virtual Machines> click the virtual machine and click Start.

If you want to make your virtual machine is accessible via ssh for example must forward a port of the host to port your ssh vm

For this you need to run an iptables rule:
iptables -t nat -A PREROUTING -i vmbr0 -p tcp --dport 1022 -j DNAT --to 10.0.0.1:22


This example: redirect port 1022 to host on port 22 of the virtual machine. Therefore the virtual machine will be available by contacting the ip ssh host on port 1022.

For this rule at server startup:

Create a file to launch in the /etc/init.d/vz-nat with this content:

#!/bin/sh


case "$1" in
start) echo "Starting iptables NAT for openvz"
#replace the.ip.server.host by the ip output
/sbin/iptables -t nat -A POSTROUTING -s 10.0.0.0/24 -o vmbr0 -j SNAT --to the.ip.server.host

#set the rules for adding iptables port forwarding
/sbin/iptables -t nat -A PREROUTING -i vmbr0 -p tcp --dport 1022 -j DNAT --to 10.0.0.1:22

;;

stop) echo "Stopping iptables NAT for openvz"
#replace the.ip.server.host by the ip output
/sbin/iptables -t nat -D POSTROUTING -s 10.0.0.0/24 -o vmbr0 -j SNAT --to the.ip.server.host

#set the rules for adding iptables port forwarding
/sbin/iptables -t nat -D PREROUTING -i vmbr0 -p tcp --dport 1022 -j DNAT --to 10.0.0.1:22
;;

*) echo "Usage: /etc/init.d/nat-vz {start|stop}"
exit 2
;;

esac
exit 0


then make the script executable:
chmod 755 /etc/init.d/nat-vz


and put the server on startup:

update-rc.d nat-vz defaults



Create a vm bridge

This configuration is not recommended for performance reasons and will therefore not covered in this guide.


Advice


Update: The distribution includes the kernel Proxmox original. Please check the contents of /boot/grub/menu.lst, especially the parameter "root =", before restarting the server after an update. For updates between major releases, additional steps may be necessary in this case more information is available section "Distributions et OS"section "Distributions and OS"].

Mailing list: For additional information regarding the installation of VPS, please go to Proxmox Site, in case of problems or questions do not forget to sign up on the mailing list devoted to the VPS, vps@ml.ovh.net, by sending a blank email to vps-subscribe@ml.ovh.net.