Difference: InstallingAndConfiguringGlance (1 vs. 6)

Revision 62012-10-22 - TWikiAdminUser

Line: 1 to 1
Changed:
<
<
META TOPICPARENT name="GestioneOpenstack"
>
>
META TOPICPARENT name="GestioneServiziGenerali.GestioneOpenstack"
 

Installazione e configurazione del servizio Image (Glance)


Line: 125 to 125
 

-- PaoloVeronesi - 2012-08-30 \ No newline at end of file

Added:
>
>
META TOPICMOVED by="BaseUserMapping_333" date="1350915107" from="GestioneServiziGenerali.InstallingAndConfiguringGlance" to="MarcheCloud.InstallingAndConfiguringGlance"

Revision 52012-10-11 - PaoloVeronesi

Line: 1 to 1
 
META TOPICPARENT name="GestioneOpenstack"

Installazione e configurazione del servizio Image (Glance)

Line: 101 to 101
 
  • You can find the version of the installation by using the glance --version command. The version number 2012.1 corresponds with the Essex release.
  • Obtain a test image
Changed:
<
<
# mkdir /tmp/images # cd /tmp/images/ # wget http://smoser.brickies.net/ubuntu/ttylinux-uec/ttylinux-uec-amd64-12.1_2.6.35-22_1.tar.gz # tar -zxvf ttylinux-uec-amd64-12.1_2.6.35-22_1.tar.gz

# glance -v -d --os_username=$OS_USERNAME --os_password=$OS_PASSWORD --os_tenant=$OS_TENANT_NAME --os_auth_url=$KEYSTONE5000 add name="tty-linux-kernel" disk_format=aki container_format=aki < ttylinux-uec-amd64-12.1_2.6.35-22_1-vmlinuz ==============================================================================================[100%] 8.36M/s, ETA 0h 0m 0s Added new image with ID: 8393828d-b226-434c-b0ea-179674fa4329 Returned the following metadata for the new image: checksum => 3ed2965d3f8d877a3ee3e061fd648e9a container_format => aki created_at => 2012-08-29T14:15:57 deleted => False deleted_at => None disk_format => aki id => 8393828d-b226-434c-b0ea-179674fa4329 is_public => False min_disk => 0 min_ram => 0 name => tty-linux-kernel owner => c10d9c9f296b47f8a1212dd7a98357e0 properties => {} protected => False size => 4404752 status => active updated_at => 2012-08-29T14:15:57 Completed in 0.7154 sec.

# glance -v -d --os_username=$OS_USERNAME --os_password=$OS_PASSWORD --os_tenant=$OS_TENANT_NAME --os_auth_url=$KEYSTONE5000 add name="tty-linux-ramdisk" disk_format=ari container_format=ari < ttylinux-uec-amd64-12.1_2.6.35-22_1-loader ========================================================================================[100%] 934.475402K/s, ETA 0h 0m 0s Added new image with ID: 3db3e2dc-9d2f-40ff-8519-af7d04f8146a Returned the following metadata for the new image: checksum => 644cf7d6d9e7b41d527e30e8e8c685a4 container_format => ari created_at => 2012-08-29T14:28:38 deleted => False deleted_at => None disk_format => ari id => 3db3e2dc-9d2f-40ff-8519-af7d04f8146a is_public => False min_disk => 0 min_ram => 0 name => tty-linux-ramdisk owner => c10d9c9f296b47f8a1212dd7a98357e0 properties => {} protected => False size => 96629 status => active updated_at => 2012-08-29T14:28:39 Completed in 0.4333 sec.

# glance -v -d --os_username=$OS_USERNAME --os_password=$OS_PASSWORD --os_tenant=$OS_TENANT_NAME --os_auth_url=$KEYSTONE5000 add name="tty-linux" disk_format=ami container_format=ami kernel_id=8393828d-b226-434c-b0ea-179674fa4329 ramdisk_id=3db3e2dc-9d2f-40ff-8519-af7d04f8146a < ttylinux-uec-amd64-12.1_2.6.35-22_1.img ==============================================================================================[100%] 59.7M/s, ETA 0h 0m 0s Added new image with ID: df3422c6-58f5-4d3d-8de2-b1b522ab4152 Returned the following metadata for the new image: checksum => 10047a119149e08fb206eea89832eee0 container_format => ami created_at => 2012-08-29T14:32:05 deleted => False deleted_at => None disk_format => ami id => df3422c6-58f5-4d3d-8de2-b1b522ab4152 is_public => False min_disk => 0 min_ram => 0 name => tty-linux owner => c10d9c9f296b47f8a1212dd7a98357e0 properties => {u'kernel_id': u'8393828d-b226-434c-b0ea-179674fa4329', u'ramdisk_id': u'3db3e2dc-9d2f-40ff-8519-af7d04f8146a'} protected => False size => 25165824 status => active updated_at => 2012-08-29T14:32:05 Completed in 0.5622 sec.

>
>
# mkdir /stackimages

# cd /stackimages

# wget https://launchpad.net/cirros/trunk/0.3.0/+download/cirros-0.3.0-x86_64-disk.img

# glance index

# glance add name=cirros-0.3.0-x86_64 disk_format=qcow2 container_format=bare < /stackimages/cirros-0.3.0-x86_64-disk.img Uploading image 'cirros-0.3.0-x86_64' ================================================================================================================================================================================[100%] 23.2M/s, ETA 0h 0m 0s Added new image with ID: a08912a4-3c73-4b17-9d96-bed2d1290d3d

  # glance index ID Name Disk Format Container Format Size
------------------------------ -------------------- -------------------- --------------
Changed:
<
<
df3422c6-58f5-4d3d-8de2-b1b522ab4152 tty-linux ami ami 25165824 3db3e2dc-9d2f-40ff-8519-af7d04f8146a tty-linux-ramdisk ari ari 96629 8393828d-b226-434c-b0ea-179674fa4329 tty-linux-kernel aki aki 4404752
>
>
a08912a4-3c73-4b17-9d96-bed2d1290d3d cirros-0.3.0-x86_64 qcow2 bare 9761280
 

Revision 42012-10-10 - EnricoFattibene

Line: 1 to 1
 
META TOPICPARENT name="GestioneOpenstack"

Installazione e configurazione del servizio Image (Glance)

Line: 28 to 28
  Dove <YOUR_GLANCEDB_PASSWORD> è la password scelta per l'utente "glance" del DB.
Added:
>
>
  • Provare ad accedere a MySQL da locale con l'utente "glance" appena creato tramite il comando myslq -u glance -p digitando la password. Nel caso di accesso negato, accedere a MySQL da root ed eliminare l'utente anonimo con i seguenti comandi:
    mysql> DROP USER ''@'localhost';
    mysql> flush privileges;
    
    Questo problema è dovuto ad un bug di MySQL
 

Editare i file di configurazione di Glance

  • Modificare le seguenti righe nel file /etc/glance/glance-api-paste.ini :

Line: 59 to 66
  Verificare che sql_connection punti al DB MySQL piuttosto che a sqlite:

Changed:
<
<
sql_connection = mysql://glance:@hostname1.domain/glance
>
>
sql_connection = mysql://glance:@localhost/glance
 
Added:
>
>
Nota bene: inserendo esplicitamente l'hostname del serve al posto di localhost sono stati verificati problemi di connessione.
 
  • Modificare le seguenti righe nel file /etc/glance/glance-registry-paste.ini :

Revision 32012-10-10 - EnricoFattibene

Line: 1 to 1
 
META TOPICPARENT name="GestioneOpenstack"

Installazione e configurazione del servizio Image (Glance)

Line: 11 to 11
 # yum install openstack-nova openstack-glance openstack-glance-doc openstack-nova-doc
Deleted:
<
<
Install the Image service, as root: # yum install openstack-nova openstack-glance openstack-glance-doc openstack-nova-doc After installing, you need to delete the sqlite database it creates, then change the configuration to point to the MySQL database. # rm /var/lib/glance/glance.sqlite
 
Changed:
<
<

Configurazione keystone

>
>

Configurazione Glance

 
  • Rimuovere, se esiste, il file /var/lib/glance/glance.db (cioè il DB sqlite). Verrà utilizzato MySQL.
Deleted:
<
<
 
Changed:
<
<

Configuring the Image Service database backend

  • Start the MySQL command line client by running mysql -u root -p. Enter the MySQL root user's password when prompted.
  • To configure the MySQL database, create the glance database: mysql> CREATE DATABASE glance;
  • Create a MySQL user for the newly-created glance database that has full control of the database.
>
>
  • Collegarsi su MySQL da linea di comando lanciando mysql -u root -p e digitando la password dell'utente root.

  • Creare il DB glance:
    mysql> CREATE DATABASE glance;
    

  • Creare l'utente "glance" che ha completo accesso al DB "glance" appena creato.
 
Changed:
<
<
mysql> GRANT ALL ON glance.* TO 'glance'@'%' IDENTIFIED BY '[YOUR_GLANCEDB_PASSWORD]'; Enter quit at the mysql> prompt to exit MySQL. mysql> quit
>
>
mysql> GRANT ALL ON glance.* TO 'glance'@'%' IDENTIFIED BY '';
 
Added:
>
>
Dove <YOUR_GLANCEDB_PASSWORD> è la password scelta per l'utente "glance" del DB.
 
Changed:
<
<

Edit the Glance configuration files and paste ini middleware files

  • Update /etc/glance/glance-api-paste.ini and configure the admin_* values under [filter:authtoken].
>
>

Editare i file di configurazione di Glance

  • Modificare le seguenti righe nel file /etc/glance/glance-api-paste.ini :
 
[filter:authtoken]
admin_tenant_name = service
admin_user = glance
Changed:
<
<
admin_password = XXXXXXX
>
>
admin_password =
 
Added:
>
>
Nota bene:
    • service è il tenant "service" creato durante la configurazione di Keystone
    • glance è l'utente del tenant "service" associato al servizio Glance
    • <GLANCE_PASSWORD> è la password scelta per l'utente "glance" creato nel tenant "service", non la password identificata da <YOUR_GLANCEDB_PASSWORD>
 
Changed:
<
<
  • Add this to the end of /etc/glance/glance-api.conf and restart openstack-glance-api to pick up these changed settings.
>
>
  • Aggiungere le seguenti righe in fondo al file /etc/glance/glance-api.conf :
 
[paste_deploy]
flavor = keystone
Added:
>
>
 
Changed:
<
<
service openstack-glance-api restart
>
>
  • Riavviare il servizio openstack-glance-api per rendere effettive le precedenti modifiche:
    # service openstack-glance-api restart
 
Changed:
<
<
  • Add this to the end of /etc/glance/glance-registry.conf.
>
>
  • Aggiungere le seguenti righe in fondo al file /etc/glance/glance-registry.conf :
 
[paste_deploy]
flavor = keystone
Added:
>
>
Verificare che sql_connection punti al DB MySQL piuttosto che a sqlite:
sql_connection = mysql://glance:<YOUR_GLANCEDB_PASSWORD>@hostname1.domain/glance
 
Changed:
<
<
  • Update /etc/glance/glance-registry-paste.ini, configure the admin_* values under [filter:authtoken]:
>
>
  • Modificare le seguenti righe nel file /etc/glance/glance-registry-paste.ini :
 
[filter:authtoken]
admin_tenant_name = service
admin_user = glance
Changed:
<
<
admin_password = XXXXXXX
>
>
admin_password =
 
Changed:
<
<
  • Ensure that the glance-registry pipeline section includes authtoken:
>
>
Verificare che la sezione pipeline:glance-registry contenga pipeline settato come segue:
 
[pipeline:glance-registry]
Deleted:
<
<
#pipeline = context registryapp # NOTE: use the following pipeline for keystone
 pipeline = authtoken auth-context context registryapp
Changed:
<
<
  • Ensure that /etc/glance/glance-registry.conf points to the MySQL database rather than sqlite.
>
>
  • Riavviare i servizi openstack-glance-registry e openstack-glance-api per rendere effettive le precedenti modifiche:
 
Changed:
<
<
sql_connection = mysql://glance:yourpassword@131.154.101.242/glance
>
>
# service openstack-glance-registry restart # service openstack-glance-api restart
 
Changed:
<
<
  • Restart openstack-glance-registry and openstack-glance-api services, as root:
>
>
  • Infine inizializzare il DB "glance":
 
Changed:
<
<
# service openstack-glance-registry restart # service openstack-glance-api restart
>
>
# glance-manage db_sync
 

  • Now you can populate or migrate the database # glance-manage db_sync

Revision 22012-10-10 - EnricoFattibene

Line: 1 to 1
 
META TOPICPARENT name="GestioneOpenstack"
Changed:
<
<

Installing and Configuring the Image Service (GLANCE)

>
>

Installazione e configurazione del servizio Image (Glance)


Installazione Glance

Server designato per l'installazione: hostname1.domain.

  • Installare Glance tramite il gestore di pacchetti yum :
    # yum install openstack-nova openstack-glance openstack-glance-doc openstack-nova-doc
    
 Install the Image service, as root: # yum install openstack-nova openstack-glance openstack-glance-doc openstack-nova-doc After installing, you need to delete the sqlite database it creates, then change the configuration to point to the MySQL database. # rm /var/lib/glance/glance.sqlite
Changed:
<
<
>
>

Configurazione keystone

  • Rimuovere, se esiste, il file /var/lib/glance/glance.db (cioè il DB sqlite). Verrà utilizzato MySQL.
    
    
 

Configuring the Image Service database backend

  • Start the MySQL command line client by running mysql -u root -p. Enter the MySQL root user's password when prompted.

Revision 12012-08-30 - PaoloVeronesi

Line: 1 to 1
Added:
>
>
META TOPICPARENT name="GestioneOpenstack"

Installing and Configuring the Image Service (GLANCE)

Install the Image service, as root: # yum install openstack-nova openstack-glance openstack-glance-doc openstack-nova-doc After installing, you need to delete the sqlite database it creates, then change the configuration to point to the MySQL database. # rm /var/lib/glance/glance.sqlite

Configuring the Image Service database backend

  • Start the MySQL command line client by running mysql -u root -p. Enter the MySQL root user's password when prompted.
  • To configure the MySQL database, create the glance database: mysql> CREATE DATABASE glance;
  • Create a MySQL user for the newly-created glance database that has full control of the database.
mysql> GRANT ALL ON glance.* TO 'glance'@'%' IDENTIFIED BY '[YOUR_GLANCEDB_PASSWORD]';
Enter quit at the mysql> prompt to exit MySQL.
mysql> quit

Edit the Glance configuration files and paste ini middleware files

  • Update /etc/glance/glance-api-paste.ini and configure the admin_* values under [filter:authtoken].
[filter:authtoken]
admin_tenant_name = service
admin_user = glance
admin_password = XXXXXXX

  • Add this to the end of /etc/glance/glance-api.conf and restart openstack-glance-api to pick up these changed settings.
[paste_deploy]
flavor = keystone


service openstack-glance-api restart

  • Add this to the end of /etc/glance/glance-registry.conf.
[paste_deploy]
flavor = keystone

  • Update /etc/glance/glance-registry-paste.ini, configure the admin_* values under [filter:authtoken]:
[filter:authtoken]
admin_tenant_name = service
admin_user = glance
admin_password = XXXXXXX

  • Ensure that the glance-registry pipeline section includes authtoken:
[pipeline:glance-registry]
#pipeline = context registryapp
# NOTE: use the following pipeline for keystone
pipeline = authtoken auth-context context registryapp

  • Ensure that /etc/glance/glance-registry.conf points to the MySQL database rather than sqlite.
sql_connection = mysql://glance:yourpassword@131.154.101.242/glance

  • Restart openstack-glance-registry and openstack-glance-api services, as root:
# service openstack-glance-registry restart
# service openstack-glance-api restart

  • Now you can populate or migrate the database # glance-manage db_sync

Troubleshooting

  • To begin troubleshooting, look at the logs in the /var/log/glance/registry.log or /var/log/glance/api.log
  • You can find the version of the installation by using the glance --version command. The version number 2012.1 corresponds with the Essex release.
  • Obtain a test image
# mkdir /tmp/images
# cd /tmp/images/
# wget http://smoser.brickies.net/ubuntu/ttylinux-uec/ttylinux-uec-amd64-12.1_2.6.35-22_1.tar.gz
# tar -zxvf ttylinux-uec-amd64-12.1_2.6.35-22_1.tar.gz

# glance -v -d --os_username=$OS_USERNAME --os_password=$OS_PASSWORD --os_tenant=$OS_TENANT_NAME --os_auth_url=$KEYSTONE5000 add name="tty-linux-kernel" disk_format=aki container_format=aki < ttylinux-uec-amd64-12.1_2.6.35-22_1-vmlinuz
==============================================================================================[100%] 8.36M/s, ETA  0h  0m  0s
Added new image with ID: 8393828d-b226-434c-b0ea-179674fa4329
Returned the following metadata for the new image:
                       checksum => 3ed2965d3f8d877a3ee3e061fd648e9a
               container_format => aki
                     created_at => 2012-08-29T14:15:57
                        deleted => False
                     deleted_at => None
                    disk_format => aki
                             id => 8393828d-b226-434c-b0ea-179674fa4329
                      is_public => False
                       min_disk => 0
                        min_ram => 0
                           name => tty-linux-kernel
                          owner => c10d9c9f296b47f8a1212dd7a98357e0
                     properties => {}
                      protected => False
                           size => 4404752
                         status => active
                     updated_at => 2012-08-29T14:15:57
Completed in 0.7154 sec.

# glance -v -d --os_username=$OS_USERNAME --os_password=$OS_PASSWORD --os_tenant=$OS_TENANT_NAME --os_auth_url=$KEYSTONE5000 add name="tty-linux-ramdisk" disk_format=ari container_format=ari < ttylinux-uec-amd64-12.1_2.6.35-22_1-loader
========================================================================================[100%] 934.475402K/s, ETA  0h  0m  0s
Added new image with ID: 3db3e2dc-9d2f-40ff-8519-af7d04f8146a
Returned the following metadata for the new image:
                       checksum => 644cf7d6d9e7b41d527e30e8e8c685a4
               container_format => ari
                     created_at => 2012-08-29T14:28:38
                        deleted => False
                     deleted_at => None
                    disk_format => ari
                             id => 3db3e2dc-9d2f-40ff-8519-af7d04f8146a
                      is_public => False
                       min_disk => 0
                        min_ram => 0
                           name => tty-linux-ramdisk
                          owner => c10d9c9f296b47f8a1212dd7a98357e0
                     properties => {}
                      protected => False
                           size => 96629
                         status => active
                     updated_at => 2012-08-29T14:28:39
Completed in 0.4333 sec.

# glance -v -d --os_username=$OS_USERNAME --os_password=$OS_PASSWORD --os_tenant=$OS_TENANT_NAME --os_auth_url=$KEYSTONE5000 add name="tty-linux" disk_format=ami container_format=ami kernel_id=8393828d-b226-434c-b0ea-179674fa4329 ramdisk_id=3db3e2dc-9d2f-40ff-8519-af7d04f8146a < ttylinux-uec-amd64-12.1_2.6.35-22_1.img
==============================================================================================[100%] 59.7M/s, ETA  0h  0m  0s
Added new image with ID: df3422c6-58f5-4d3d-8de2-b1b522ab4152
Returned the following metadata for the new image:
                       checksum => 10047a119149e08fb206eea89832eee0
               container_format => ami
                     created_at => 2012-08-29T14:32:05
                        deleted => False
                     deleted_at => None
                    disk_format => ami
                             id => df3422c6-58f5-4d3d-8de2-b1b522ab4152
                      is_public => False
                       min_disk => 0
                        min_ram => 0
                           name => tty-linux
                          owner => c10d9c9f296b47f8a1212dd7a98357e0
                     properties => {u'kernel_id': u'8393828d-b226-434c-b0ea-179674fa4329', u'ramdisk_id': u'3db3e2dc-9d2f-40ff-8519-af7d04f8146a'}
                      protected => False
                           size => 25165824
                         status => active
                     updated_at => 2012-08-29T14:32:05
Completed in 0.5622 sec.

# glance index
ID                                   Name                           Disk Format          Container Format     Size
------------------------------------ ------------------------------ -------------------- -------------------- --------------
df3422c6-58f5-4d3d-8de2-b1b522ab4152 tty-linux                      ami                  ami                        25165824
3db3e2dc-9d2f-40ff-8519-af7d04f8146a tty-linux-ramdisk              ari                  ari                           96629
8393828d-b226-434c-b0ea-179674fa4329 tty-linux-kernel               aki                  aki                         4404752

-- PaoloVeronesi - 2012-08-30

 
This site is powered by the TWiki collaboration platformCopyright © 2008-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback