Agilizando la Infraestructura III: oVirt 3.4 con glusterFS

En esta entrada voy a explicar como he instalado un entorno de virtualización basado en oVirt 3.4 y utilizando como almacenamiento compartido volúmenes de glusterFS. oVirt requiere de un nodo de control y varios nodos de computación. La arquitectura viene a ser bastante similar a la que podríamos tener con VMware vSphere. He instalado el motor de gestión en un servidor físico con 2 CPU y 1 GB de RAM. Si bien los requisitos son mucho mayores, para la demo que he preparado va bastante bien aunque le puede llegar a faltar algo de fluidez.

Instalación de oVirt

La instalación, como en todos los productos en los que Red Hat está por detras, se realiza desde un RPM. Se instala primero un rpm que nos configurará los repositorios oficiales de ovirt y a continuación se instala el paquete ovirt-engine:

[root@ovirt ~]# yum install http://plain.resources.ovirt.org/pub/yum-repo/ovirt-release34.rpm
[root@ovirt ~]# yum -y install ovirt-engine

 Una vez instalado se lanza la configuración donde deberemos responder algunas preguntas:

[root@ovirt ~]# engine-setup
[ INFO ] Stage: Initializing
[ INFO ] Stage: Environment setup
Configuration files: [‘/etc/ovirt-engine-setup.conf.d/10-packaging.conf’]
Log file: /var/log/ovirt-engine/setup/ovirt-engine-setup-20140704130518-cgito9.log
Version: otopi-1.2.1 (otopi-1.2.1-1.el6)
[ INFO ] Stage: Environment packages setup
[ INFO ] Yum Downloading: repomdSYOvZitmp.xml (0%)
[ INFO ] Stage: Programs detection
[ INFO ] Stage: Environment setup
[ INFO ] Stage: Environment customization

–== PRODUCT OPTIONS ==–


–== PACKAGES ==–

[ INFO ] Checking for product updates…
[ INFO ] No product updates found

–== NETWORK CONFIGURATION ==–

Host fully qualified DNS name of this server [ovirt.enterprise.com]:
Setup can automatically configure the firewall on this system.
Note: automatic configuration of the firewall may overwrite current settings.
Do you want Setup to configure the firewall? (Yes, No) [Yes]: yes
The following firewall managers were detected on this system: iptables Firewall manager to configure (iptables): iptables
[ INFO ] iptables will be configured as firewall manager.

–== DATABASE CONFIGURATION ==–

Where is the Engine database located? (Local, Remote) [Local]:
Setup can configure the local postgresql server automatically for the engine to run. This may conflict with existing applications.
Would you like Setup to automatically configure postgresql and create Engine database, or prefer to perform that manually? (Automatic, Manual) [Automatic]:

–== OVIRT ENGINE CONFIGURATION ==–

Application mode (Both, Virt, Gluster) [Both]:
Default storage type: (NFS, FC, ISCSI, POSIXFS, GLUSTERFS) [NFS]: GLUSTERFS
Engine admin password:
Confirm engine admin password:
–== PKI CONFIGURATION ==–

Organization name for certificate [enterprise.com]:

–== APACHE CONFIGURATION ==–

Setup can configure apache to use SSL using a certificate issued from the internal CA.
Do you wish Setup to configure that, or prefer to perform that manually? (Automatic, Manual) [Automatic]:
Setup can configure the default page of the web server to present the application home page. This may conflict with existing applications.
Do you wish to set the application as the default page of the web server? (Yes, No) [Yes]:

–== SYSTEM CONFIGURATION ==–

Configure WebSocket Proxy on this machine? (Yes, No) [Yes]:
Configure an NFS share on this server to be used as an ISO Domain? (Yes, No) [Yes]:
Local ISO domain path [/var/lib/exports/iso]:
Local ISO domain ACL [0.0.0.0/0.0.0.0(rw)]:
Local ISO domain name [ISO_DOMAIN]:

–== MISC CONFIGURATION ==–


–== END OF CONFIGURATION ==–

[ INFO ] Stage: Setup validation
–== CONFIGURATION PREVIEW ==–

Engine database name : engine
Engine database secured connection : False
Engine database host : localhost
Engine database user name : engine
Engine database host name validation : False
Engine database port : 5432
NFS setup : True
PKI organization : enterprise.com
Application mode : both
Firewall manager : iptables
Update Firewall : True
Configure WebSocket Proxy : True
Host FQDN : ovirt.enterprise.com
NFS export ACL : 0.0.0.0/0.0.0.0(rw)
NFS mount point : /var/lib/exports/iso
Datacenter storage type : glusterfs
Configure local Engine database : True
Set application as default page : True
Configure Apache SSL : True

Please confirm installation settings (OK, Cancel) [OK]:
[ INFO ] Stage: Transaction setup
[ INFO ] Stopping engine service
[ INFO ] Stopping websocket-proxy service
[ INFO ] Stage: Misc configuration
[ INFO ] Stage: Package installation
[ INFO ] Stage: Misc configuration
[ INFO ] Initializing PostgreSQL
[ INFO ] Creating PostgreSQL ‘engine’ database
[ INFO ] Configuring PostgreSQL
[ INFO ] Creating Engine database schema
[ INFO ] Creating CA
[ INFO ] Configuring WebSocket Proxy
[ INFO ] Generating post install configuration file ‘/etc/ovirt-engine-setup.conf.d/20-setup-ovirt-post.conf’
[ INFO ] Stage: Transaction commit
[ INFO ] Stage: Closing up

–== SUMMARY ==–SSH fingerprint: 83:1F:BB:B9:DC:7B:94:D3:41:38:67:AC:33:E9:58:AE Internal CA 7E:BE:5C:B7:34:DD:E3:EB:2D:44:18:1B:E4:B8:3B:BE:33:BB:99:14 Web access is enabled at:
http://ovirt.enterprise.com:80/ovirt-engine https://ovirt.enterprise.com:443/ovirt-engine
Please use the user «admin» and password specified in order to login

–== END OF SUMMARY ==–

[ INFO ] Starting engine service
[ INFO ] Restarting httpd
[ INFO ] Restarting nfs services
[ INFO ] Stage: Clean up
Log file is located at /var/log/ovirt-engine/setup/ovirt-engine-setup-20140704130518-cgito9.log
[ INFO ] Generating answer file ‘/var/lib/ovirt-engine/setup/answers/20140704131454-setup.conf’
[ INFO ] Stage: Pre-termination
[ INFO ] Stage: Termination


[ INFO ] Execution of setup completed successfully

Con las pocas preguntas que hemos respondido ya nos instala todo lo necesario y nos habilita el acceso a la consola web. También nos ha configurado un repositorio de imágenes ISO que mas adelante mostraré como usar y terminar de configurar.

Interfaz web

Si accedemos a la URL que nos ha devuelto el proceso de configuración veremos que nos ha habilitado varios portales, entre ellos el de administración:

Accedemos al portal y lo primero que haremos será añadir dos hosts al cluster. Para crear los hosts existen dos opciones:

  • utilizar una imagen desde la web de oVirt con la que se instala el sistema operativo y todo lo necesario
  • utilizar un sistema operativo ya preinstalado al que se le instalará el software necesario al agregarlo al cluster.

En mi caso ya disponia de dos servidores instalados con lo que los he añadido al cluster. Previamente he configurado los repositorios de oVirt al igual que hice para instalar el motor. A continuación desde la interfaz web añadomos el host e introduciremos los datos del usuario root para que pueda instalar el software:

En la parte inferior podemos ver los eventos y tareas que se están ejecutando. En el se puede ver que se está ejecutando YUM en los servidores para instalar el software de oVirt.

Almacenamiento

Una vez instalado los nodos sobre los que correrán las máquinas virtuales es necesario la configuración de un almacenamiento compartido. He elegido GlusterFS por las bondades de HA y performance que tiene. GlusterFS lo configuro sobre dos servidores adicionales, aunque bien podría instalarse en los mismos servidores donde van a correr las máquinas virtuales.

La instalacioń es secilla:

[root@storage01 ~]# yum install -y glusterfs glusterfs-fuse glusterfs-server

Una vez instalado se configuran los pares y ya se puede crear un volumen e iniciarlo:

[root@storage01 ~]# gluster peer probe storage02
peer probe: success.[root@storage01 ~]# gluster peer status
Number of Peers: 1

Hostname: storage02
Uuid: 3e4056d0-2ab0-4e83-b273-ceb565b7458c
State: Peer in Cluster (Connected)
[root@storage01 #]# gluster volume create DATA replica 2 transport tcp storage01:/opt/gluster/data storage02:/opt/gluster/data
volume create: DATA: success: please start the volume to access data
[root@storage01 ~]# gluster volume start DATA


volume start: DATA: success  

He creado un volúmen con dos réplicas, de forma que si perdemos una de las dos no habría pérdida de datos. Para poder utilizarlo en oVirt se deben realizar algunas modificaciones:

[root@storage01 ~]# gluster volume set DATA allow-insecure on[root@storage01 ~]# gluster volume set DATA server.allow-insecure on
[root@storage01 ~]# gluster volume set DATA storage.owner-uid=36
[root@storage01 ~]# chown 36:36 /opt/gluster/data
[root@storage01 ~]# gluster volume info

Volume Name: DATA
Type: Replicate
Volume ID: 6361b068-7601-4903-88c4-5cdc50f28236
Status: Started
Number of Bricks: 1 x 2 = 2
Transport-type: tcp
Bricks:
Brick1: storage01:/opt/gluster/data
Brick2: storage02:/opt/gluster/data
Options Reconfigured:
server.allow-insecure: on


storage.owner-uid: 36

También se debe modificar el fichero /etc/glusterfs/glusterd.vol añadiendo la opción rcp-auth-allow-insecure:

[root@storage01 ~]# vi /etc/glusterfs/glusterd.volvolume management
type mgmt/glusterd
option working-directory /var/lib/glusterd
option transport-type socket,rdma
option transport.socket.keepalive-time 10
option transport.socket.keepalive-interval 2
option transport.socket.read-fail-log off
# option base-port 49152
option rpc-auth-allow-insecure on


end-volume

Una vez realizado estos cambios se debe reiniciar el demonio en los nodos:

[root@storage01 ~]# service glusterd restart
Starting glusterd: [ OK ]

Por último, en los Hosts de oVirt es necesario instalar el paquete vdsm-gluster para que puedan montar los volúmenes:

[root@compute01 ~]# sudo yum install vdsm-gluster

Con todo ya configurado se puede crear el dominio de almacenamiento y mapear el volúmen que hemos creado anteriormente:

Ya está todo preparado para poder empezar a crear máquinas virtuales. En la siguiente entrada explicaré como crear el repositorio de imágenes y como integrar oVirt con Foreman.

Publicado por Julián García-Sotoca

Ingeniero de Telecomunicación y administrador de sistemas (GNU/Linux - UNIX). Entusiasta del Software libre y Open Source. Working behind the scenes

2 comentarios sobre “Agilizando la Infraestructura III: oVirt 3.4 con glusterFS

    1. Hola Rafael,
      Pues no lo estoy usando en producción pero pienso que ya está preparado. Piensa que el hypervisor es KVM que ya es muy estable.
      No obstante, dependiendo del entorno, yo tiraría hacia RHEV, que es oVirt con el soporte de Red Hat. Sobre todo para que te asesoren en las buenas practicas para montarlo.

      Saludos,
      Julián

      Me gusta

Deja un comentario