Rate This Document
Findability
Accuracy
Completeness
Readability

Installing and Configuring Glance

Perform the following operations on the controller node.

  1. Install Glance.
    1
    yum -y install openstack-glance
    
  2. Modify the /etc/glance/glance-api.conf file.
    1. Open the file.
      vi /etc/glance/glance-api.conf
    2. Press i to enter the insert mode and perform the following configurations.
      1. Under [database], configure database access.
        1
        2
        [database]
        connection = mysql+pymysql://glance:PASSWORD@controller/glance
        

        Replace PASSWORD with the password for the glance user to access the database described in Creating the Glance Database.

      2. Configure Identity service access under [keystone_authtoken] and [paste_deploy].
         1
         2
         3
         4
         5
         6
         7
         8
         9
        10
        11
        12
        13
        [keystone_authtoken] 
        www_authenticate_uri  = http://controller:5000 
        auth_url = http://controller:5000 
        memcached_servers = controller:11211 
        auth_type = password 
        project_domain_name = Default 
        user_domain_name = Default 
        project_name = service 
        username = glance 
        password = PASSWORD 
        
        [paste_deploy] 
        flavor = keystone
        

        Replace PASSWORD with the password for the glance user to access the database described in Creating the Glance Database.

      3. Under the [glance_store] field, configure the local file system storage and the location where image files are stored.
        1
        2
        3
        4
        [glance_store] 
        stores = file,http 
        default_store = file 
        filesystem_store_datadir = /var/lib/glance/images/
        
    3. Press Esc, type :wq!, and press Enter to save the file and exit.
  3. Modify the /etc/glance/glance-registry.conf file.
    1. Open the file.
      vi /etc/glance/glance-registry.conf
    2. Press i to enter the insert mode and perform the following configurations.
      1. Under [database], configure database access.
        1
        2
        [database] 
        connection = mysql+pymysql://glance:PASSWORD@controller/glance
        
      2. Configure Identity service access under [keystone_authtoken] and [paste_deploy].
         1
         2
         3
         4
         5
         6
         7
         8
         9
        10
        11
        12
        13
        [keystone_authtoken] 
        www_authenticate_uri = http://controller:5000 
        auth_url = http://controller:5000 
        memcached_servers = controller:11211 
        auth_type = password 
        project_domain_name = Default 
        user_domain_name = Default 
        project_name = service 
        username = glance 
        password = PASSWORD 
        
        [paste_deploy] 
        flavor = keystone
        

        Replace PASSWORD with the password for the glance user to access the database described in Creating the Glance Database.

    3. Press Esc, type :wq!, and press Enter to save the file and exit.
  4. Populate the Image service database.
    1
    su -s /bin/sh -c "glance-manage db_sync" glance
    

  5. Enable the Image service and configure it to start as the system boots.
    1
    2
    systemctl enable openstack-glance-api.service openstack-glance-registry.service
    systemctl start openstack-glance-api.service openstack-glance-registry.service