Difference between revisions of "OpenStack: Deploying the Glance Image Service"

From Define Wiki
Jump to navigation Jump to search
(Created page with "<syntaxhighlight> [root@server2-a ~(keystone_admin)]$ yum -y install openstack-glance </syntaxhighlight> <syntaxhighlight> [root@server2-a ~(keystone_admin)]$ cp /usr/share/glance/glance-registry-dist.conf /e...")
 
 
Line 2: Line 2:
 
[root@server2-a ~(keystone_admin)]$ yum -y install openstack-glance
 
[root@server2-a ~(keystone_admin)]$ yum -y install openstack-glance
 
</syntaxhighlight>
 
</syntaxhighlight>
 +
 
<syntaxhighlight>
 
<syntaxhighlight>
 
[root@server2-a ~(keystone_admin)]$ cp /usr/share/glance/glance-registry-dist.conf /etc/glance/glance-registry.conf  
 
[root@server2-a ~(keystone_admin)]$ cp /usr/share/glance/glance-registry-dist.conf /etc/glance/glance-registry.conf  
Line 8: Line 9:
 
cp: overwrite ‘/etc/glance/glance-api.conf’? y
 
cp: overwrite ‘/etc/glance/glance-api.conf’? y
 
</syntaxhighlight>
 
</syntaxhighlight>
 +
 +
<syntaxhighlight>
 +
[root@server2-a ~(keystone_admin)]$ openstack-db --init --service glance --password redhat
 +
Please enter the password for the 'root' MySQL user:
 +
Verified connectivity to MySQL.
 +
Creating 'glance' database.
 +
Updating 'glance' database password in /etc/glance/glance-registry.conf /etc/glance/glance-api.conf
 +
Initializing the glance database, please wait...
 +
Complete!
 +
</syntaxhighlight>
 +
 +
<syntaxhighlight>
 +
[root@server2-a ~(keystone_admin)]$ crudini --set /etc/glance/glance-api.conf paste_deploy flavor keystone
 +
[root@server2-a ~(keystone_admin)]$ crudini --set /etc/glance/glance-api.conf keystone_authtoken admin_tenant_name services
 +
[root@server2-a ~(keystone_admin)]$ crudini --set /etc/glance/glance-api.conf keystone_authtoken admin_user glance
 +
[root@server2-a ~(keystone_admin)]$ crudini --set /etc/glance/glance-api.conf keystone_authtoken admin_password redhat
 +
</syntaxhighlight>
 +
 
<syntaxhighlight>
 
<syntaxhighlight>
 +
[root@server2-a ~(keystone_admin)]$ crudini --set /etc/glance/glance-api.conf DEFAULT rabbit_userid rabbitmqauth
 +
[root@server2-a ~(keystone_admin)]$ crudini --set /etc/glance/glance-api.conf DEFAULT rabbit_password redhat
 +
[root@server2-a ~(keystone_admin)]$ crudini --set /etc/glance/glance-api.conf DEFAULT rabbit_host 172.25.2.10
 +
[root@server2-a ~(keystone_admin)]$ crudini --set /etc/glance/glance-api.conf DEFAULT rabbit_use_ssl True
 +
[root@server2-a ~(keystone_admin)]$ crudini --set /etc/glance/glance-api.conf DEFAULT rabbit_port 5671
 +
</syntaxhighlight>
  
 +
<syntaxhighlight>
 +
[root@server2-a ~(keystone_admin)]$ crudini --set /etc/glance/glance-registry.conf paste_deploy flavor keystone
 +
[root@server2-a ~(keystone_admin)]$ crudini --set /etc/glance/glance-registry.conf keystone_authtoken admin_tenant_name services
 +
[root@server2-a ~(keystone_admin)]$ crudini --set /etc/glance/glance-registry.conf keystone_authtoken admin_user glance
 +
[root@server2-a ~(keystone_admin)]$ crudini --set /etc/glance/glance-registry.conf keystone_authtoken admin_password redhat
 +
</syntaxhighlight>
 +
 +
<syntaxhighlight>
 +
[root@server2-a ~(keystone_admin)]$ systemctl start openstack-glance-registry
 +
[root@server2-a ~(keystone_admin)]$ systemctl start openstack-glance-api
 +
[root@server2-a ~(keystone_admin)]$ systemctl enable openstack-glance-registry.service
 +
ln -s '/usr/lib/systemd/system/openstack-glance-registry.service' '/etc/systemd/system/multi-user.target.wants/openstack-glance-registry.service'
 +
[root@server2-a ~(keystone_admin)]$ systemctl enable openstack-glance-api
 +
ln -s '/usr/lib/systemd/system/openstack-glance-api.service' '/etc/systemd/system/multi-user.target.wants/openstack-glance-api.service'
 +
</syntaxhighlight>
 +
 +
<syntaxhighlight>
 +
[root@server2-a ~(keystone_admin)]$ keystone tenant-list | grep services
 +
| a9b089ede5e5494b9b87c3e9894843f5 |  services  |  True  |
 +
[root@server2-a ~(keystone_admin)]$ keystone user-create --name glance --pass redhat
 +
+----------+----------------------------------+
 +
| Property |              Value              |
 +
+----------+----------------------------------+
 +
|  email  |                                  |
 +
| enabled  |              True              |
 +
|    id    | b0a3ad5ab6b448efa7f2d831de827948 |
 +
|  name  |              glance              |
 +
| username |              glance              |
 +
+----------+----------------------------------+
 +
[root@server2-a ~(keystone_admin)]$ keystone user-role-add --user glance --role admin --tenant services
 +
[root@server2-a ~(keystone_admin)]$ keystone service-create --name glance --type image --description "OpenStack Image Service"
 +
+-------------+----------------------------------+
 +
|  Property  |              Value              |
 +
+-------------+----------------------------------+
 +
| description |    OpenStack Image Service      |
 +
|  enabled  |              True              |
 +
|      id    | af28b4091b6d42e58b0980232f503532 |
 +
|    name    |              glance              |
 +
|    type    |              image              |
 +
+-------------+----------------------------------+
 +
[root@server2-a ~(keystone_admin)]$ keystone endpoint-create --service-id af28b4091b6d42e58b0980232f503532 --publicurl http://server2-a.example.com:9292 --adminurl http://server2-a.example.com:9292 --internalurl http://server2-a.example.com:9292
 +
+-------------+-----------------------------------+
 +
|  Property  |              Value              |
 +
+-------------+-----------------------------------+
 +
|  adminurl  | http://server2-a.example.com:9292 |
 +
|      id    |  16e5267c1d8142539b96b3f3a5d5574d |
 +
| internalurl | http://server2-a.example.com:9292 |
 +
|  publicurl  | http://server2-a.example.com:9292 |
 +
|    region  |            regionOne            |
 +
|  service_id |  af28b4091b6d42e58b0980232f503532 |
 +
+-------------+-----------------------------------+
 +
[root@server2-a ~(keystone_admin)]$
 +
</syntaxhighlight>
 +
 +
<syntaxhighlight>
 +
[root@server2-a ~(keystone_admin)]$ firewall-cmd --add-port=9292/tcp --permanent
 +
success
 +
[root@server2-a ~(keystone_admin)]$ firewall-cmd --reload
 +
success
 
</syntaxhighlight>
 
</syntaxhighlight>

Latest revision as of 14:41, 28 April 2015

[root@server2-a ~(keystone_admin)]$ yum -y install openstack-glance
[root@server2-a ~(keystone_admin)]$ cp /usr/share/glance/glance-registry-dist.conf /etc/glance/glance-registry.conf 
cp: overwrite ‘/etc/glance/glance-registry.conf’? y
[root@server2-a ~(keystone_admin)]$ cp /usr/share/glance/glance-api-dist.conf /etc/glance/glance-api.conf 
cp: overwrite ‘/etc/glance/glance-api.conf’? y
[root@server2-a ~(keystone_admin)]$ openstack-db --init --service glance --password redhat
Please enter the password for the 'root' MySQL user: 
Verified connectivity to MySQL.
Creating 'glance' database.
Updating 'glance' database password in /etc/glance/glance-registry.conf /etc/glance/glance-api.conf
Initializing the glance database, please wait...
Complete!
[root@server2-a ~(keystone_admin)]$ crudini --set /etc/glance/glance-api.conf paste_deploy flavor keystone
[root@server2-a ~(keystone_admin)]$ crudini --set /etc/glance/glance-api.conf keystone_authtoken admin_tenant_name services
[root@server2-a ~(keystone_admin)]$ crudini --set /etc/glance/glance-api.conf keystone_authtoken admin_user glance
[root@server2-a ~(keystone_admin)]$ crudini --set /etc/glance/glance-api.conf keystone_authtoken admin_password redhat
[root@server2-a ~(keystone_admin)]$ crudini --set /etc/glance/glance-api.conf DEFAULT rabbit_userid rabbitmqauth
[root@server2-a ~(keystone_admin)]$ crudini --set /etc/glance/glance-api.conf DEFAULT rabbit_password redhat
[root@server2-a ~(keystone_admin)]$ crudini --set /etc/glance/glance-api.conf DEFAULT rabbit_host 172.25.2.10
[root@server2-a ~(keystone_admin)]$ crudini --set /etc/glance/glance-api.conf DEFAULT rabbit_use_ssl True
[root@server2-a ~(keystone_admin)]$ crudini --set /etc/glance/glance-api.conf DEFAULT rabbit_port 5671
[root@server2-a ~(keystone_admin)]$ crudini --set /etc/glance/glance-registry.conf paste_deploy flavor keystone
[root@server2-a ~(keystone_admin)]$ crudini --set /etc/glance/glance-registry.conf keystone_authtoken admin_tenant_name services
[root@server2-a ~(keystone_admin)]$ crudini --set /etc/glance/glance-registry.conf keystone_authtoken admin_user glance
[root@server2-a ~(keystone_admin)]$ crudini --set /etc/glance/glance-registry.conf keystone_authtoken admin_password redhat
[root@server2-a ~(keystone_admin)]$ systemctl start openstack-glance-registry
[root@server2-a ~(keystone_admin)]$ systemctl start openstack-glance-api
[root@server2-a ~(keystone_admin)]$ systemctl enable openstack-glance-registry.service 
ln -s '/usr/lib/systemd/system/openstack-glance-registry.service' '/etc/systemd/system/multi-user.target.wants/openstack-glance-registry.service'
[root@server2-a ~(keystone_admin)]$ systemctl enable openstack-glance-api
ln -s '/usr/lib/systemd/system/openstack-glance-api.service' '/etc/systemd/system/multi-user.target.wants/openstack-glance-api.service'
[root@server2-a ~(keystone_admin)]$ keystone tenant-list | grep services
| a9b089ede5e5494b9b87c3e9894843f5 |   services  |   True  |
[root@server2-a ~(keystone_admin)]$ keystone user-create --name glance --pass redhat
+----------+----------------------------------+
| Property |              Value               |
+----------+----------------------------------+
|  email   |                                  |
| enabled  |               True               |
|    id    | b0a3ad5ab6b448efa7f2d831de827948 |
|   name   |              glance              |
| username |              glance              |
+----------+----------------------------------+
[root@server2-a ~(keystone_admin)]$ keystone user-role-add --user glance --role admin --tenant services
[root@server2-a ~(keystone_admin)]$ keystone service-create --name glance --type image --description "OpenStack Image Service"
+-------------+----------------------------------+
|   Property  |              Value               |
+-------------+----------------------------------+
| description |     OpenStack Image Service      |
|   enabled   |               True               |
|      id     | af28b4091b6d42e58b0980232f503532 |
|     name    |              glance              |
|     type    |              image               |
+-------------+----------------------------------+
[root@server2-a ~(keystone_admin)]$ keystone endpoint-create --service-id af28b4091b6d42e58b0980232f503532 --publicurl http://server2-a.example.com:9292 --adminurl http://server2-a.example.com:9292 --internalurl http://server2-a.example.com:9292
+-------------+-----------------------------------+
|   Property  |               Value               |
+-------------+-----------------------------------+
|   adminurl  | http://server2-a.example.com:9292 |
|      id     |  16e5267c1d8142539b96b3f3a5d5574d |
| internalurl | http://server2-a.example.com:9292 |
|  publicurl  | http://server2-a.example.com:9292 |
|    region   |             regionOne             |
|  service_id |  af28b4091b6d42e58b0980232f503532 |
+-------------+-----------------------------------+
[root@server2-a ~(keystone_admin)]$
[root@server2-a ~(keystone_admin)]$ firewall-cmd --add-port=9292/tcp --permanent
success
[root@server2-a ~(keystone_admin)]$ firewall-cmd --reload
success