[root@controller ~] glance image-create --name "Centos7.5" --disk-format qcow2 --container-format bare --progress < /opt/iaas/images/CentOS_7.5_x86_64_XD.qcow2
Error finding address for http://controller:9292/v2/schemas/image: Unable to establish connection to http://controller:9292/v2/schemas/image: HTTPConnectionPool(host='controller', port=9292): Max retries exceeded with url: /v2/schemas/image (Caused by
NewConnectionError('<requests.packages.urllib3.connection.HTTPConnection object at 0x7f146f3e0a90>: Failed to establish a new connection: [Errno 111] Connection refused',))
先使用ss查看端口9292是否被打开
[root@controller ~]# ss -anl | grep 9292
[root@controller ~]#
可以看见端口并未打开,开始排错,排错先从配置文件开始,一般都是配置文件错误才导致端口没起来
[keystone_authtoken]
auth_uri = http://controller:5000
auth_utl = http://controller:5000 ##可以看见这里错误utl
memcached_servers = controller:11211
auth_type = password
project_domain_name = demo
user_domain_name = demo
project_name = service
username = glance
password = 000000
修改配置文件后可以看见端口打开
[keystone_authtoken]
auth_uri = http://controller:5000
auth_url = http://controller:5000
memcached_servers = controller:11211
auth_type = password
project_domain_name = demo
user_domain_name = demo
project_name = service
username = glance
password = 000000
[root@controller ~]# systemctl restart openstack-glance-api openstack-glance-registry
[root@controller ~]# ss -anl | grep 9292 tcp LISTEN 0 128 *:9292 *:*
再次上传镜像成功!!
[root@controller ~]# glance image-create --name "Centos7.5" --disk-format qcow2 --container-format bare --progress < /opt/iaas/images/CentOS_7.5_x86_64_XD.qcow2
[=============================>] 100%
+------------------+--------------------------------------+
| Property | Value |
+------------------+--------------------------------------+
| checksum | 3d3e9c954351a4b6953fd156f0c29f5c |
| container_format | bare |
| created_at | 2021-04-26T14:38:03Z |
| disk_format | qcow2 |
| id | 7a39ee7e-656f-4fd6-9a91-d651e70a2aea |
| min_disk | 0 |
| min_ram | 0 |
| name | Centos7.5 |
| owner | eb411a00760a4054ac754e2ab3a333bc |
| protected | False |
| size | 510459904 |
| status | active |
| tags | [] |
| updated_at | 2021-04-26T14:38:07Z |
| virtual_size | None |
| visibility | shared |
+------------------+--------------------------------------+
[root@controller ~]#