OVH Community, votre nouvel espace communautaire.

Instation d'une machine vrituelle Debian sur serveur dédié avec Xen et OpenXenManager


yvnicolas
11/11/2014, 08h31
Ayant pas mal galéré sur le sujet et après plusieurs aller retours avec le support Ovh (merci à eux), je partage ici ce qui a marché pour moi.

Objectif : Installer une première machine virtuelle Xen manager en Debian avec docker installé en partant d'un serveur dédié OVH tout neuf et de mon PC client sous Ubuntu.

Problèmes rencontrés : multiples, les principaux étant l'impossibilité de faire fonctionner les templates préinstallées et un état pour le moins instable d'Openxenmanager sous ubuntu.

Désolé c'est en anglais... Il me reste pas mal d'interrogations, je suis novice sur Xen, si quelqu'un en particulier peut me dépanner sur l'histoire du nombre de CPU virtuels que je n'arrive pas à augmenter, je suis preneur

Initial installation

Only if the dedicated server is brand new, from the OVH manager, install the Citrix Xen Server distribution on the dedicated server. To be found under OVH templates/Type de l'OS : prêt à l'emploi

Make sure you have free IP adresses Failover to be available, if not buy additionnal ones from the IP part of the OVH manager and then get a virtual mac address for the virtual machine following (http://guides.ovh.com/DedieMac)

On your Ubuntu PC, install OpenXenManager, thru the ubuntu software library or with commandline

Code:
sudo apt-get install openxenmanager
Download Iso image

connect to your dedicated server via ssh as root, go to the iso images directory and download the iso image of the distribution your wish using wget. The following example is for Debian 7.7 ISO and reboot your server.
Be careful of the image : the amd64 works with Docker not the i386, you need 64 arch for Docker.

Code:
cd /var/opt/xen/iso_import
wget http://cdimage.debian.org/debian-cd/7.7.0/amd64/iso-dvd/
reboot
The reboot is necessary to correctly take into account the new ISO from xen manager. Just make sure this will not cause any problem for potential running VMs.

Create the VM

On your pc launch openxenmanager from a terminal.
If first launch, add your dedicated server as a new server and then connect to it.

Click on `New VM` and follow the different step of the assistant with following choices
  1. Choose `Wheezy 7.0` as template
  2. Select a name as you wish
  3. Select `ISO Image` for the OS source and the previously downloaded Iso from the dropdown list
  4. Select CPU and memory size you wish according to the server selected
  5. Add a virtual disk but no virtual interfaces at this stage
  6. Click finish without starting the VM automatically



At this stage, you need to disconnect and reconnect to the server to refresh the list of vm and see your new VM appearing as not started.

Installation note : I have not fully understood how the templates work in conjunction with the Iso : wheezy templates in 64 work fine but openxenmanager do not enable console access in the console tabl once started. The other install media template which seems to me as a generic one do not find a proper bootable image when used with the amd64 image but works fine with the I386.

I have not found out yet how to add more than one virtual cpu to the vm....


On the network tab for the newly created vm, add an interface. Select `Network 1` for network, `manual` for the mac address and enter the mac adress you have created in the ovh manager for the vm


Start the vm and go to the console tab where the wm is booting under the ISO image.
The console access depends on the template you have chosen (bug in Openxenmanager?). You can try either thru the console tab in openxenmanager or login into the dedicated server and use :

Code:
xe vm-list
# this is to get the uuid of your vm
 xe console uuid=
Follow the installation process.
During the installation process, pay attention to the following
  1. Network configuration will not succeed in DHCP, choose `Do not configure network at that time`
  2. The keyboard configuration in the console of openxenmanager appears to be qwerty, not azerty, select initially a root password that is qwerty friendly.
  3. At the end of the installation Debian proposes additionnal software install, choose `SSH server` and `Standard System Utiliities`


Set up the network

Once the vm has rebooted after installation, you can login in a tty in the console.
If as it happened once, the vm reboots on the installation iso, shut it down, in the general properties part, move the hard disk drive as the first on the setup menu. Alternatively, being logged on the dedicated server you can use the `xe vm-cd-eject` command.

To set up the network on the new vm, follow (http://guides.ovh.com/BridgeClient). Be careful, in `network/interfaces ` IP FAILOVER can be confusing, put the IP corresponding to the virtual mac address you have created and assigned to the vm

Then update the /etc/apt/sources.list file as the generated one is based on the CDRom iso image.
Here is what you want in the sources.list. This include the wheezy backports needed to get a docker compatible kernel which is not the case with what you get in standard Debian wheezy.
Code:
deb http://http.debian.net/debian wheezy main
deb-src http://http.debian.net/debian wheezy main

deb http://http.debian.net/debian wheezy-updates main
deb-src http://http.debian.net/debian wheezy-updates main

deb http://security.debian.org/ wheezy/updates main
deb-src http://security.debian.org/ wheezy/updates main

# ovh mirror
deb http://mirror.ovh.net/debian/ wheezy-updates main contrib
deb-src http://mirror.ovh.net/debian/ wheezy-updates main contrib

# needed for docker
deb http://http.debian.net/debian wheezy-backports main
Once these editing are done

Code:
service networking restart
apt-get update
apt-get upgrade
You are up and running and can connect to you vm in ssh