<html dir="ltr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Windows-1252">
<style id="owaParaStyle" type="text/css">P {margin-top:0;margin-bottom:0;}</style>
</head>
<body ocsi="0" fpstyle="1">
<div style="direction: ltr;font-family: Verdana;color: #000000;font-size: 10pt;">
Guess that's a implementation detail. Depends on the way you go about using what's available now, I suppose.<br>
<div><br>
<div style="font-family:Tahoma; font-size:13px">Thanks,<br>
-Nikhil<br>
</div>
</div>
<div style="font-family: Times New Roman; color: #000000; font-size: 16px">
<hr tabindex="-1">
<div style="direction: ltr;" id="divRpF15539"><font face="Tahoma" color="#000000" size="2"><b>From:</b> Chris St. Pierre [chris.a.st.pierre@gmail.com]<br>
<b>Sent:</b> Wednesday, December 17, 2014 2:07 PM<br>
<b>To:</b> OpenStack Development Mailing List (not for usage questions)<br>
<b>Subject:</b> Re: [openstack-dev] [glance] Option to skip deleting images in use?<br>
</font><br>
</div>
<div></div>
<div>
<div dir="ltr">I was assuming atomic increment/decrement operations, in which case I'm not sure I see the race conditions. Or is atomism assuming too much?</div>
<div class="gmail_extra"><br>
<div class="gmail_quote">On Wed, Dec 17, 2014 at 11:59 AM, Nikhil Komawar <span dir="ltr">
<<a href="mailto:nikhil.komawar@rackspace.com" target="_blank">nikhil.komawar@rackspace.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex; border-left:1px #ccc solid; padding-left:1ex">
<div>
<div style="direction:ltr; font-family:Verdana; color:#000000; font-size:10pt">That looks like a decent alternative if it works. However, it would be too racy unless we we implement a test-and-set for such properties or there is a different job which queues
up these requests and perform sequentially for each tenant.<br>
<div><br>
<div style="font-family:Tahoma; font-size:13px">Thanks,<br>
-Nikhil<br>
</div>
</div>
<div style="font-family:Times New Roman; color:#000000; font-size:16px">
<hr>
<div style="direction:ltr"><font face="Tahoma" color="#000000"><span class=""><b>From:</b> Chris St. Pierre [<a href="mailto:chris.a.st.pierre@gmail.com" target="_blank">chris.a.st.pierre@gmail.com</a>]<br>
</span><b>Sent:</b> Wednesday, December 17, 2014 10:23 AM<span class=""><br>
<b>To:</b> OpenStack Development Mailing List (not for usage questions)<br>
<b>Subject:</b> Re: [openstack-dev] [glance] Option to skip deleting images in use?<br>
</span></font><br>
</div>
<div>
<div class="h5">
<div></div>
<div>
<div dir="ltr">That's unfortunately too simple. You run into one of two cases:
<div><br>
</div>
<div>1. If the job automatically removes the protected attribute when an image is no longer in use, then you lose the ability to use "protected" on images that are not in use. I.e., there's no way to say, "nothing is currently using this image, but please keep
it around." (This seems particularly useful for snapshots, for instance.)</div>
<div><br>
</div>
<div>2. If the job does not automatically remove the protected attribute, then an image would be protected if it had ever been in use; to delete an image, you'd have to manually un-protect it, which is a workflow that quite explicitly defeats the whole purpose
of flagging images as protected when they're in use.</div>
<div><br>
</div>
<div>It seems like flagging an image as *not* in use is actually a fairly difficult problem, since it requires consensus among all components that might be using images.</div>
<div><br>
</div>
<div>The only solution that readily occurs to me would be to add something like a filesystem link count to images in Glance. Then when Nova spawns an instance, it increments the usage count; when the instance is destroyed, the usage count is decremented. And
similarly with other components that use images. An image could only be deleted when its usage count was zero.</div>
<div><br>
</div>
<div>There are ample opportunities to get out of sync there, but it's at least a sketch of something that might work, and isn't *too* horribly hackish. Thoughts?</div>
</div>
<div class="gmail_extra"><br>
<div class="gmail_quote">On Tue, Dec 16, 2014 at 6:11 PM, Vishvananda Ishaya <span dir="ltr">
<<a href="mailto:vishvananda@gmail.com" target="_blank">vishvananda@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex; border-left:1px #ccc solid; padding-left:1ex">
A simple solution that wouldn’t require modification of glance would be a cron job<br>
that lists images and snapshots and marks them protected while they are in use.<br>
<br>
Vish<br>
<div>
<div><br>
On Dec 16, 2014, at 3:19 PM, Collins, Sean <<a href="mailto:Sean_Collins2@cable.comcast.com" target="_blank">Sean_Collins2@cable.comcast.com</a>> wrote:<br>
<br>
> On Tue, Dec 16, 2014 at 05:12:31PM EST, Chris St. Pierre wrote:<br>
>> No, I'm looking to prevent images that are in use from being deleted. "In<br>
>> use" and "protected" are disjoint sets.<br>
><br>
> I have seen multiple cases of images (and snapshots) being deleted while<br>
> still in use in Nova, which leads to some very, shall we say,<br>
> interesting bugs and support problems.<br>
><br>
> I do think that we should try and determine a way forward on this, they<br>
> are indeed disjoint sets. Setting an image as protected is a proactive<br>
> measure, we should try and figure out a way to keep tenants from<br>
> shooting themselves in the foot if possible.<br>
><br>
> --<br>
> Sean M. Collins<br>
> _______________________________________________<br>
> OpenStack-dev mailing list<br>
> <a href="mailto:OpenStack-dev@lists.openstack.org" target="_blank">OpenStack-dev@lists.openstack.org</a><br>
> <a href="http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev" target="_blank">
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev</a><br>
<br>
<br>
_______________________________________________<br>
OpenStack-dev mailing list<br>
<a href="mailto:OpenStack-dev@lists.openstack.org" target="_blank">OpenStack-dev@lists.openstack.org</a><br>
<a href="http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev" target="_blank">http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev</a><br>
</div>
</div>
</blockquote>
</div>
<br>
<br clear="all">
<div><br>
</div>
-- <br>
<div>Chris St. Pierre</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<br>
_______________________________________________<br>
OpenStack-dev mailing list<br>
<a href="mailto:OpenStack-dev@lists.openstack.org" target="_blank">OpenStack-dev@lists.openstack.org</a><br>
<a href="http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev" target="_blank">http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev</a><br>
<br>
</blockquote>
</div>
<br>
<br clear="all">
<div><br>
</div>
-- <br>
<div class="gmail_signature">Chris St. Pierre</div>
</div>
</div>
</div>
</div>
</body>
</html>