<div class="markdown">
<p dir="auto">Hi,<br>
that's right. That's that table that points to the physical location of the images (note that images are named after their UUIDs)</p>
<ul>
<li>Razique</li>
</ul>
<p dir="auto">On 14 Nov 2013, at 1:57, Narayanan, Krishnaprasad wrote:</p>
<blockquote>
<p dir="auto">To be precise enough, you are referring to "Images" table in Glance database. Is this correct?<br>
I also see an image_properties table that has a column "deleted" and ID.</p>
<p dir="auto">From: Razique Mahroua [mailto:<a href="mailto:razique.mahroua@gmail.com">razique.mahroua@gmail.com</a>]<br>
Sent: Donnerstag, 14. November 2013 09:55<br>
To: Narayanan, Krishnaprasad<br>
Cc: <a href="mailto:openstack@lists.openstack.org">openstack@lists.openstack.org</a><br>
Subject: Re: [Openstack] Removing unused images using Glance APIs</p>
<p dir="auto">Ok, so you can deleted safely the unused ones with the SQL commands.<br>
As for the physical files on the server (usually /var/lib/glance/images), you need to check that against the Glance database:<br>
select UUID where deleted =1<br>
You will retrieve a list of unused UUIDs, and these files can be removed as well</p>
<p dir="auto">Razique</p>
<p dir="auto">On 14 Nov 2013, at 0:06, Narayanan, Krishnaprasad wrote:</p>
<p dir="auto">By removing unused images, I mean here is the extra images in the image store which were supposed to be deleted but they still exist. I want to persist the images that are connected to active instances and base images using which snapshots were created.</p>
<p dir="auto">-----Original Message-----<br>
From: Razique Mahroua [mailto:<a href="mailto:razique.mahroua@gmail.com">razique.mahroua@gmail.com</a><a href="mailto:razique.mahroua@gmail.com">razique.mahroua@gmail.com</a>]<br>
Sent: Donnerstag, 14. November 2013 04:08<br>
To: Narayanan, Krishnaprasad<br>
Cc: <a href="mailto:openstack@lists.openstack.org">openstack@lists.openstack.org</a><a href="mailto:openstack@lists.openstack.org">openstack@lists.openstack.org</a><br>
Subject: Re: [Openstack] Removing unused images using Glance APIs</p>
<p dir="auto">But didn't you wanted to remove the unused images in the first place?<br>
if so, then running the SQL commands I gave you will help you to find unused images :)</p>
<p dir="auto">On 13 Nov 2013, at 16:43, Narayanan, Krishnaprasad wrote:</p>
<p dir="auto">If I want to retain the base image for launching new VMs, then I may<br>
lose them. So how do I retain it?</p>
<p dir="auto">-----Original Message-----<br>
From: Razique Mahroua [mailto:<a href="mailto:razique.mahroua@gmail.com">razique.mahroua@gmail.com</a><a href="mailto:razique.mahroua@gmail.com">razique.mahroua@gmail.com</a>]<br>
Sent: Donnerstag, 14. November 2013 01:16<br>
To: Narayanan, Krishnaprasad<br>
Cc: <a href="mailto:openstack@lists.openstack.org">openstack@lists.openstack.org</a><a href="mailto:openstack@lists.openstack.org">openstack@lists.openstack.org</a><br>
Subject: Re: [Openstack] Removing unused images using Glance APIs</p>
<p dir="auto">Same :)<br>
as long as the snapshot is created (make sure it's finished though!)<br>
then you don't need the base image</p>
<p dir="auto">On 13 Nov 2013, at 16:15, Narayanan, Krishnaprasad wrote:</p>
<p dir="auto">What happens if there is an snaspshot created but there are no<br>
instances launched?</p>
<p dir="auto">From: Razique Mahroua [mailto:<a href="mailto:razique.mahroua@gmail.com">razique.mahroua@gmail.com</a><a href="mailto:razique.mahroua@gmail.com">razique.mahroua@gmail.com</a>]<br>
Sent: Donnerstag, 14. November 2013 01:11<br>
To: Narayanan, Krishnaprasad<br>
Cc: <a href="mailto:openstack@lists.openstack.org">openstack@lists.openstack.org</a><a href="mailto:openstack@lists.openstack.org">openstack@lists.openstack.org</a><br>
Subject: Re: [Openstack] Removing unused images using Glance APIs</p>
<p dir="auto">Volumes snap depends on the active instance, that means you don't<br>
need<br>
the base image afterwards.<br>
Just check all actives instances<br>
select * from instances where deleted <> 1<br>
OR :<br>
select image_id from instances where deleted = 0</p>
<p dir="auto">Razique</p>
<p dir="auto">On 13 Nov 2013, at 15:47, Narayanan, Krishnaprasad wrote:</p>
<p dir="auto">Hi</p>
<p dir="auto">If I understand it correctly, this addresses the active instances and<br>
its images. Can I know how one should take care of instance and<br>
volume<br>
snapshots?</p>
<p dir="auto">Thanks,<br>
Krishnaprasad<br>
From: Razique Mahroua<br>
[mailto:<a href="mailto:razique.mahroua@gmail.com">razique.mahroua@gmail.com</a><a href="mailto:razique.mahroua@gmail.com">razique.mahroua@gmail.com</a><a href="mailto:razique.mahroua@gmail.com">razique.mahroua@gmail.com</a><a href="mailto:razique.mahroua@gmail.com">razique.mahroua@gmail.com</a>]<br>
Sent: Mittwoch, 13. November 2013 14:40<br>
To: Narayanan, Krishnaprasad<br>
Cc:<br>
<a href="mailto:openstack@lists.openstack.org">openstack@lists.openstack.org</a><a href="mailto:openstack@lists.openstack.org">openstack@lists.openstack.org</a><a href="mailto:openstack@lists.openstack.org">openstack@lists.openstack.org</a><a href="mailto:openstack@lists.openstack.org">openstack@lists.openstack.org</a><br>
Subject: Re: [Openstack] Removing unused images using Glance APIs</p>
<p dir="auto">Hi. I think there is not any API for that unfortunately....<br>
But there is a field into the database that indicates the image ID.<br>
So<br>
if you select all active instances and select the unique images ID<br>
entries, you can compare them against the Glance images. A BASH<br>
script<br>
should be sufficient.</p>
<p dir="auto">Razique</p>
<p dir="auto">On Wednesday, November 13, 2013, Narayanan, Krishnaprasad wrote:<br>
Hallo All,</p>
<p dir="auto">In our testbed we have Openstack ESSEX. I am in the process of<br>
cleaning up the image store. Can I know are there any APIs in Glance<br>
or Nova that can help me in this process?</p>
<p dir="auto">Thanks,<br>
Krishnaprasad</p>
</blockquote>
</div>