Mindmajix

How to Share Images – OpenStack Glance

Image sharing among Tenants

In OpenStack , images are often characterized as ‘virtual machine templates’ . When the image you shared is private , then it can be seen only by the tenant who has uploaded it and not by the other tenants . However, if you want to share it with other tenants , then you must follow a simple mechanism which allows greater control over the images at the same time not making it public.

Getting Started

To start with , assure that you are logged into our Ubuntu client , where we can run the glance tool. This can be achieved using the following command:

     sudo apt-get update

     sudo apt-get –y install glance-client

Assure that your environment variable is set-up correctly using admin user and password which was created using the knowledge of our previous chapter . It would be as shown:

export OS_TENANT_NAME=cookbook
export OS_USERNAME=admin
export OS_PASSWORD=openstack
export OS_AUTH_URL=http://172.16.0.1:5000/v2.0/
export OS_NO_CACHE=1

How to do it…

Follow these simple steps to share a private image present in our ‘cookbook’ tenant with other tenants

  1. Initially we must note the tenant ID with whom you want to share the image with

Keystone tenant-list

  1. We then list all the images you want to share as follows:

glance image-list

  1. For example , if you have a tenant with ID 04a1f957fcb49229ccbc5af55ac9f7c and an image with ID 2e696cf4-5167-4908-a769-356a51dc572 , then the image would be shared as shown:

glance member-create\

         2e696cf4-5167-4908-a769-356a51dc572\

         04a1f957fcb49229ccbc5af55ac9f7c

It’s Working…

The member-create option in the glance command allows us to share images with other tenants . The syntax is as shown:

   glance [-can-share] member-create image-id tenant-id

The command also comes with another extra parameter -can-share , which in turn permits the other tenant to share the image.

We can also have an access to know which images have been shared with which tenant by using member-create option . This particular option gives us full control over the type of access of the users to images in our OpenStack environment.

Viewing of Shared Images

Getting Started

To begin with , assure that you are logged into our Ubuntu client where we can run the glance tool.This can be installed using the below command :

sudo apt-get update

         sudo apt-get –y install glance-client

Assure that your environment variable is set-up correctly using admin user and password which was created using the knowledge of our previous chapter . It would be as shown:

     export OS_TENANT_NAME=cookbook

   export OS_USERNAME=admin

     export OS_PASSWORD=openstack

     export OS_AUTH_URL=http://172.16.0.1:5000/v2.0/

     export OS_NO_CACHE=1

How to achieve it…

 Execute these following steps to view the images that has been shared with the particular tenant

  1. We first need to get the tenant ID of the tenant we want to view as follows:

   keystone tenant_list

  1. We can now list the images that have been shared with a tenant as follows:

    glance member-list-tenant-id\

04a1f957fcb49229ccbc5af55ac9f7c

It’s Working…

The member-list option in the glance command allows us to view images that have been shared with other tenants . The syntax is as shown:

       Glance member-list-image-id IMAGE_ID

       Glance member-list-tenant-id TENANT_ID

 

  Enroll for Live Instructor Led Online OpenStack Training


 

0 Responses on How to Share Images – OpenStack Glance"

Leave a Message

Your email address will not be published. Required fields are marked *

Copy Rights Reserved © Mindmajix.com All rights reserved. Disclaimer.
Course Adviser

Fill your details, course adviser will reach you.