Skip to content

Sharing your own images

Images can be shared between projects on the current release of OpenStack. If an image had been uploaded to your currently active project, such as described in User Defined Images, you can then use the openstack image add project operations to share that image with another project.

For example, to share an image, first source the project profile for the project containing the image you want to share (as described in Set up your account) and:

$ openstack image create --disk-format=qcow2 --container-format=bare --file ubuntu-17.10-server-cloudimg-amd64.img 'Ubuntu Artful'
$ openstack image show 'Ubuntu Artful'
+------------------+----------------------------------------------------------------------------------------------------------+
| Field            | Value                                                                                                    |
+------------------+----------------------------------------------------------------------------------------------------------+
| checksum         | d2dd69625c5964314993b4692ad6543d                                                                         |
| container_format | bare                                                                                                     |
| created_at       | 2017-11-02T09:49:08Z                                                                                     |
| disk_format      | qcow2                                                                                                    |
| file             | /v2/images/1d9bb97c-2b56-4830-9b1e-8c53d9085861/file                                                     |
| id               | 1d9bb97c-2b56-4830-9b1e-8c53d9085861                                                                     |
| min_disk         | 0                                                                                                        |
| min_ram          | 0                                                                                                        |
| name             | Ubuntu Artful                                                                                            |
| owner            | 01763ecd-a327-4d54-b045-3d46ca62f082                                                                     |
| properties       | direct_url='rbd://b4f463a0-c671-43a8-bd36-e40ab8d233d2/images/1d9bb97c-2b56-4830-9b1e-8c53d9085861/snap' |
| protected        | False                                                                                                    |
| schema           | /v2/schemas/image                                                                                        |
| size             | 317980672                                                                                                |
| status           | active                                                                                                   |
| tags             |                                                                                                          |
| updated_at       | 2017-11-02T09:49:26Z                                                                                     |
| virtual_size     | None                                                                                                     |
| visibility       | private                                                                                                  |
+------------------+----------------------------------------------------------------------------------------------------------+

Make sure the visibility of the image is shared:

$ openstack image set --shared 'Ubuntu Artful'

Then proceed to share it to the project you wanted

$ openstack image add project 'Ubuntu Artful' 65bf648d-8d07-48af-8c3a-fa162a5b283f

A member of the target project (ex: 65bf648d-8d07-48af-8c3a-fa162a5b283f) needs to accept the image in order to be available in the images list. Please make sure that the image id specified corresponds to the image you are sharing in this case (1d9bb97c-2b56-4830-9b1e-8c53d9085861).

$ openstack image set --accept 1d9bb97c-2b56-4830-9b1e-8c53d9085861 

You should then have the image visible in the target project's image list.