openstack image create --file /home/openstack/cirros-0.4.0-x86_64-disk.img --disk-format qcow2 --container-format bare --public cirros
一直报错
1.先检查防火墙是否关闭(若没关闭则关闭防火墙)
systemctl status firewalld
systemctl stop firewalld
2.检查并关闭selinux
setenforece 0
(临时关闭selinux)
vi /etc/selinux/config
将SELINUX改成disabled
(永久关闭selinux)
3.一般执行完这两个然后检查配置文件
vim /etc/glance/glance-api.conf
database部分中,配置数据库访问:
[database]
connection = mysql+pymysql://glance:GLANCE_DBPASS@controller/glance
在[keystone_authtoken]和[paste_deploy]部分中,配置身份服务访问:
[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 = GLANCE_PASS
[paste_deploy]
flavor = keystone
-----------------------------------
[glance_store]部分中,配置本地文件系统存储和镜像文件的位置:
[glance_store]
stores = file,http
default_store = file
filesystem_store_datadir = /var/lib/glance/images/
我做的时候检查完配置文件和以上的所有步骤,但是最后还是报错,最后把所有的服务重启了一遍,然后再次运行就可以了。