<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Word 14 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:Tahoma;
panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
p
{mso-style-priority:99;
mso-margin-top-alt:auto;
margin-right:0cm;
mso-margin-bottom-alt:auto;
margin-left:0cm;
font-size:12.0pt;
font-family:"Times New Roman","serif";}
code
{mso-style-priority:99;
font-family:"Courier New";}
p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
{mso-style-priority:99;
mso-style-link:"Balloon Text Char";
margin:0cm;
margin-bottom:.0001pt;
font-size:8.0pt;
font-family:"Tahoma","sans-serif";}
span.EmailStyle20
{mso-style-type:personal-reply;
font-family:"Calibri","sans-serif";
color:#1F497D;}
span.BalloonTextChar
{mso-style-name:"Balloon Text Char";
mso-style-priority:99;
mso-style-link:"Balloon Text";
font-family:"Tahoma","sans-serif";}
.MsoChpDefault
{mso-style-type:export-only;
font-family:"Calibri","sans-serif";}
@page WordSection1
{size:612.0pt 792.0pt;
margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">To be precise enough, you are referring to “Images” table in Glance database. Is this correct?<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">I also see an image_properties table that has a column “deleted” and ID.<o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">From:</span></b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif""> Razique Mahroua [mailto:razique.mahroua@gmail.com]
<br>
<b>Sent:</b> Donnerstag, 14. November 2013 09:55<br>
<b>To:</b> Narayanan, Krishnaprasad<br>
<b>Cc:</b> openstack@lists.openstack.org<br>
<b>Subject:</b> Re: [Openstack] Removing unused images using Glance APIs<o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p>Ok, so you can deleted safely the unused ones with the SQL commands.<br>
As for the <em>physical</em> files on the server (usually /var/lib/glance/images), you need to check that against the Glance database:<br>
<code><span style="font-size:10.0pt">select UUID where deleted =1</span></code><br>
You will retrieve a list of unused UUIDs, and these files can be removed as well<o:p></o:p></p>
<p>Razique<o:p></o:p></p>
<p>On 14 Nov 2013, at 0:06, Narayanan, Krishnaprasad wrote:<o:p></o:p></p>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<p>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.<o:p></o:p></p>
<p>-----Original Message-----<br>
From: Razique Mahroua [mailto:<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><br>
Subject: Re: [Openstack] Removing unused images using Glance APIs<o:p></o:p></p>
<p>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 :)<o:p></o:p></p>
<p>On 13 Nov 2013, at 16:43, Narayanan, Krishnaprasad wrote:<o:p></o:p></p>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<p>If I want to retain the base image for launching new VMs, then I may<br>
lose them. So how do I retain it?<o:p></o:p></p>
<p>-----Original Message-----<br>
From: Razique Mahroua [mailto:<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><br>
Subject: Re: [Openstack] Removing unused images using Glance APIs<o:p></o:p></p>
<p>Same :)<br>
as long as the snapshot is created (make sure it's finished though!)<br>
then you don't need the base image<o:p></o:p></p>
<p>On 13 Nov 2013, at 16:15, Narayanan, Krishnaprasad wrote:<o:p></o:p></p>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<p>What happens if there is an snaspshot created but there are no<br>
instances launched?<o:p></o:p></p>
<p>From: Razique Mahroua [mailto:<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><br>
Subject: Re: [Openstack] Removing unused images using Glance APIs<o:p></o:p></p>
<p>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<o:p></o:p></p>
<p>Razique<o:p></o:p></p>
<p>On 13 Nov 2013, at 15:47, Narayanan, Krishnaprasad wrote:<o:p></o:p></p>
<p>Hi<o:p></o:p></p>
<p>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?<o:p></o:p></p>
<p>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>]<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><br>
Subject: Re: [Openstack] Removing unused images using Glance APIs<o:p></o:p></p>
<p>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.<o:p></o:p></p>
<p>Razique<o:p></o:p></p>
<p>On Wednesday, November 13, 2013, Narayanan, Krishnaprasad wrote:<br>
Hallo All,<o:p></o:p></p>
<p>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?<o:p></o:p></p>
<p>Thanks,<br>
Krishnaprasad<o:p></o:p></p>
</blockquote>
</blockquote>
</blockquote>
</div>
</div>
</body>
</html>