CentOS 6.5 Openstack Icehouse 安裝指南 -5 鏡像glance

 

http://docs.openstack.org/icehouse/install-guide/install/yum/content/glance-install.html

 

glance-api. Accepts Image API calls for p_w_picpath discovery, retrieval, and storage

glance-registry. Stores, processes, and retrieves metadata about p_w_picpaths. Metadata includes items such as size and type.

 

Install the Image Service on the controller node:

 

# yum install openstack-glance python-glanceclient

 

# openstack-config --set /etc/glance/glance-api.conf database \
  connection mysql://glance:glancepw@controller/glance
# openstack-config --set /etc/glance/glance-registry.conf database \
  connection mysql://glance:glancepw@controller/glance

 

# openstack-config --set /etc/glance/glance-api.conf DEFAULT \
  rpc_backend qpid
# openstack-config --set /etc/glance/glance-api.conf DEFAULT \
  qpid_hostname controller

 

$ mysql -u root -p
mysql> CREATE DATABASE glance;
mysql> GRANT ALL PRIVILEGES ON glance.* TO 'glance'@'localhost' \
IDENTIFIED BY 'glancepw';
mysql> GRANT ALL PRIVILEGES ON glance.* TO 'glance'@'%' \
IDENTIFIED BY 'glancepw';

 

# su -s /bin/sh -c "glance-manage db_sync" glance

 

$ keystone user-create --name=glance --pass=glancepw \
   --email=[email protected]
$ keystone user-role-add --user=glance --tenant=service --role=admin

 

# openstack-config --set /etc/glance/glance-api.conf keystone_authtoken \
  auth_uri http://controller:5000
# openstack-config --set /etc/glance/glance-api.conf keystone_authtoken \
  auth_host controller
# openstack-config --set /etc/glance/glance-api.conf keystone_authtoken \
  auth_port 35357
# openstack-config --set /etc/glance/glance-api.conf keystone_authtoken \
  auth_protocol http
# openstack-config --set /etc/glance/glance-api.conf keystone_authtoken \
  admin_tenant_name service
# openstack-config --set /etc/glance/glance-api.conf keystone_authtoken \
  admin_user glance
# openstack-config --set /etc/glance/glance-api.conf keystone_authtoken \
  admin_password glancepw
# openstack-config --set /etc/glance/glance-api.conf paste_deploy \
  flavor keystone
# openstack-config --set /etc/glance/glance-registry.conf keystone_authtoken \
  auth_uri http://controller:5000
# openstack-config --set /etc/glance/glance-registry.conf keystone_authtoken \
  auth_host controller
# openstack-config --set /etc/glance/glance-registry.conf keystone_authtoken \
  auth_port 35357
# openstack-config --set /etc/glance/glance-registry.conf keystone_authtoken \
  auth_protocol http
# openstack-config --set /etc/glance/glance-registry.conf keystone_authtoken \
  admin_tenant_name service
# openstack-config --set /etc/glance/glance-registry.conf keystone_authtoken \
  admin_user glance
# openstack-config --set /etc/glance/glance-registry.conf keystone_authtoken \
  admin_password glancepw

# openstack-config --set /etc/glance/glance-registry.conf paste_deploy \
  flavor keystone

 

$ keystone service-create --name=glance --type=p_w_picpath \
  --description="OpenStack Image Service"
$ keystone endpoint-create \
  --service-id=$(keystone service-list | awk '/ p_w_picpath / {print $2}') \
  --publicurl=http://controller:9292 \
  --internalurl=http://controller:9292 \
  --adminurl=http://controller:9292

 

# service openstack-glance-api start
# service openstack-glance-registry start
# chkconfig openstack-glance-api on
# chkconfig openstack-glance-registry on

 

$ mkdir /tmp/p_w_picpaths
$ cd /tmp/p_w_picpaths/
$ wget http://cdn.download.cirros-cloud.net/0.3.2/cirros-0.3.2-x86_64-disk.img

//這個我作弊了,哈哈,實在是下載不下來,我就startx了,然後圖形界面baidu下載的,放到那個目錄下了。

 

source admin-openrc.sh

 //參見前面的

 

# glance p_w_picpath-create --name "cirros-0.3.0-x86_64" --disk-format qcow2 \
  --container-format bare --is-public True --progress < cirros-0.3.0-x86_64-disk.img

//我下的是cirros-0.3.0-x86_64-disk.img

 

最後驗證一下,出來了,哈哈。

$ glance p_w_picpath-list

 

| a02518d3-5bfc-4bc4-93e1-f2e9b73e9aa1 | cirros-0.3.0-x86_64 | qcow2       | bare             | 9761280 | active |

 

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章