Share an Image with Another Project
You can share an image from your project with a collaborator in a different project so you can both launch instances using the same image. As the owner of the image, you can revoke the sharing privilege at any time.
Prerequisites:
- Both you and your collaborator need to use the OpenStack CLI.
- You will need to know the ID of your collaborator. Your collaborator can find the project ID using the
openstack project list
command or at this URL: https://redcloud2.cac.cornell.edu/horizon/identity/
Share an Image With Another Project
-
Find the ID of the image you want to share:
openstack image show <image name>
Similar to project ID, this will be a long string of letters and numbers next to the name of your image. You will use the image ID, rather than the name, in the commands below.
-
Share the image with your collaborator's project
openstack image set --shared <image ID> openstack image add project <image ID> <collaborator's project ID>
-
Verify the image is now shared:
openstack image member list <image ID>
The status field should say
pending
until your collaborator accepts the image. -
Give the ID of the shared image to your collaborator so they can follow the steps in the Accept a Shared Image section to add the image to their project.
Accept a Shared Image
-
Get the ID of the shared image from the owner. Make sure the owner has performed the steps in the Share an Image section above.
-
Source in the application credential for the project accepting the shared image.
-
Accept the shared image:
openstack image set --accept <image ID>
-
Verify the image is now available to your project:
openstack image list
If the image is listed in the output, it should also appear in the Horizon web console.
Unshare an Image
-
An image's owner can see which projects have access to the image
openstack image member list <image ID>
-
The owner can unshare an image like this
openstack image remove project <image ID> <project ID>