Installare VMWare Server 2.0.1 su un RPS di OVH

Cos’è OVH e cos’è un RPS

OVH, importante società di hosting francese che da poco ha aperto una filiale italiana, vende un servizio chiamato Real Private Server (RPS).
Di fatto si tratta di una macchina dedicata con l’unica differenza che il disco non è interno ma piuttosto viene utilizzato il protocollo iSCSI (e come opzione NFS) per utilizzare un disco di rete.

Il Real Private Server di OVH in breve

Il Real Private Server di OVH in breve

Questa soluzione permette di avere grandi prestazioni in termini di calcolo e memoria (pari ad un dedicato) e buona affidabilità in termini di disco: senza bisogno di avere soluzioni avanzate di RAID interno i nostri dati sono al sicuro da eventuali crash di dischi con l’unico svantaggio di un accesso non troppo veloce al disco ed una limitata capacità.

In particolare l’accesso al disco avviene sempre tramite la scheda di rete a 100mbps che collega l’RPS ad internet e quindi non potrà in alcun caso superare questa velocità (circa 10MB/s). Il disco di rete predefinito, inoltre, è di soli 10GB, che vi verranno molto stretti se volete installare una macchina virtuale. Io ho approfittato di una offerta presente fino a qualche giorno fa con la quale OVH regalava un disco da 50GB al posto dei 10GB predefiniti, mantenendo il prezzo.

Confronto caratteristiche RPS3, RPS4 e RPS5

Confronto caratteristiche RPS3, RPS4 e RPS5

Se intendete provare VMWare il mio consiglio è di scegliere almeno una RPS3 che per 20€ al mese vi da 2GB di RAM e un processore dual code AMD che supporta i flag di virtualizzazione (chiamato “svm” nel caso dei processori AMD). Con circa 40€ potete permettervi un server con 4GB di RAM e un AMD Phenom X4. Teniamo sembre presente che più memoria abbiamo più dati del disco riusciremo a cachare e meno la lentezza dell’accesso al disco influirà sulle prestazioni finali. WOW!

Kernel

Gli RPS vengono consegnate con una distribuzione linux a vostra scelta. Io ho scelto Fedora Core 9, poichè utilizzo redhat/fedora da circa 10 anni e la conosco meglio e poi, in questo caso, torna utile il supporto per i pacchetti RPM.

Innanzitutto per poter installare VMWare Server è necessario che il kernel del sistema supporti il caricamento dinamico di moduli e il dispositivo /dev/rtc (Real Time Clock). I kernel predefiniti presenti nel netboot degli RPS non supportano i moduli e quindi dovrete compilare ed installare un kernel personalizzato.

Assicuratevi quindi che dopo il reboot il comando “lsmod” non restituisca errore e che il device /dev/rtc esista (ls /dev/rtc)

shell# lsmod
Module                  Size  Used by
iptable_filter          3072  0
ip_tables              11920  1 iptable_filter
....

shell# ls -al /dev/rtc
lrwxrwxrwx 1 root root 4  2 apr 02:00 /dev/rtc -> rtc0

Download di VMware Server 2.0.1

VMWare Server 2.0

VMWare Server 2.0

Vi consiglio di eseguire la procedura di registrazione sul sito di vmware così da ottenere una login e password da utilizzare per scaricare il file dal vostro server e la chiave di registrazione.

Sito VMWare - Download e chiave licenza

Sito VMWare - Download e chiave licenza

Una volta ottenuta la login/password e i codici di licenza per la versione linux potrete, direttamente dal server scaricare il pacchetto rpm:

shell# lynx http://www.vmware.com/go/getserver

Accetate i cookies con “A” (vi verrà chiesto un paio di volte), trovate il punto dove mettere username e password per poi proseguire con “continue” e a quel punto selezionate la versione RPM per linux e scaricatela con “D”.
Quando vi viene chiesto il nome assicuratevi di cancellare i parametri presenti dopo al “?” così che il file abbia estensione .rpm.
Noterete che il server scarica i quasi 500MB dal sito VMWare a 10MB/s 🙂 ma li salva in memoria. Quando andrete a salvararli su disco ci metterà altrettanto tempo (anche l’accesso al disco è a 10MB/s circa!! 🙁 ).

Installazione

shell# rpm -Uvh VMware-server-2.0.1-156745.i386.rpm

Preparazione in corso...   ########################################### [100%]
1:VMware-server          ########################################### [100%]

The installation of VMware Server 2.0.1 for Linux completed successfully.
You can decide to remove this software from your system at any time by
invoking the following command: "rpm -e VMware-server".

Before running VMware Server for the first time, you need to
configure it for your running kernel by invoking the
following command: "/usr/bin/vmware-config.pl".

Enjoy,

--the VMware team

Come suggerito dal testo avviamo poi la configurazione:

shell# /usr/bin/vmware-config.pl
Making sure services for VMware Server are stopped.

Stopping VMware autostart virtual machines:
Virtual machines                                        [FALLITO]
Stopping VMware management services:
VMware Virtual Infrastructure Web Access
VMware Server Host Agent                                [FALLITO]
Stopping VMware services:
VMware Authentication Daemon                            [  OK  ]
Virtual machine monitor                                 [  OK  ]

You must read and accept the End User License Agreement to continue.
Press enter to display it.

Ci viene mostrata l’intera licenza…

Do you accept? (yes/no) yes

Thank you.

None of the pre-built vmmon modules for VMware Server is suitable for your running kernel.  Do you want this program to try to build the vmmon module for your system (you need to have a C compiler installed on your system)? [yes]

Using compiler "/usr/bin/gcc". Use environment variable CC to override.

What is the location of the directory of C header files that match your running kernel?
[/lib/modules/2.6.28.4-custom-std-ipv4-32-mod/build/include]

Extracting the sources of the vmmon module.

Building the vmmon module.

Using 2.6.x kernel build system.
make: [RIMOSSO OUTPUT COMPILAZIONE]
The vmmon module loads perfectly into the running kernel.

None of the pre-built vmci modules for VMware Server is suitable for your running kernel.  Do you want this program to try to build the vmci module for your system (you need to have a C compiler installed on your system)? [yes]

Extracting the sources of the vmci module.

Building the vmci module.

Using 2.6.x kernel build system.
make: [RIMOSSO OUTPUT COMPILAZIONE]
The vmci module loads perfectly into the running kernel.

None of the pre-built vsock modules for VMware Server is suitable for your running kernel.  Do you want this program to try to build the vsock module for your system (you need to have a C compiler installed on your system)? [yes]

Extracting the sources of the vsock module.

Building the vsock module.

Using 2.6.x kernel build system.
make: [RIMOSSO OUTPUT COMPILAZIONE]
The vsock module loads perfectly into the running kernel.
[yes]

A questo punto viene la parte importante della configurazione della rete di VMware. In pratica creiamo una rete Bridged sulla dummy0 (già presente per la gestione dell’IP FailOver nell’RPS) ed una HostOnly lasciando scegliere un IP privato a VMware Server (non useremo questo IP).

Do you want networking for your virtual machines? (yes/no/help) [yes]

Configuring a bridged network for vmnet0.

Please specify a name for this network.
[Bridged]

Your computer has multiple ethernet network interfaces available: dummy0, eth0.
Which one do you want to bridge to vmnet0? [eth0] dummy0

The following bridged networks have been defined:

. vmnet0 is bridged to dummy0

Do you wish to configure another bridged network? (yes/no) [no]

Do you want to be able to use NAT networking in your virtual machines? (yes/no) [yes] no

Do you want to be able to use host-only networking in your virtual machines? [no] yes

Configuring a host-only network for vmnet1.

Please specify a name for this network.
[HostOnly]

Do you want this program to probe for an unused private subnet? (yes/no/help) [yes]

Probing for an unused private subnet (this can take some time)...

The subnet 192.168.219.0/255.255.255.0 appears to be unused.

The following host-only networks have been defined:

. vmnet1 is a host-only network on private subnet 192.168.219.0.

Do you wish to configure another host-only network? (yes/no) [no]
None of the pre-built vmnet modules for VMware Server is suitable for your
running kernel.  Do you want this program to try to build the vmnet module for
your system (you need to have a C compiler installed on your system)? [yes]

Extracting the sources of the vmnet module.

Building the vmnet module.

Using 2.6.x kernel build system.
make: [RIMOSSO OUTPUT COMPILAZIONE]
The vmnet module loads perfectly into the running kernel.

Please specify a port for remote connections to use [902]

You have a pre-existing config.xml.  The new version will be created as
/etc/vmware/hostd/NEW_config.xml.  Please check the new file for any new values
that you may need to migrate to your current config.xml.

Please specify a port for standard http connections to use [8222]

Please specify a port for secure http (https) connections to use [8333]

The current administrative user for VMware Server  is ''.  Would you like to
specify a different administrator? [no]

Using root as the VMware Server administrator.

You have a pre-existing vmInventory.xml.  The new version will be created as
/etc/vmware/hostd/NEW_vmInventory.xml.  Please check the new file for any new
values that you may need to migrate to your current vmInventory.xml.

In which directory do you want to keep your virtual machine files?
[/var/lib/vmware/Virtual Machines] /home/vms

You have a pre-existing datastores.xml.  The new version will be created as
/etc/vmware/hostd/NEW_datastores.xml.  Please check the new file for any new
values that you may need to migrate to your current datastores.xml.

Do you want to enter a serial number now? (yes/no/help) [no] yes

Please enter your 20-character serial number.

Type XXXXX-XXXXX-XXXXX-XXXXX or 'Enter' to cancel:  YYYYY-YYYYY-YYYYY-YYYYY
Creating a new VMware VIX API installer database using the tar4 format.

Installing VMware VIX API.

In which directory do you want to install the VMware VIX API binary files?
[/usr/bin]

In which directory do you want to install the VMware VIX API library files?
[/usr/lib/vmware-vix/lib]

The path "/usr/lib/vmware-vix/lib" does not exist currently. This program is
going to create it, including needed parent directories. Is this what you want?
[yes]

In which directory do you want to install the VMware VIX API document pages?
[/usr/share/doc/vmware-vix]

The path "/usr/share/doc/vmware-vix" does not exist currently. This program is
going to create it, including needed parent directories. Is this what you want?
[yes]

The installation of VMware VIX API 1.6.2 build-156745 for Linux completed
successfully. You can decide to remove this software from your system at any
time by invoking the following command: "/usr/bin/vmware-uninstall-vix.pl".

Enjoy,

--the VMware team

L’installazione prosegue poi avviando vmware:

Starting VMware services:
Virtual machine monitor                                 [  OK  ]
Virtual machine communication interface                 [  OK  ]
VM communication interface socket family:               [  OK  ]
Virtual ethernet                                        [  OK  ]
Bridged networking on /dev/vmnet0                       [  OK  ]
Host-only networking on /dev/vmnet1 (background)        [  OK  ]
DHCP server on /dev/vmnet1                              [  OK  ]
VMware Server Authentication Daemon (background)        [  OK  ]
Shared Memory Available                                 [  OK  ]
Starting VMware management services:
VMware Server Host Agent (background)                   [  OK  ]
VMware Virtual Infrastructure Web Access
Starting VMware autostart virtual machines:
Virtual machines                                        [  OK  ]

The configuration of VMware Server 2.0.1 build-156745 for Linux for this
running kernel completed successfully.

Verifica

Se tutto è andato bene dovreste vedere che vmware ha fatto il bind di parecchie porte:

shell# netstat -lnp | grep '\(vmware\|webA\)'
tcp        0      0 127.0.0.1:8005              0.0.0.0:*                   LISTEN      3253/webAccess
tcp        0      0 0.0.0.0:902                 0.0.0.0:*                   LISTEN      3222/vmware-authdla
tcp        0      0 0.0.0.0:8009                0.0.0.0:*                   LISTEN      3253/webAccess
tcp        0      0 0.0.0.0:8333                0.0.0.0:*                   LISTEN      3346/vmware-hostd
tcp        0      0 127.0.0.1:8307              0.0.0.0:*                   LISTEN      3346/vmware-hostd
tcp        0      0 0.0.0.0:8308                0.0.0.0:*                   LISTEN      3253/webAccess
tcp        0      0 0.0.0.0:8222                0.0.0.0:*                   LISTEN      3346/vmware-hostd

A questo punto aprendo un browser su https://VOSTROSERVER:8333/ui/ dovrebbe apparirvi la richiesta d’accesso al pannello di gestione vmware via web. 😀
Se avete installato il Virtual Infrastructure Client potete alternativamente utilizzare quest’ultimo usando come indirizzo VOSTROSERVER:8333.
Vedremo successivamente come sia possibile disabilitare la gestione web di vmware che utilizza un sacco di memoria sul server.

Se non vi funziona (molto probabile) allora controllate la prossima sezione.

Se vi funziona sappiate che non è ancora finita. Bisogna infatti ancora configurare il nostro server perchè faccia il forwarding dei pacchetti per l’IP failover verso le macchine virtuali e configurare correttamente le macchine virtuali.

Risoluzione problemi

Disabilitazione SELinux

vmware server 2.0 ha problemi con SELinux. I kernel di OVH non supportano SELinux, quindi se non l’avete abilitato voi non dovreste averlo. Se invece ce l’avete e non volete disabilitarlo provate a leggere il changelog di VMware server 2.0.1 che include qualche suggerimento su come sistemare i problemi con SELinux.

Problemi con HALdaemon

Riconoscete questo problema controllando il contenuto del log di vmware:

shell# tail /var/log/vmware/hostd.log
[2009-04-02 19:41:58.793 'Libs' 3077572288 info] HAL05LoadHALLibraries: dlopened libhal.so.1.
[2009-04-02 19:41:58.793 'Libs' 3077572288 info] HAL05LoadHalLibraries: dlopened libdbus-1.so.3.
[2009-04-02 19:41:58.795 'Libs' 3077572288 info] HAL05Init: HAL context initialization failed. Try starting hald as root.

Innanzitutto verificate che haldaemon sia installato e caricato (ps aux | grep hal visualizza processi?).

shell# rpm -qa |grep hal

Non dovrebbe darvi alcun risultato, che significa che non è installato.

shell# yum install hal

Una volta installato provate a riavviare l’RPS. Probabilmente continuerete a vedere lo stesso errore nel log vmware.
Questo succede perchè di default vmware server si avvia con una priorità maggiore rispetto ad haldaemon e questo non gli permette di avviarsi correttamente. E’ quindi necessario modificare l’ordine di avvio così che vmware venga avviato successivamente ad haldaemon.

shell# vi /etc/rc.d/init.d/vmware
( nelle prime righe troverete i parametri chkconfig )
###
# chkconfig: 235 19 08
# description: Manages the services needed to run VMware software
###

Modificate il 19 in 39 così da ritardare maggiormente l’inizializzazione, salvate e avviate la riconfigurazione degli script di avvio:

chkconfig vmware reset

Con ogni probabilità continuerete a vedere questo errore perchè il servizio HAL sembra non partire correttamente. Nel mio caso ho risolto cambiando la priorità di avvio anche per hal:

shell# vi /etc/rc.d/init.d/haldaemon
( nelle prime righe troverete i parametri chkconfig )
###
# chkconfig: 235 26 72
# description: Manages the services needed to run VMware software
###

Modificate il 26 72 in 36 62 così da ritardare maggiormente l’inizializzazione mantenendola comunque prima di vmware (che abbiamo messo a 39), salvate e avviate la riconfigurazione degli script di avvio:

chkconfig haldaemon reset

Risorse

Le risorse, prevalentemente in francese (che non conosco) ma anche in inglese, usate come guida:
Joannes Vermorel’s Installing VMWare Server 2.0 on a OVH RPS
Softilion’s OVH: monter un serveur dédié Windows Server avec une licence déjà acquise par ailleurs via virtualisation VMWare
GuiGui’s VMWare Server 2.0 sur dédiés OVH et mise en oeuvre d’une solution de haute disponibilité avec datastore en DRBD

Tags: , , , ,

venerdì, Aprile 3rd, 2009 Sysadmin

2 Comments to Installare VMWare Server 2.0.1 su un RPS di OVH

  • Giampaolo del Forum OVH ha detto:

    Ciao Bago, di seguito l’errore del mio primo tentativo di installazione VMware Server 2… mi dai una dritta per capire il da farsi?
    Grazie!!!

    None of the pre-built vmmon modules for VMware Server is suitable for your
    running kernel. Do you want this program to try to build the vmmon module for
    your system (you need to have a C compiler installed on your system)? [yes]

    Using compiler “/usr/bin/gcc”. Use environment variable CC to override.

    What is the location of the directory of C header files that match your running
    kernel?
    [/lib/modules/2.6.32.2-xxxx-std-ipv4-64-mod/build/include]

    Extracting the sources of the vmmon module.

    Building the vmmon module.

    Using 2.6.x kernel build system.
    make: Entering directory `/tmp/vmware-config0/vmmon-only’
    make -C /lib/modules/2.6.32.2-xxxx-std-ipv4-64-mod/build/include/.. SUBDIRS=$PWD SRCROOT=$PWD/. modules
    make[1]: Entering directory `/usr/src/linux-2.6.32.2′
    CC [M] /tmp/vmware-config0/vmmon-only/linux/driver.o
    In file included from /tmp/vmware-config0/vmmon-only/linux/driver.c:31:
    /tmp/vmware-config0/vmmon-only/./include/compat_wait.h:78: error: conflicting types for ‘poll_initwait’
    include/linux/poll.h:70: error: previous declaration of ‘poll_initwait’ was here
    In file included from /tmp/vmware-config0/vmmon-only/./common/vmx86.h:32,
    from /tmp/vmware-config0/vmmon-only/linux/driver.h:29,
    from /tmp/vmware-config0/vmmon-only/linux/driver.c:101:
    /tmp/vmware-config0/vmmon-only/./include/x86msr.h:164:1: warning: “MSR_THERM2_CTL” redefined
    In file included from /usr/src/linux-2.6.32.2/arch/x86/include/asm/msr.h:4,
    from /usr/src/linux-2.6.32.2/arch/x86/include/asm/processor.h:21,
    from include/linux/prefetch.h:14,
    from include/linux/list.h:6,
    from include/linux/module.h:9,
    from /tmp/vmware-config0/vmmon-only/./include/compat_module.h:27,
    from /tmp/vmware-config0/vmmon-only/linux/driver.c:26:
    /usr/src/linux-2.6.32.2/arch/x86/include/asm/msr-index.h:225:1: warning: this is the location of the previous definition
    /tmp/vmware-config0/vmmon-only/linux/driver.c: In function ‘LinuxDriverSyncCallOnEachCPU’:
    /tmp/vmware-config0/vmmon-only/linux/driver.c:1423: error: too many arguments to function ‘smp_call_function’
    /tmp/vmware-config0/vmmon-only/linux/driver.c: In function ‘LinuxDriver_Ioctl’:
    /tmp/vmware-config0/vmmon-only/linux/driver.c:1987: error: ‘struct task_struct’ has no member named ‘euid’
    /tmp/vmware-config0/vmmon-only/linux/driver.c:1987: error: ‘struct task_struct’ has no member named ‘uid’
    /tmp/vmware-config0/vmmon-only/linux/driver.c:1988: error: ‘struct task_struct’ has no member named ‘fsuid’
    /tmp/vmware-config0/vmmon-only/linux/driver.c:1988: error: ‘struct task_struct’ has no member named ‘uid’
    /tmp/vmware-config0/vmmon-only/linux/driver.c:1989: error: ‘struct task_struct’ has no member named ‘egid’
    /tmp/vmware-config0/vmmon-only/linux/driver.c:1989: error: ‘struct task_struct’ has no member named ‘gid’
    /tmp/vmware-config0/vmmon-only/linux/driver.c:1990: error: ‘struct task_struct’ has no member named ‘fsgid’
    /tmp/vmware-config0/vmmon-only/linux/driver.c:1990: error: ‘struct task_struct’ has no member named ‘gid’
    /tmp/vmware-config0/vmmon-only/linux/driver.c:2007: error: too many arguments to function ‘smp_call_function’
    make[2]: *** [/tmp/vmware-config0/vmmon-only/linux/driver.o] Error 1
    make[1]: *** [_module_/tmp/vmware-config0/vmmon-only] Error 2
    make[1]: Leaving directory `/usr/src/linux-2.6.32.2′
    make: *** [vmmon.ko] Error 2
    make: Leaving directory `/tmp/vmware-config0/vmmon-only’
    Unable to build the vmmon module.

    For more information on how to troubleshoot module-related problems, please
    visit our Web site at “http://www.vmware.com/go/unsup-linux-products” and
    “http://www.vmware.com/go/unsup-linux-tools”.

    Execution aborted.

  • impiastro ha detto:

    Non so se ti può più servire Giampaolo ma ecco la risposta al tuo problema che ho incontrato anch’io proprio oggi pomeriggio:

    Passaggio 18b) di questa guida (http://forum.ovh.it/showpost.php?p=14865&postcount=6) scritta da me partendo da quella di Bago e di Giampaolo (che penso sia tu…).

  • Lascia un commento