OpenStack Mitaka - LXC

Instalación y configuración de OpenStack Mitaka sobre LXC en Ubuntu 14.04

Glance

Creamos la base de datos de "glance" y otorgamos los permisos necesarios.

      root@nova-controller:~# mysql -u root -p
      MariaDB [(none)]> CREATE DATABASE glance;
      MariaDB [(none)]> GRANT ALL PRIVILEGES ON glance.* TO 'glance'@'localhost' IDENTIFIED BY 'GLANCE_DBPASS';
      MariaDB [(none)]> GRANT ALL PRIVILEGES ON glance.* TO 'glance'@'%' IDENTIFIED BY 'GLANCE_DBPASS';
    
Cargamos las credenciales del usuario Admin.
      root@client:~$ source admin-openrc      
    
Creamos el usuario "glance", lo añadimos al rol "admin" y al projecto "service".
      root@client:~$ openstack user create --domain default --password-prompt glance
      root@client:~$ openstack role add --project service --user glance admin
    
Creamos la entidad de servicio para glance.
      root@client:~$ openstack service create --name glance --description "OpenStack Image" image
    
Creamos los endpoints para la API de glance.
      root@client:~$ openstack endpoint create --region RegionOne image public http://GLANCE_IP:9292
      root@client:~$ openstack endpoint create --region RegionOne image internal http://GLANCE_IP:9292
      root@client:~$ openstack endpoint create --region RegionOne image admin http://GLANCE_IP:9292
    
Accedemos al contenedor de glance e instalamos los paquetes necesarios.
      root@glance:~# apt install glance python-memcache
    
Editamos el fichero /etc/glance/glance-api.conf y añadimos las siguientes líneas.
      root@glance:~# emacs /etc/glance/glance-api.conf
      ...
      [database]
      connection = mysql+pymysql://glance:GLANCE_DBPASS@NOVA_CONTROLLER_INTERNAL_IP/glance
      ...
      keystone_authtoken]
      ...
      auth_uri = http://KEYSTONE_INTERNAL_IP:5000
      auth_url = http://KEYSTONE_INTERNAL_IP:35357
      memcached_servers = NOVA_CONTROLLER_INTERNAL_IP:11211
      auth_type = password
      project_domain_name = default
      user_domain_name = default
      project_name = service
      username = glance
      password = GLANCE_PASS
      ...
      [paste_deploy]
      ...
      flavor = keystone
      ...
      [glance_store]
      stores = file,http
      default_store = file
      filesystem_store_datadir = /var/lib/glance/images/
    
Editamos el fichero /etc/glance/glance-registry.conf y añadimos las siguientes líneas.
      root@glance:~# emacs /etc/glance/glance-registry.conf
      ...
      [database]
      ...
      connection = mysql+pymysql://glance:GLANCE_DBPASS@NOVA_CONTROLLER_INTERNAL_IP/glance
      ...
      [keystone_authtoken]
      ...
      auth_uri = http://KEYSTONE_INTERNAL_IP:5000
      auth_url = http://KEYSTONE_INTERNAL_IP:35357
      memcached_servers = NOVA_CONTROLLER_INTERNAL_IP:11211
      auth_type = password
      project_domain_name = default
      user_domain_name = default
      project_name = service
      username = glance
      password = GLANCE_PASS
      ...
      [paste_deploy]
      flavor = keystone
    
Poblamos la base de datos de Glance.
      root@glance:~# su -s /bin/sh -c "glance-manage db_sync" glance
    
Reiniciamos los servicios de glance.
      root@glance:~# service glance-registry restart
      root@glance:~# service glance-api restart