简体   繁体   中英

How to allow users with the member role to upload images as public in an Openstack Cloud?

I've tried changing the /etc/glance/policy.json and setting the following:

"publicize_image": "role:member",

And then restarting both the glance-api and glance-registry services but of course that would be too easy so it doesn't work:)

openstack image create --file gammy_image.iso JACOBS-GAMMY-IMAGE --public
403 Forbidden
You are not authorized to complete publicize_image action.
    (HTTP 403)

I often upload image with command:

glance image-create --name "cirros" --file ./cirros.qcow2 --disk-format qcow2 --container-format bare --visibility public --progress

And it works fine, all users can see my image.

You have two options:

  • add the admin role to your user;
openstack role add --user USER_NAME --project PROJECT_NAME admin
  • remove the need for admin rights for this operation

As an administrator, edit the file /etc/glance/policy.json and change the following line:

"publicize_image": "role:admin", With:

"publicize_image": "", Then restart glance:

$ sudo glance-control all restart

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM