[install] Liberty updates for glance

Update glance configuration for Liberty and address some
consistency issues.

Changes and testing specific to distribution packages
primarily involve Ubuntu. Other distributions may require
additional patches.

Change-Id: I6c9696b28fe42f00b8a3f9d7344a9807b74accfb
Implements: blueprint installguide-liberty
This commit is contained in:
Matthew Kassawara 2015-09-30 17:37:43 -06:00
parent 046de3d84b
commit b46b1a5689
7 changed files with 286 additions and 277 deletions

View File

@ -33,7 +33,7 @@ This section describes how to verify operation of the Telemetry module.
.. code-block:: console
$ IMAGE_ID=$(glance image-list | grep 'cirros-0.3.4-x86_64' | awk '{ print $2 }')
$ IMAGE_ID=$(glance image-list | grep 'cirros' | awk '{ print $2 }')
$ glance image-download $IMAGE_ID > /tmp/cirros.img
#. List available meters again to validate detection of the image

View File

@ -1,54 +1,45 @@
=====================
Install and configure
=====================
~~~~~~~~~~~~~~~~~~~~~
This section describes how to install and configure the Image service,
code-named glance, on the controller node. For simplicity, this
configuration stores images on the local file system.
.. note::
This section assumes proper installation, configuration, and
operation of the Identity service as described in the
":doc:`keystone-install`" section and the ":doc:`keystone-verify`"
section as well as setup of the :file:`admin-openrc.sh` script
as described in the ":doc:`keystone-openrc`" section.
.. only:: obs or rdo or ubuntu
To configure prerequisites
~~~~~~~~~~~~~~~~~~~~~~~~~~
Prerequisites
-------------
Before you install and configure the Image service, you must
create a database, service credentials, and API endpoint.
create a database, service credentials, and API endpoints.
#. To create the database, complete these steps:
a. Use the database access client to connect to the database
server as the ``root`` user:
* Use the database access client to connect to the database
server as the ``root`` user:
.. code-block:: console
.. code-block:: console
$ mysql -u root -p
$ mysql -u root -p
b. Create the ``glance`` database:
* Create the ``glance`` database:
.. code-block:: console
.. code-block:: console
CREATE DATABASE glance;
CREATE DATABASE glance;
c. Grant proper access to the ``glance`` database:
* Grant proper access to the ``glance`` database:
.. code-block:: console
.. code-block:: console
GRANT ALL PRIVILEGES ON glance.* TO 'glance'@'localhost' \
IDENTIFIED BY 'GLANCE_DBPASS';
GRANT ALL PRIVILEGES ON glance.* TO 'glance'@'%' \
IDENTIFIED BY 'GLANCE_DBPASS';
GRANT ALL PRIVILEGES ON glance.* TO 'glance'@'localhost' \
IDENTIFIED BY 'GLANCE_DBPASS';
GRANT ALL PRIVILEGES ON glance.* TO 'glance'@'%' \
IDENTIFIED BY 'GLANCE_DBPASS';
Replace ``GLANCE_DBPASS`` with a suitable password.
Replace ``GLANCE_DBPASS`` with a suitable password.
d. Exit the database access client.
* Exit the database access client.
#. Source the ``admin`` credentials to gain access to
admin-only CLI commands:
@ -59,77 +50,103 @@ configuration stores images on the local file system.
#. To create the service credentials, complete these steps:
a. Create the ``glance`` user:
* Create the ``glance`` user:
.. code-block:: console
.. code-block:: console
$ openstack user create --password-prompt glance
User Password:
Repeat User Password:
+----------+----------------------------------+
| Field | Value |
+----------+----------------------------------+
| email | None |
| enabled | True |
| id | 1dc206e084334db2bee88363745da014 |
| name | glance |
| username | glance |
+----------+----------------------------------+
$ openstack user create --password-prompt glance
User Password:
Repeat User Password:
+-----------+----------------------------------+
| Field | Value |
+-----------+----------------------------------+
| domain_id | default |
| enabled | True |
| id | e38230eeff474607805b596c91fa15d9 |
| name | glance |
+-----------+----------------------------------+
b. Add the ``admin`` role to the ``glance`` user and
``service`` project:
* Add the ``admin`` role to the ``glance`` user and
``service`` project:
.. code-block:: console
.. code-block:: console
$ openstack role add --project service --user glance admin
+-------+----------------------------------+
| Field | Value |
+-------+----------------------------------+
| id | cd2cb9a39e874ea69e5d4b896eb16128 |
| name | admin |
+-------+----------------------------------+
$ openstack role add --project service --user glance admin
c. Create the ``glance`` service entity:
.. note::
.. code-block:: console
This command provides no output.
$ openstack service create --name glance \
--description "OpenStack Image service" image
+-------------+----------------------------------+
| Field | Value |
+-------------+----------------------------------+
| description | OpenStack Image service |
| enabled | True |
| id | 178124d6081c441b80d79972614149c6 |
| name | glance |
| type | image |
+-------------+----------------------------------+
* Create the ``glance`` service entity:
#. Create the Image service API endpoint:
.. code-block:: console
$ openstack service create --name glance \
--description "OpenStack Image service" image
+-------------+----------------------------------+
| Field | Value |
+-------------+----------------------------------+
| description | OpenStack Image service |
| enabled | True |
| id | 8c2c7f1b9b5049ea9e63757b5533e6d2 |
| name | glance |
| type | image |
+-------------+----------------------------------+
#. Create the Image service API endpoints:
.. code-block:: console
$ openstack endpoint create \
--publicurl http://controller:9292 \
--internalurl http://controller:9292 \
--adminurl http://controller:9292 \
--region RegionOne \
image
$ openstack endpoint create --region RegionOne \
image public http://controller:9292
+--------------+----------------------------------+
| Field | Value |
+--------------+----------------------------------+
| adminurl | http://controller:9292 |
| id | 805b1dbc90ab47479111102bc6423313 |
| internalurl | http://controller:9292 |
| publicurl | http://controller:9292 |
| enabled | True |
| id | 340be3625e9b4239a6415d034e98aace |
| interface | public |
| region | RegionOne |
| service_id | 178124d6081c441b80d79972614149c6 |
| region_id | RegionOne |
| service_id | 8c2c7f1b9b5049ea9e63757b5533e6d2 |
| service_name | glance |
| service_type | image |
| url | http://controller:9292 |
+--------------+----------------------------------+
To install and configure the Image service components
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
$ openstack endpoint create --region RegionOne \
image internal http://controller:9292
+--------------+----------------------------------+
| Field | Value |
+--------------+----------------------------------+
| enabled | True |
| id | a6e4b153c2ae4c919eccfdbb7dceb5d2 |
| interface | internal |
| region | RegionOne |
| region_id | RegionOne |
| service_id | 8c2c7f1b9b5049ea9e63757b5533e6d2 |
| service_name | glance |
| service_type | image |
| url | http://controller:9292 |
+--------------+----------------------------------+
$ openstack endpoint create --region RegionOne \
image admin http://controller:9292
+--------------+----------------------------------+
| Field | Value |
+--------------+----------------------------------+
| enabled | True |
| id | 0c37ed58103f4300a84ff125a539032d |
| interface | admin |
| region | RegionOne |
| region_id | RegionOne |
| service_id | 8c2c7f1b9b5049ea9e63757b5533e6d2 |
| service_name | glance |
| service_type | image |
| url | http://controller:9292 |
+--------------+----------------------------------+
Install and configure components
--------------------------------
.. only:: obs or rdo or ubuntu
@ -164,152 +181,143 @@ To install and configure the Image service components
.. only:: obs or rdo or ubuntu
2. Edit the :file:`/etc/glance/glance-api.conf` file and complete
2. Edit the ``/etc/glance/glance-api.conf`` file and complete
the following actions:
a. In the ``[database]`` section, configure database access:
* In the ``[database]`` section, configure database access:
.. code-block:: ini
:linenos:
.. code-block:: ini
[database]
...
connection = mysql+pymysql://glance:GLANCE_DBPASS@controller/glance
[database]
...
connection = mysql+pymysql://glance:GLANCE_DBPASS@controller/glance
Replace ``GLANCE_DBPASS`` with the password you chose for the
Image service database.
Replace ``GLANCE_DBPASS`` with the password you chose for the
Image service database.
b. In the ``[keystone_authtoken]`` and ``[paste_deploy]`` sections,
configure Identity service access:
* In the ``[keystone_authtoken]`` and ``[paste_deploy]`` sections,
configure Identity service access:
.. code-block:: ini
:linenos:
.. code-block:: ini
[keystone_authtoken]
...
auth_uri = http://controller:5000
auth_url = http://controller:35357
auth_plugin = password
project_domain_id = default
user_domain_id = default
project_name = service
username = glance
password = GLANCE_PASS
[keystone_authtoken]
...
auth_uri = http://controller:5000
auth_url = http://controller:35357
auth_plugin = password
project_domain_id = default
user_domain_id = default
project_name = service
username = glance
password = GLANCE_PASS
[paste_deploy]
...
flavor = keystone
[paste_deploy]
...
flavor = keystone
Replace ``GLANCE_PASS`` with the password you chose for the
``glance`` user in the Identity service.
Replace ``GLANCE_PASS`` with the password you chose for the
``glance`` user in the Identity service.
.. note::
.. note::
Comment out or remove any other options in the
``[keystone_authtoken]`` section.
Comment out or remove any other options in the
``[keystone_authtoken]`` section.
c. In the ``[glance_store]`` section, configure the local file
system store and location of image files:
* In the ``[glance_store]`` section, configure the local file
system store and location of image files:
.. code-block:: ini
:linenos:
.. code-block:: ini
[glance_store]
...
default_store = file
filesystem_store_datadir = /var/lib/glance/images/
[glance_store]
...
default_store = file
filesystem_store_datadir = /var/lib/glance/images/
d. In the ``[DEFAULT]`` section, configure the ``noop``
notification driver to disable notifications because
they only pertain to the optional Telemetry service:
* In the ``[DEFAULT]`` section, configure the ``noop``
notification driver to disable notifications because
they only pertain to the optional Telemetry service:
.. code-block:: ini
:linenos:
.. code-block:: ini
[DEFAULT]
...
notification_driver = noop
[DEFAULT]
...
notification_driver = noop
The Telemetry chapter provides an Image service configuration
that enables notifications.
The Telemetry chapter provides an Image service configuration
that enables notifications.
e. (Optional) To assist with troubleshooting,
enable verbose logging in the ``[DEFAULT]`` section:
* (Optional) To assist with troubleshooting,
enable verbose logging in the ``[DEFAULT]`` section:
.. code-block:: ini
:linenos:
.. code-block:: ini
[DEFAULT]
...
verbose = True
[DEFAULT]
...
verbose = True
3. Edit the :file:`/etc/glance/glance-registry.conf` file and
3. Edit the ``/etc/glance/glance-registry.conf`` file and
complete the following actions:
a. In the ``[database]`` section, configure database access:
* In the ``[database]`` section, configure database access:
.. code-block:: ini
:linenos:
.. code-block:: ini
[database]
...
connection = mysql+pymysql://glance:GLANCE_DBPASS@controller/glance
[database]
...
connection = mysql+pymysql://glance:GLANCE_DBPASS@controller/glance
Replace ``GLANCE_DBPASS`` with the password you chose for the
Image service database.
Replace ``GLANCE_DBPASS`` with the password you chose for the
Image service database.
b. In the ``[keystone_authtoken]`` and ``[paste_deploy]`` sections,
configure Identity service access:
* In the ``[keystone_authtoken]`` and ``[paste_deploy]`` sections,
configure Identity service access:
.. code-block:: ini
:linenos:
.. code-block:: ini
[keystone_authtoken]
...
auth_uri = http://controller:5000
auth_url = http://controller:35357
auth_plugin = password
project_domain_id = default
user_domain_id = default
project_name = service
username = glance
password = GLANCE_PASS
[keystone_authtoken]
...
auth_uri = http://controller:5000
auth_url = http://controller:35357
auth_plugin = password
project_domain_id = default
user_domain_id = default
project_name = service
username = glance
password = GLANCE_PASS
[paste_deploy]
...
flavor = keystone
[paste_deploy]
...
flavor = keystone
Replace ``GLANCE_PASS`` with the password you chose for the
``glance`` user in the Identity service.
Replace ``GLANCE_PASS`` with the password you chose for the
``glance`` user in the Identity service.
.. note::
.. note::
Comment out or remove any other options in the
``[keystone_authtoken]`` section.
Comment out or remove any other options in the
``[keystone_authtoken]`` section.
c. In the ``[DEFAULT]`` section, configure the ``noop`` notification
driver to disable notifications because they only pertain to the
optional Telemetry service:
* In the ``[DEFAULT]`` section, configure the ``noop`` notification
driver to disable notifications because they only pertain to the
optional Telemetry service:
.. code-block:: ini
:linenos:
.. code-block:: ini
[DEFAULT]
...
notification_driver = noop
[DEFAULT]
...
notification_driver = noop
The Telemetry chapter provides an Image service configuration
that enables notifications.
The Telemetry chapter provides an Image service configuration
that enables notifications.
d. (Optional) To assist with troubleshooting,
enable verbose logging in the ``[DEFAULT]`` section:
* (Optional) To assist with troubleshooting,
enable verbose logging in the ``[DEFAULT]`` section:
.. code-block:: ini
:linenos:
.. code-block:: ini
[DEFAULT]
...
verbose = True
[DEFAULT]
...
verbose = True
.. only:: rdo or ubuntu
@ -339,8 +347,8 @@ To install and configure the Image service components
.. image:: figures/debconf-screenshots/glance-common_pipeline_flavor.png
:width: 100%
To finalize installation
------------------------
Finalize installation
---------------------
.. only:: obs or rdo
@ -349,8 +357,10 @@ To finalize installation
.. code-block:: console
# systemctl enable openstack-glance-api.service openstack-glance-registry.service
# systemctl start openstack-glance-api.service openstack-glance-registry.service
# systemctl enable openstack-glance-api.service \
openstack-glance-registry.service
# systemctl start openstack-glance-api.service \
openstack-glance-registry.service
.. only:: ubuntu or debian

View File

@ -1,6 +1,5 @@
================
Verify operation
================
~~~~~~~~~~~~~~~~
Verify operation of the Image service using
`CirrOS <http://launchpad.net/cirros>`__, a small
@ -40,7 +39,7 @@ For information about how to manage images, see the
.. code-block:: console
$ glance image-create --name "cirros-0.3.4-x86_64" \
$ glance image-create --name "cirros" \
--file cirros-0.3.4-x86_64-disk.img \
--disk-format qcow2 --container-format bare \
--visibility public --progress
@ -55,7 +54,7 @@ For information about how to manage images, see the
| id | 38047887-61a7-41ea-9b49-27987d5e8bb9 |
| min_disk | 0 |
| min_ram | 0 |
| name | cirros-0.3.4-x86_64 |
| name | cirros |
| owner | ae7a98326b9c455588edd2656d723b9d |
| protected | False |
| size | 13200896 |
@ -87,8 +86,8 @@ For information about how to manage images, see the
.. code-block:: console
$ glance image-list
+--------------------------------------+---------------------+
| ID | Name |
+--------------------------------------+---------------------+
| 38047887-61a7-41ea-9b49-27987d5e8bb9 | cirros-0.3.4-x86_64 |
+--------------------------------------+---------------------+
+--------------------------------------+--------+
| ID | Name |
+--------------------------------------+--------+
| 38047887-61a7-41ea-9b49-27987d5e8bb9 | cirros |
+--------------------------------------+--------+

View File

@ -55,7 +55,7 @@ module (heat).
$ NET_ID=$(nova net-list | awk '/ demo-net / { print $2 }')
$ heat stack-create -f test-stack.yml \
-P "ImageID=cirros-0.3.4-x86_64;NetID=$NET_ID" testStack
-P "ImageID=cirros;NetID=$NET_ID" testStack
+--------------------------------------+------------+--------------------+----------------------+
| id | stack_name | stack_status | creation_time |
+--------------------------------------+------------+--------------------+----------------------+

View File

@ -38,13 +38,13 @@ name, network, security group, key, and instance name.
.. code-block:: console
$ nova image-list
+--------------------------------------+---------------------+--------+--------+
| ID | Name | Status | Server |
+--------------------------------------+---------------------+--------+--------+
| acafc7c0-40aa-4026-9673-b879898e1fc2 | cirros-0.3.4-x86_64 | ACTIVE | |
+--------------------------------------+---------------------+--------+--------+
+--------------------------------------+--------+--------+--------+
| ID | Name | Status | Server |
+--------------------------------------+--------+--------+--------+
| 38047887-61a7-41ea-9b49-27987d5e8bb9 | cirros | ACTIVE | |
+--------------------------------------+--------+--------+--------+
This instance uses the ``cirros-0.3.4-x86_64`` image.
This instance uses the ``cirros`` image.
#. List available networks:
@ -80,38 +80,38 @@ name, network, security group, key, and instance name.
.. code-block:: console
$ nova boot --flavor m1.tiny --image cirros-0.3.4-x86_64 --nic net-id=PRIVATE_NET_ID \
$ nova boot --flavor m1.tiny --image cirros --nic net-id=PRIVATE_NET_ID \
--security-group default --key-name mykey private-instance
+--------------------------------------+------------------------------------------------------------+
| Property | Value |
+--------------------------------------+------------------------------------------------------------+
| OS-DCF:diskConfig | MANUAL |
| OS-EXT-AZ:availability_zone | nova |
| OS-EXT-STS:power_state | 0 |
| OS-EXT-STS:task_state | scheduling |
| OS-EXT-STS:vm_state | building |
| OS-SRV-USG:launched_at | - |
| OS-SRV-USG:terminated_at | - |
| accessIPv4 | |
| accessIPv6 | |
| adminPass | oMeLMk9zVGpk |
| config_drive | |
| created | 2015-09-17T22:36:05Z |
| flavor | m1.tiny (1) |
| hostId | |
| id | 113c5892-e58e-4093-88c7-e33f502eaaa4 |
| image | cirros-0.3.4-x86_64 (939ad102-c74e-405d-a957-2798071d0a7c) |
| key_name | mykey |
| metadata | {} |
| name | private-instance |
| os-extended-volumes:volumes_attached | [] |
| progress | 0 |
| security_groups | default |
| status | BUILD |
| tenant_id | f5b2ccaa75ac413591f12fcaa096aa5c |
| updated | 2015-09-17T22:36:05Z |
| user_id | 684286a9079845359882afc3aa5011fb |
+--------------------------------------+------------------------------------------------------------+
+--------------------------------------+-----------------------------------------------+
| Property | Value |
+--------------------------------------+-----------------------------------------------+
| OS-DCF:diskConfig | MANUAL |
| OS-EXT-AZ:availability_zone | nova |
| OS-EXT-STS:power_state | 0 |
| OS-EXT-STS:task_state | scheduling |
| OS-EXT-STS:vm_state | building |
| OS-SRV-USG:launched_at | - |
| OS-SRV-USG:terminated_at | - |
| accessIPv4 | |
| accessIPv6 | |
| adminPass | oMeLMk9zVGpk |
| config_drive | |
| created | 2015-09-17T22:36:05Z |
| flavor | m1.tiny (1) |
| hostId | |
| id | 113c5892-e58e-4093-88c7-e33f502eaaa4 |
| image | cirros (38047887-61a7-41ea-9b49-27987d5e8bb9) |
| key_name | mykey |
| metadata | {} |
| name | private-instance |
| os-extended-volumes:volumes_attached | [] |
| progress | 0 |
| security_groups | default |
| status | BUILD |
| tenant_id | f5b2ccaa75ac413591f12fcaa096aa5c |
| updated | 2015-09-17T22:36:05Z |
| user_id | 684286a9079845359882afc3aa5011fb |
+--------------------------------------+-----------------------------------------------+
6. Check the status of your instance:

View File

@ -38,13 +38,13 @@ name, network, security group, key, and instance name.
.. code-block:: console
$ nova image-list
+--------------------------------------+---------------------+--------+--------+
| ID | Name | Status | Server |
+--------------------------------------+---------------------+--------+--------+
| acafc7c0-40aa-4026-9673-b879898e1fc2 | cirros-0.3.4-x86_64 | ACTIVE | |
+--------------------------------------+---------------------+--------+--------+
+--------------------------------------+--------+--------+--------+
| ID | Name | Status | Server |
+--------------------------------------+--------+--------+--------+
| 38047887-61a7-41ea-9b49-27987d5e8bb9 | cirros | ACTIVE | |
+--------------------------------------+--------+--------+--------+
This instance uses the ``cirros-0.3.4-x86_64`` image.
This instance uses the ``cirros`` image.
#. List available networks:
@ -92,38 +92,38 @@ Launch the instance
.. code-block:: console
$ nova boot --flavor m1.tiny --image cirros-0.3.4-x86_64 --nic net-id=PUBLIC_NET_ID \
$ nova boot --flavor m1.tiny --image cirros --nic net-id=PUBLIC_NET_ID \
--security-group default --key-name mykey public-instance
+--------------------------------------+------------------------------------------------------------+
| Property | Value |
+--------------------------------------+------------------------------------------------------------+
| OS-DCF:diskConfig | MANUAL |
| OS-EXT-AZ:availability_zone | nova |
| OS-EXT-STS:power_state | 0 |
| OS-EXT-STS:task_state | scheduling |
| OS-EXT-STS:vm_state | building |
| OS-SRV-USG:launched_at | - |
| OS-SRV-USG:terminated_at | - |
| accessIPv4 | |
| accessIPv6 | |
| adminPass | hdF4LMQqC5PB |
| config_drive | |
| created | 2015-09-17T21:58:18Z |
| flavor | m1.tiny (1) |
| hostId | |
| id | 181c52ba-aebc-4c32-a97d-2e8e82e4eaaf |
| image | cirros-0.3.4-x86_64 (939ad102-c74e-405d-a957-2798071d0a7c) |
| key_name | key |
| metadata | {} |
| name | public-instance |
| os-extended-volumes:volumes_attached | [] |
| progress | 0 |
| security_groups | default |
| status | BUILD |
| tenant_id | f5b2ccaa75ac413591f12fcaa096aa5c |
| updated | 2015-09-17T21:58:18Z |
| user_id | 684286a9079845359882afc3aa5011fb |
+--------------------------------------+------------------------------------------------------------+
+--------------------------------------+-----------------------------------------------+
| Property | Value |
+--------------------------------------+-----------------------------------------------+
| OS-DCF:diskConfig | MANUAL |
| OS-EXT-AZ:availability_zone | nova |
| OS-EXT-STS:power_state | 0 |
| OS-EXT-STS:task_state | scheduling |
| OS-EXT-STS:vm_state | building |
| OS-SRV-USG:launched_at | - |
| OS-SRV-USG:terminated_at | - |
| accessIPv4 | |
| accessIPv6 | |
| adminPass | hdF4LMQqC5PB |
| config_drive | |
| created | 2015-09-17T21:58:18Z |
| flavor | m1.tiny (1) |
| hostId | |
| id | 181c52ba-aebc-4c32-a97d-2e8e82e4eaaf |
| image | cirros (38047887-61a7-41ea-9b49-27987d5e8bb9) |
| key_name | key |
| metadata | {} |
| name | public-instance |
| os-extended-volumes:volumes_attached | [] |
| progress | 0 |
| security_groups | default |
| status | BUILD |
| tenant_id | f5b2ccaa75ac413591f12fcaa096aa5c |
| updated | 2015-09-17T21:58:18Z |
| user_id | 684286a9079845359882afc3aa5011fb |
+--------------------------------------+-----------------------------------------------+
#. Check the status of your instance:

View File

@ -136,8 +136,8 @@ Verify operation of the Compute service.
.. code-block:: console
$ nova image-list
+--------------------------------------+---------------------+--------+--------+
| ID | Name | Status | Server |
+--------------------------------------+---------------------+--------+--------+
| 38047887-61a7-41ea-9b49-27987d5e8bb9 | cirros-0.3.4-x86_64 | ACTIVE | |
+--------------------------------------+---------------------+--------+--------+
+--------------------------------------+--------+--------+--------+
| ID | Name | Status | Server |
+--------------------------------------+--------+--------+--------+
| 38047887-61a7-41ea-9b49-27987d5e8bb9 | cirros | ACTIVE | |
+--------------------------------------+--------+--------+--------+