Table of Contents
In today’s blog, we are going to discuss: Image (Glance). We will also cover the topics like Glance Formats, Status flow, configuration file, and image and instance.
So without wasting our time let’s start the discussion!
The Glance component of an OpenStack image glance service supports finding, entering, and revoking the server and the disk images. It is considered as a central container or the repository for virtual images. For queries regarding image metadata of virtual machines’ and recovering real images, Glance uses RESTful API. The images of virtual machines that are made available by Glance need to be stored in different locations such as from a normal file system to an object storage system like the Swift project of OpenStack image glance.
For launching new instances, glance stores the images in the form of templates. It is designed as an independent service particularly for those who require organizing huge groups of virtual and server images. It is able to take snaps of working instances which are required for supporting virtual machines as well as its conditions.
At the time of transferring an image to the glance, it is important to mention the formats related to the virtual machine images. Wide varieties of formats are supported by Glance such as container formats, disk formats, etc. The physical server’s boot drive is the same as the virtual disk just abstracted in a file. Various disk formats are supported by various virtualizations.
Let’s discuss each of these two formats in detail:
As mentioned earlier, the OpenStack image glance provides support to the container format which defines the formats of the different files and also includes extra metadata concerning the VM.
It is important to note that Glance or any other component of the OpenStack image glance is not currently using the Container formats, therefore ‘bare’ is considered as a container format at the time when an image is transferred in a glance and the meaning of bare is one without a container.
root@CONTROLLER: ~# glance image-create – -name “cirros-0.3.4-x86_64” – -file / tmp/ images/cirros – 0.3.4. –x86_64-disk.img – -disk – format qcow2 – – container-format bare – -visibility public – – progress
The image-create is used in the command for creating an image in glance name expresses the name using which that image is represented, the file option displays the path of the image, qcow2 is used for showing disk format and bare is used for displaying the container format. The meaning of visibility public is that the image can be accessible publicly and the progress indicates the transfer or upload progress bar.
[ ====================================== ] 100%
Property | Value |
checksum | 133eae98f45894a4e60d8736619 |
container_format | bare |
created_at | 2015-03-26T16:52:10z |
disk_format | Qcow2 |
id | 38047887 – 61a7 – 41ea – 9b49 – 27987d5e8bb9 |
min_disk | 0 |
min_ram | 0 |
name | cirros – 0.3.4-x86_64 |
owner | Ae7a98326b9c455588edd2656d723b9d |
protected | False |
size | 13200896 |
status | active |
tags | [ ] |
updated_at | 2015 – 03 -26T16k:52:10z |
virtual_size | none |
visibility | public |
The format of the underlying disk image means the disk format of the virtual machine image.
At the time of transferring or uploading an image, the status of the image is shown by the glance status flow. Queuing is the first step just when an image is created, then the image is lined up for a short period of time identifiers, these are then stored to the image and then the image is ready for uploading.
Once the image is queued, it then moves to a status saving that means it is not completely uploaded. The status will be Active once the image is fully uploaded and if the image uploading fails then that image will go to killed or deleted state.
By using a command we can deactivate as well as reactivate the fully transferred or the uploaded image
Deactivating and reactivating an image:
As mentioned earlier cloud operators can temporarily deactivate an image. If the subsequent operators think that the image is a threat for the cloud environment then they can reactivate that image or they can just delete or remove it.
At the time of carrying out updates of an image, the operator may want to conceal it from all the other users and when the image update is completed, the operator may reactivate the image so that from it the users can boot VM.
root@CONTROLLER:~# glance image- list
ID Name
17449a2e-8711-4700-af8f-4399271597c cirros-0.3.4-x86_64
For deactivating an image a token id is needed.
root@CONTROLLER:~# openstack token issue
Using above command once the image id and the token id are replaced then execute the curl command:
root@CONTROLLER: ~# curl –x POST –H ‘x-Auth-Token: fbdab45ff753408c9e042aa6892e055b’ http: // 192.168.1.110:9292/v2/images/17449a2e-8711-4700-af8f-439927159b7c/actions/deactivate
Now using above command the image will be deactivated.
Now using glance image-list try to list image as follows:
root@CONTROLLER:~# glance image-list
u’deactivated’ is not one of [u’queued’, u’saving’, u’active’, u’killed’, u’deleted’, u’pending_delete’]
Failed validating u’enum’ in schema[u’properties’][u’status’]:
{u’description’ : u’Status of the image (READ-ONLY)’,
U’enum’: [u’queued’,
u’saving’,
u’active’,
u’killed’,
u’deleted’,
u’pending_delete’],
u’type’:u’string’}
On instance[u’status’];
u’deactivated’
The output that we will get is that here the status is deactivated.
The same curl command can be used for reactivating image, but the only change will be in the token id.
The steps for reactivating a deactivated image are as follows:
root@CONTROLLER:~# openstack token issue
Following is the curl command:
root@CONTROLLER:~# curl –x POST –H ‘x-Auth-Token:88878e52d01f43c29a915b2220295641’ http:// 192.168.1.110:9292/v2/images/17449a2e-8711-4700-af8f-439927159b7c/actions/reactive
After this check by executing glance image-list as follows:
root@CONTROLLER:~# glance image-list
The main queue of images which required to be deleted is maintained by the coordination between the cleanup scrubber and other glance scrubbers.
Some of the important items are also specified by the glance-scrubber.conf file. Like the time between runs, before the deletion of the images, the length of time images may be pending along with the options of the registry connectivity. This glance-scrubber can work as a periodic job or as a long-running daemon.
As mentioned earlier, glance stores the disk images as templates and the storage and management of the images are controlled by the image services.
Instances are the independent VM that works on the compute node and the instances are managed by the compute nodes. It is possible for the user to launch whatever number of instances using the same image.
If any modifications are performed on the instance, it does not affect the base image. The snaps of working instances taken can be used for initiating new instances.
Once an instance is launched, it is required to specify the flavor because it indicates the virtual resource. These flavors describe an instance has how many virtual CPUs, how much RAM is available, and the size of the ephemeral disks.
A collection of predefined flavors is provided by OpenStack image which we can create as well as modify the required flavors.
When we launch an instance we need to specify the flavor, which represents a virtual resource. Flavors define how many virtual CPUs an instance has, the amount of RAM available to it, and the size of its ephemeral disks. OpenStack image glance provides a set of predefined flavors we can create and edit our own flavors.
It is required to select an image, flavor, or any other optional attribute before launching any instance. The specific flavor selected offers a root volume which is specified as vda and any extra ephemeral storage is specified as vdb and cinder-volume is linked to the third virtual disk and specified as vdc.
That’s all for today! I think you find this information helpful. Please do not forget to leave a Comment in the comment section below. Thank you for reading the blog! See you soon next time with another exciting blog!
People also read:
OpenStack object storage swift component and how to use it and what are its components
Information about OpenStack image glance component and also how to manage images
Understanding OpenStack networking neutron components and its concepts/
Due to growing digitalization, Email Communication has become the backbone of professional interactions. Yet, surprisingly, many professionals struggle to craft…
As the digital landscape continues to evolve, securing your website has never been more crucial. SSL, or Secure Sockets Layer,…
As a web designer and web developer your experience must have reached to new height, right? Further, you need to…
In today's digital landscape, timing is everything. Whether you're a social media manager, business owner, or content creator, the success…
Are you a website owner? Maintaining the website is the prime concern for any website owner. Yes, it’s equally important…
View Comments