openstack on centos 7.1(image)

来源:互联网 发布:淘宝售后客服问答 编辑:程序博客网 时间:2024/06/11 01:17

1.Install and configure

Prerequisites

Replace GLANCE_DBPASS with a suitable password

mysql -u root -pCREATE DATABASE glance;GRANT ALL PRIVILEGES ON glance.* TO 'glance'@'localhost' IDENTIFIED BY 'GLANCE_DBPASS';GRANT ALL PRIVILEGES ON glance.* TO 'glance'@'%' IDENTIFIED BY 'GLANCE_DBPASS';

edit admin-openrc

export OS_PROJECT_DOMAIN_NAME=defaultexport OS_USER_DOMAIN_NAME=defaultexport OS_PROJECT_NAME=adminexport OS_USERNAME=adminexport OS_PASSWORD=ADMIN_PASSexport OS_AUTH_URL=http://controller:35357/v3export OS_IDENTITY_API_VERSION=3export OS_IMAGE_API_VERSION=2
. admin-openrc
openstack user create --domain default --password-prompt glanceopenstack role add --project service --user glance adminopenstack service create --name glance --description "OpenStack Image" imageopenstack endpoint create --region RegionOne image public http://controller:9292openstack endpoint create --region RegionOne image internal http://controller:9292openstack endpoint create --region RegionOne image admin http://controller:9292

Install and configure components

yum install openstack-glance

/etc/glance/glance-api.conf
#Comment out or remove any other options in the [keystone_authtoken] section.

[database]...connection = mysql+pymysql://glance:GLANCE_DBPASS@controller/glance #Replace GLANCE_DBPASS with the password you chose for the Image service database[keystone_authtoken]...auth_uri = http://controller:5000auth_url = http://controller:35357memcached_servers = controller:11211auth_type = passwordproject_domain_name = defaultuser_domain_name = defaultproject_name = serviceusername = glancepassword = GLANCE_PASS #Replace GLANCE_PASS with the password you chose for the glance user in the Identity service[paste_deploy]...flavor = keystone[glance_store]...stores = file,httpdefault_store = filefilesystem_store_datadir = /var/lib/glance/images/

/etc/glance/glance-registry.conf
#Comment out or remove any other options in the [keystone_authtoken] section.

[database]...connection = mysql+pymysql://glance:GLANCE_DBPASS@controller/glance #Replace GLANCE_DBPASS with the password you chose for the Image service database[keystone_authtoken]...auth_uri = http://controller:5000auth_url = http://controller:35357memcached_servers = controller:11211auth_type = passwordproject_domain_name = defaultuser_domain_name = defaultproject_name = serviceusername = glancepassword = GLANCE_PASS #Replace GLANCE_PASS with the password you chose for the glance user in the Identity service.[paste_deploy]...flavor = keystone

#Ignore any deprecation messages in this output

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

Finalize installation

systemctl enable openstack-glance-api.service openstack-glance-registry.servicesystemctl start openstack-glance-api.service openstack-glance-registry.service

2.Verify operation(just for test)

. admin-openrcyum install -y wgetwget http://download.cirros-cloud.net/0.3.4/cirros-0.3.4-x86_64-disk.imgopenstack image create "cirros" --file cirros-0.3.4-x86_64-disk.img --disk-format qcow2 --container-format bare --public
0 0