ubuntu Openstack Glance image create“找不到资源,(HTTP 404)”

gojuced7  于 2023-01-29  发布在  其他
关注(0)|答案(2)|浏览(209)

尝试创建映像时遇到问题-找不到资源。(HTTP 404)
我执行以下步骤编辑/etc/glance/glance-api.conf

[database] 
connection = mysql+pymysql://glance:glance@localhost/glance
[DEFAULT]
rabbit_password = openstack
rabbit_userid = openstack
rabbit_host = localhost
[keystone_authtoken]
auth_uri = http://controller:5000
auth_url = http://controller:35357
auth_type = password
project_domain_name = default
user_domain_name = default
project_name = service
username = glance
password = openstack
memcached_servers = controller:11211
[paste_deploy]
flavor = keystone
[glance_store]
stores = file,http
default_store = file
filesystem_store_datadir = /var/lib/glance/images/

编辑/etc/glance/glance-registry.conf文件

[database]
connection = mysql+pymysql://glance:glance@localhost/glance
[keystone_authtoken]
auth_uri = http://controller:5000
auth_url = http://controller:35357
auth_type = password
project_domain_name = default
user_domain_name = default
project_name = service
username = glance
password = openstack
memcached_servers = controller:11211
[paste_deploy]
flavor = keystone

同步数据库根目录@控制器:~# su -s /bin/sh -c“glance-管理数据库同步”glance
而当创造形象时却出错了

root@controller:~# openstack image create "cirros-0.4.0-x86_64" --file /tmp/cirros-0.4.0-x86_64-disk.img --disk-format qcow2 --container-format bare --public
(http://controller:35357/v2/schemas/image): The resource could not be found. (HTTP 404)
root@controller:~#

openstack --version
openstack 3.12.2

glance-api --version
15.0.2
w6lpcovy

w6lpcovy1#

问题是,你使用了错误的端口。35357是keystone的端口,但是openstack image create应该触发port of glance,默认情况下是9292。我认为你没有为openstack端点配置正确的端口。这些端口应该是由openstack endpoint create命令创建的。

m2xkgtsf

m2xkgtsf2#

我编辑我的.rc和它的工作

root@controller:~# env | grep ^OS
OS_REGION_NAME=RegionOne
OS_USER_DOMAIN_NAME=default
OS_IMAGE_API_VERSION=2
OS_PROJECT_NAME=service
OS_IDENTITY_API_VERSION=3
OS_PASSWORD=openstack
OS_DOMAIN_NAME=default
OS_AUTH_TYPE=password
OS_AUTH_URL=http://controller:35357/v3
OS_USERNAME=glance
OS_URL=http://controller:35357/v3
OS_PROJECT_DOMAIN_NAME=default

相关问题