Difference between revisions of "Share An Image In Openstack"
Jump to navigation
Jump to search
m |
|||
(15 intermediate revisions by 3 users not shown) | |||
Line 1: | Line 1: | ||
− | + | You can share an image from your project with a collaborator in a different project in OpenStack cloud 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. You can also use these methods to share an image with yourself in other projects, just think of yourself as the collaborator. | |
− | + | '''Prerequisites:''' | |
− | + | # Both you and your collaborator need to use the [[OpenStack CLI]] | |
− | + | # You will need to know the project name or ID of your collaborator. | |
− | |||
− | + | === Share an Image With Another Project === | |
− | |||
− | |||
* Find the project ID of your collaborator. Run | * Find the project ID of your collaborator. Run | ||
openstack project list | grep <collaborator's project name> | openstack project list | grep <collaborator's project name> | ||
Line 16: | Line 13: | ||
openstack image show <image name> | openstack image show <image name> | ||
* Share the image with your collaborator's project: | * Share the image with your collaborator's project: | ||
+ | openstack image set --shared <image ID> | ||
openstack image add project <image ID> <collaborator's project ID> | openstack image add project <image ID> <collaborator's project ID> | ||
* Verify the image is now shared. The status field should say <code>pending</code> until your collaborator accepts the image. | * Verify the image is now shared. The status field should say <code>pending</code> until your collaborator accepts the image. | ||
openstack image member list <image ID> | openstack image member list <image ID> | ||
− | * Give the ID of the shared image to your collaborator. | + | * Give the ID of the shared image to your collaborator. |
+ | |||
+ | === Share an Image with All Projects === | ||
+ | |||
+ | * Currently this action can only be performed by cloud administrators. | ||
+ | * This generally shouldn't be done unless creating something that is a public resource that is intended to be used with any project. | ||
+ | * Additionally, don't use such an image from a third party unless you trust the source. | ||
+ | openstack image set --public <image ID> | ||
+ | |||
+ | === 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 | Share an Image]] section above. | ||
+ | * 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 Openstack web console (Horizon). | ||
+ | |||
+ | === 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> |
Revision as of 18:38, 25 February 2019
You can share an image from your project with a collaborator in a different project in OpenStack cloud 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. You can also use these methods to share an image with yourself in other projects, just think of yourself as the collaborator.
Prerequisites:
- Both you and your collaborator need to use the OpenStack CLI
- You will need to know the project name or ID of your collaborator.
- Find the project ID of your collaborator. Run
openstack project list | grep <collaborator's project name>
- and the first field of the output is the ID of your collaborator's project ID.
- Find the ID of the image you want to share:
openstack image show <image name>
- 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. The status field should say
pending
until your collaborator accepts the image.
openstack image member list <image ID>
- Give the ID of the shared image to your collaborator.
- Currently this action can only be performed by cloud administrators.
- This generally shouldn't be done unless creating something that is a public resource that is intended to be used with any project.
- Additionally, don't use such an image from a third party unless you trust the source.
openstack image set --public <image ID>
- 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.
- 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 Openstack web console (Horizon).
- 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>