With PowerVC 1.4.4 release, you can set the image visibility to share images across multiple projects or tenants without explicitly creating members. PowerVC supports only two visibility options i.e. private and public. By default, any image created is private to the project. Public images are also called shared images. This can be achieved by changing the visibility of the image through PowerVC GUI, REST API, or through OpenStack CLI command.
Feature highlights
- PowerVC cloud has different tenants or projects. The image sharing feature enables sharing of images in different tenants or projects.
- This will supported from PowerVC GUI, REST API and Openstack CLI commands.
- Public images can be created only using Admin role from ibm-default project in PowerVC.
- Images with 'public' visibility can be viewed across all projects.
- Only admin users of the other projects can deploy 'public' images shared from ibm-default project.
- Public images owned by ibm-default project cannot be deleted by other projects.
Let's see a use case now.
Use Case
By default, PowerVC GUI creates images with private visibility. Assuming that you are an administrator and want to share an image across multiple projects. You can share the image through any of the following methods.
Method 1 - Using PowerVC GUI
Create an image and set visibility to public
- After logging in to PowerVC user interface, (admin users) select the ibm-default project.
- Go to Images section and click Create to create an image.
You can see that this image is not visible to other projects.
- Change visibility from ibm-default project GUI.
- Now the image is available in other projects.Project admin can use this image for further VM provisioning.
Method 2 - Using REST API
Set the image visibility to 'public' by running the following REST API.
Resource: {management_ip}/powervc/openstack/image/v2/images/{image_id}
Method | Parameters |
PATCH | path:/visibility value:public op:replace |
Method 3 - Using OpenStack CLI commands
To list the image properties, run:
openstack image show IMAGE
To set the image visibility to 'public' run:
openstack image set IMAGE --public
Note: To run the OpenStack image CLI, we should source /opt/ibm/powervc/powervcrc.
PowerVC GUI will throw exception in the following cases,
1. When a user attempts to deploy a virtual machine using deploy template created with public image, and which is deleted by the admin in the ibm-default project.
2. When a user attempts to deploy a virtual machine using deploy template having public image and the admin modified it's visibility to private in the ibm-default project.
You have seen that setting the visibility of an image and making it available across projects is so simple.
Please post your comments or queries in the comments section below and don't forget to follow us on LinkedIn, Facebook, and Twitter.
Author: Maria Varghese