Installazione di oVirt in CentOS: Difference between revisions

From RVM Wiki
Jump to navigation Jump to search
Created page with "=Introduzione= Installeremo in laboratorio un'istanza di oVirt utilizzando solo macchine virtuali, per valutare il prodotto. Verrà utilizzata la Nested Virtualizazion =Amb..."
 
mNo edit summary
 
Line 59: Line 59:


=Configurazione storage NFS=
=Configurazione storage NFS=
La macchina host fungerà inizialmente anche da storage nfs
* Installare nfs:


   yum install -y nfs-utils
   yum install -y nfs-utils


* Creare la directory da condividere, ed assegnarla allo user corretto:
mkdir  /home/ov01-storage
chown vdsm:kvm /home/ov01-storage/
* Definire la risorsa nfs:
vi /etc/exports
/home/ov01-storage      10.11.12.0/24(rw,sync,no_root_squash,no_all_squash)
*Ablitare i servizi necesaari ed avviarli:
<pre>
systemctl enable rpcbind
systemctl enable nfs-server
systemctl enable nfs-lock
systemctl enable nfs-idmap
systemctl start rpcbind
systemctl start nfs-server
systemctl start nfs-lock
systemctl start nfs-idmap
</pre>
* Testare il mount:
mount ovirt-h01.example.priv:/home/ov01-storage/ /mnt
umount /mnt
= Installazione hosted engine=
* Prelevare l'immagine di CentOS 6.6 (la 7 non è supportata)
mkdir /home/tmp && cd /home/tmp
curl -O http://mirrors.kernel.org/centos/6.6/isos/x86_64/CentOS-6.6-x86_64-minimal.iso
chown -R 36:36 /home/tmp
*Avviare una sessione screen, che sarà utile dopo
screen
* Lanciare l'installazione della VM:
hosted-engine --deploy
* Se non diversamente specificato, accettare i defaults:
Please specify the full shared storage connection path to use (example: host:/path): ovirt-h01.example.priv:/home/ov01-storage
Please provide storage domain name. [hosted_storage]: ov01-storage
Please enter local datacenter name [hosted_datacenter]: ovirt_datacenter
Please specify an alias for the Hosted Engine image [hosted_engine]: ovirt-e01
Please specify path to installation media you would like to use [None]: /home/tmp/CentOS-6.6-x86_64-minimal.iso
Enter the name which will be used to identify this host inside the Administrator Portal [hosted_engine_1]: ovirt-e01
Enter 'admin@internal' user password that will be used for accessing the Administrator Portal: secret_password
          Please provide the FQDN for the engine you would like to use.
          This needs to match the FQDN that you will use for the engine installation within the VM.
          Note: This will be the FQDN of the VM you are now going to create,
          it should not point to the base host or to any other existing machine.
          Engine FQDN: ovirt-e01.example.priv
* Terminata la preconfigurazione:
          You can now connect to the VM with the following command:
                /bin/remote-viewer vnc://localhost:5900
          Use temporary password "8214EFGG" to connect to vnc console.
* Dal proprio desktop, collegarsi in vnc alla VM:
vncviewer ovirt-h01.example.priv
* Procedere all'installazione base di centos 6.6
* Mantenere impostata la tastiera Americana
* Utilizzare un'unica partizione
* Al termine dell'installazione, fare reboot (in reatà si spegnerà comunque)
* Tornare al menù su ovirth01, e scegliere:
          (1) Continue setup - VM installation is complete
          (2) Reboot the VM and restart installation
          (3) Abort setup
          (4) Destroy VM and abort setup
          (1, 2, 3, 4) 1
* La macchina verrà riavviata. Collegarsi nuovamente in VNC
vncviewer ovirt-h01.example.priv
* Configurare la tastiera italiana
cd ..
cd etc
cd syconfig
vi keyboard
KEYTABLE="it"
MODEL="pc105"
LAYOUT="it"
KEYBOARDTYPE="pc"
reboot
* riavviare la macchina da ovirt-h01
(2) Power off and restart the VM
* Ricollegarsi in vnc e confgurare correttamente il networking
vi /etc/sysconfig/network-scripts/ifcfg-eth0
   
   
ONBOOT=yes
NM_CONTROLLED=yes
BOOTPROTO=none
IPADDR=10.11.12.102
NETMASK=255.255.255.0
vi /etc/sysconfig/network
GATEWAY=10.11.12.254
poweroff
* Di nuovo 2 e verificare che risponda al ping
ping ovirt-e01.example.priv
* Entrare in ssh ed applicar egli updates
ssh root@ovirt-e01.example.priv
yum update
* Riavviare ancora la macchina con (2) e rientrare in ssh
  ssh root@ovirt-e01.example.priv
* Installare ora il repositori di ovirt nella VM appena aggiornata
yum localinstall -y http://resources.ovirt.org/pub/yum-repo/ovirt-release35.rpm
* Installare il pacchetto dell'engine nella vm:
yum install -y ovirt-engine
* Configurare l'engine sempre nella vm:
engine-setup
* Accetare i default, inserire la stessa password precedente usata e :
Engine admin password: secret_password
Local ISO domain name [ISO_DOMAIN]: OVIRT-E01_ISO
* Al termine testare subito:
https://ovirt-e01.example.priv:443/ovirt-engine
* Tornare ora su ovirt-h01, scegliere
(1) Continue setup - engine installation is complete
* Ora l'host si registrerà con l'engine, e poi lo si visualizzerà nell'interfacia web
=Riferimenti=
=Riferimenti=



Latest revision as of 07:38, 20 May 2015

Introduzione

Installeremo in laboratorio un'istanza di oVirt utilizzando solo macchine virtuali, per valutare il prodotto.

Verrà utilizzata la Nested Virtualizazion

Ambiente di test

  • Si utilizza un notebook con Ubuntu e virt-manager installato e funzionante
  • Creare la macchina ovirt-h01, che sarà il primo host oVirt
  • Assegnare almeno 4 Core, 4GB Ram e 80Gb di hard disk
  • Nelle opzioni del Processor, cliccare
Configuration / Copy host CPU Configuration
  • Si procederà configurando questo host
  • Poi si lancerà la creazione della vera macchina di gestione oVirt (l'Engine) che sarà una virtual machine gestita da oVirt

Installazione Host

  • Installare CentOS 7 x64, utlizzando 1 partizione da 70GB e 4 GB di swap
hostname   ovirt-h01.example.priv
ip address 10.11.12.101
  • Riavviare, e loggarsi in ssh per applicare gli aggiornamenti
ssh-copy-id root@ovirt-h01.example.priv
ssh root@ovirt-h01.example.priv
yum update
  • Disabilitare i servizi non necessari sull'host
systemctl disable firewalld && systemctl stop firewalld
systemctl disable NetworkManager && systemctl stop NetworkManager
  • Assicurarsi che i nomi siano risolvibili:
ping ovirt-h01.example.priv
ping ovirt-e01.example.priv
ping ovirt-s01.example.priv

= Installare pacchetti di supporto

yum install -y screen rsync bzip2 less bash-completion
  • Riavviare
reboot
  • Riloggarsi ed installare il pacchetto dei repository oVirt
ssh root@ovirt-h01.example.priv
yum localinstall -y http://resources.ovirt.org/pub/yum-repo/ovirt-release35.rpm
  • Installare i pacchetti necessari all'host ed alla creazione dell'hosted engine (la VM con l'engine)
 yum install -y ovirt-hosted-engine-setup screen

Configurazione storage NFS

La macchina host fungerà inizialmente anche da storage nfs

  • Installare nfs:
 yum install -y nfs-utils
  • Creare la directory da condividere, ed assegnarla allo user corretto:
mkdir  /home/ov01-storage
chown vdsm:kvm /home/ov01-storage/
  • Definire la risorsa nfs:
vi /etc/exports
/home/ov01-storage      10.11.12.0/24(rw,sync,no_root_squash,no_all_squash)
  • Ablitare i servizi necesaari ed avviarli:
systemctl enable rpcbind
systemctl enable nfs-server
systemctl enable nfs-lock
systemctl enable nfs-idmap
systemctl start rpcbind
systemctl start nfs-server
systemctl start nfs-lock
systemctl start nfs-idmap
  • Testare il mount:
mount ovirt-h01.example.priv:/home/ov01-storage/ /mnt
umount /mnt

Installazione hosted engine

  • Prelevare l'immagine di CentOS 6.6 (la 7 non è supportata)
mkdir /home/tmp && cd /home/tmp
curl -O http://mirrors.kernel.org/centos/6.6/isos/x86_64/CentOS-6.6-x86_64-minimal.iso
chown -R 36:36 /home/tmp
  • Avviare una sessione screen, che sarà utile dopo
screen
  • Lanciare l'installazione della VM:
hosted-engine --deploy
  • Se non diversamente specificato, accettare i defaults:
Please specify the full shared storage connection path to use (example: host:/path): ovirt-h01.example.priv:/home/ov01-storage
Please provide storage domain name. [hosted_storage]: ov01-storage
Please enter local datacenter name [hosted_datacenter]: ovirt_datacenter
Please specify an alias for the Hosted Engine image [hosted_engine]: ovirt-e01
Please specify path to installation media you would like to use [None]: /home/tmp/CentOS-6.6-x86_64-minimal.iso
Enter the name which will be used to identify this host inside the Administrator Portal [hosted_engine_1]: ovirt-e01
Enter 'admin@internal' user password that will be used for accessing the Administrator Portal: secret_password
         Please provide the FQDN for the engine you would like to use.
         This needs to match the FQDN that you will use for the engine installation within the VM.
         Note: This will be the FQDN of the VM you are now going to create,
         it should not point to the base host or to any other existing machine.
         Engine FQDN: ovirt-e01.example.priv
  • Terminata la preconfigurazione:
         You can now connect to the VM with the following command:
               /bin/remote-viewer vnc://localhost:5900
         Use temporary password "8214EFGG" to connect to vnc console.
  • Dal proprio desktop, collegarsi in vnc alla VM:
vncviewer ovirt-h01.example.priv
  • Procedere all'installazione base di centos 6.6
  • Mantenere impostata la tastiera Americana
  • Utilizzare un'unica partizione
  • Al termine dell'installazione, fare reboot (in reatà si spegnerà comunque)
  • Tornare al menù su ovirth01, e scegliere:
         (1) Continue setup - VM installation is complete
         (2) Reboot the VM and restart installation
         (3) Abort setup
         (4) Destroy VM and abort setup
         (1, 2, 3, 4) 1

  • La macchina verrà riavviata. Collegarsi nuovamente in VNC
vncviewer ovirt-h01.example.priv
  • Configurare la tastiera italiana
cd ..
cd etc
cd syconfig
vi keyboard
KEYTABLE="it"
MODEL="pc105"
LAYOUT="it"
KEYBOARDTYPE="pc"
reboot
  • riavviare la macchina da ovirt-h01
(2) Power off and restart the VM
  • Ricollegarsi in vnc e confgurare correttamente il networking
vi /etc/sysconfig/network-scripts/ifcfg-eth0

ONBOOT=yes NM_CONTROLLED=yes BOOTPROTO=none IPADDR=10.11.12.102 NETMASK=255.255.255.0

vi /etc/sysconfig/network

GATEWAY=10.11.12.254

poweroff
  • Di nuovo 2 e verificare che risponda al ping
ping ovirt-e01.example.priv
  • Entrare in ssh ed applicar egli updates
ssh root@ovirt-e01.example.priv
yum update
  • Riavviare ancora la macchina con (2) e rientrare in ssh
 ssh root@ovirt-e01.example.priv 
  • Installare ora il repositori di ovirt nella VM appena aggiornata
yum localinstall -y http://resources.ovirt.org/pub/yum-repo/ovirt-release35.rpm
  • Installare il pacchetto dell'engine nella vm:
yum install -y ovirt-engine
  • Configurare l'engine sempre nella vm:
engine-setup
  • Accetare i default, inserire la stessa password precedente usata e :
Engine admin password: secret_password
Local ISO domain name [ISO_DOMAIN]: OVIRT-E01_ISO
  • Al termine testare subito:
https://ovirt-e01.example.priv:443/ovirt-engine
  • Tornare ora su ovirt-h01, scegliere
(1) Continue setup - engine installation is complete
  • Ora l'host si registrerà con l'engine, e poi lo si visualizzerà nell'interfacia web

Riferimenti