<html dir="ltr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Windows-1252">
<style>
<!--
@font-face
        {font-family:SimSun}
@font-face
        {font-family:"Cambria Math"}
@font-face
        {font-family:Calibri}
@font-face
        {font-family:Tahoma}
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif}
a:link, span.MsoHyperlink
        {color:#0563C1;
        text-decoration:underline}
a:visited, span.MsoHyperlinkFollowed
        {color:#954F72;
        text-decoration:underline}
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
        {margin-top:0in;
        margin-right:0in;
        margin-bottom:0in;
        margin-left:.5in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif}
p.msochpdefault, li.msochpdefault, div.msochpdefault
        {margin-right:0in;
        margin-left:0in;
        font-size:12.0pt;
        font-family:"Calibri",sans-serif}
span.emailstyle17
        {font-family:"Calibri",sans-serif;
        color:windowtext}
span.EmailStyle20
        {font-family:"Calibri",sans-serif;
        color:#1F497D}
span.EmailStyle21
        {font-family:"Calibri",sans-serif;
        color:windowtext}
.MsoChpDefault
        {font-size:10.0pt;
        font-family:"Calibri",sans-serif}
@page WordSection1
        {margin:1.0in 1.0in 1.0in 1.0in}
-->
</style><style type="text/css" id="owaParaStyle"></style>
</head>
<body lang="EN-US" link="#0563C1" vlink="#954F72" fpstyle="1" ocsi="0">
<div style="direction: ltr;font-family: Tahoma;color: #000000;font-size: 10pt;">I think you are missing a glance_store patch for starlingx: https://github.com/openstack/stx-upstream/blob/master/openstack/python-glance-store/centos/patches/0001-Check-ceph-cluster-free-space-before-creating-image.patch
<div><br>
</div>
<div>This patch added aditional checks for ceph space requirments.</div>
<div><br>
</div>
<div>I am saying this due to how you described the "self._create_image function" where it is missing a parameter added by the above patch.</div>
<div><br>
</div>
<div>In our use-case, the image-size was always passed to the rbd driver code, so the resize function (which is only called when the size is zero) was never called.</div>
<div><br>
</div>
<div>How the algorithm should work:</div>
<div>- grab the size of the image that is about to be uploaded (we tested this through cli and horizon)</div>
<div>- before uploading any data, check that ceph actually has space for that data</div>
<div>- only after the check passes, we actually begin writing data to ceph</div>
<div><br>
</div>
<div>We did this, because ceph actually blocked almost completely when a pool was full, requiring manual intervention to recover.</div>
<div><br>
</div>
<div>The LVM backend behaved properly in such cases, so no fix was written for that.</div>
<div><br>
<div>
<div style="font-family: Times New Roman; color: #000000; font-size: 16px">
<hr tabindex="-1">
<div id="divRpF510174" style="direction: ltr;"><font face="Tahoma" size="2" color="#000000"><b>From:</b> Fang, Liang A [liang.a.fang@intel.com]<br>
<b>Sent:</b> Tuesday, November 13, 2018 5:23 PM<br>
<b>To:</b> Dinescu, Stefan; Badea, Daniel<br>
<b>Cc:</b> starlingx-discuss@lists.starlingx.io<br>
<b>Subject:</b> RE: [Starlingx-discuss] [glance] Analysis of patch c73ab48 (Enhanced-error-messages) for StartlingX upstreaming<br>
</font><br>
</div>
<div></div>
<div>
<div class="WordSection1">
<p class="MsoNormal"><span style="color:#1F497D">Hi Stefan</span></p>
<p class="MsoNormal"><span style="color:#1F497D"> </span></p>
<p class="MsoNormal"><span style="color:#1F497D">I take a look at this issue today, the hang happened inside ceph. So I modified ceph code (function resize) to just raise exception rbd.NoSpace at the entry of the function. This issue can be simulated now.</span></p>
<p class="MsoNormal"><span style="color:#1F497D"> </span></p>
<p class="MsoNormal"><span style="color:#1F497D">Regarding this patch, as I said previously, rbd (ceph) is just one type of the multiple types of backend, so I prefer to catch the rbd.NoSpace in glance_store (rbd.py), handle the exception there, and then re-raise
 a more common exception (StorageFull) to glance. Do you think this makes sense? If so, I will close the review in glance, and create a new review in glance_store.</span></p>
<p class="MsoNormal"><span style="color:#1F497D"> </span></p>
<p class="MsoNormal"><span style="color:#1F497D">Regards</span></p>
<p class="MsoNormal"><span style="color:#1F497D">Liang</span></p>
<div>
<div style="border:none; border-top:solid #E1E1E1 1.0pt; padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><a name="_____replyseparator"></a><b>From:</b> Dinescu, Stefan [mailto:Stefan.Dinescu@windriver.com]
<br>
<b>Sent:</b> Monday, November 12, 2018 10:13 PM<br>
<b>To:</b> Fang, Liang A <liang.a.fang@intel.com>; Badea, Daniel <Daniel.Badea@windriver.com><br>
<b>Cc:</b> starlingx-discuss@lists.starlingx.io<br>
<b>Subject:</b> RE: [Starlingx-discuss] [glance] Analysis of patch c73ab48 (Enhanced-error-messages) for StartlingX upstreaming</p>
</div>
</div>
<p class="MsoNormal"> </p>
<div>
<p class="MsoNormal"><span style="font-size:10.0pt; font-family:"Tahoma",sans-serif; color:black">Hello,
</span></p>
<div>
<p class="MsoNormal"><span style="font-size:10.0pt; font-family:"Tahoma",sans-serif; color:black"> </span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:10.0pt; font-family:"Tahoma",sans-serif; color:black">I havent' tested that part of the code in some time now, but from what I remember it was part of a larger set of changes to prevent ceph from hanging if not enough
 space was available.</span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:10.0pt; font-family:"Tahoma",sans-serif; color:black"> </span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:10.0pt; font-family:"Tahoma",sans-serif; color:black">How it should work (but as I said, I haven't tested this in some time):</span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:10.0pt; font-family:"Tahoma",sans-serif; color:black">-  decrease the glance image pool quota (this is just so it's easier to test)</span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:10.0pt; font-family:"Tahoma",sans-serif; color:black">-  upload images to glance until space if almost full</span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:10.0pt; font-family:"Tahoma",sans-serif; color:black">- the image that would have filled the pool should fail to upload entirely.</span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:10.0pt; font-family:"Tahoma",sans-serif; color:black"> </span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:10.0pt; font-family:"Tahoma",sans-serif; color:black">It seems you are doing the correct procedure from what you described, so this probably requires a more in-depth investigation to see why it fails.</span></p>
<div>
<div class="MsoNormal" align="center" style="text-align:center"><span style="font-size:12.0pt; font-family:"Times New Roman",serif; color:black">
<hr size="2" width="100%" align="center">
</span></div>
<div id="divRpF493901">
<p class="MsoNormal" style="margin-bottom:12.0pt"><b><span style="font-size:10.0pt; font-family:"Tahoma",sans-serif; color:black">From:</span></b><span style="font-size:10.0pt; font-family:"Tahoma",sans-serif; color:black"> Fang, Liang A [liang.a.fang@intel.com]<br>
<b>Sent:</b> Saturday, November 10, 2018 11:23 AM<br>
<b>To:</b> Badea, Daniel; Dinescu, Stefan<br>
<b>Cc:</b> <a href="mailto:starlingx-discuss@lists.starlingx.io" target="_blank" rel="noopener noreferrer">
starlingx-discuss@lists.starlingx.io</a><br>
<b>Subject:</b> [Starlingx-discuss] [glance] Analysis of patch c73ab48 (Enhanced-error-messages) for StartlingX upstreaming</span><span style="font-size:12.0pt; font-family:"Times New Roman",serif; color:black"></span></p>
</div>
<div>
<div>
<p class="MsoNormal"><span style="color:black">Hi Daniel and Stefan</span></p>
<p class="MsoNormal"><span style="color:black"> </span></p>
<p class="MsoNormal"><span style="color:black">Please refer to <a href="https://review.openstack.org/#/c/616880/" target="_blank" rel="noopener noreferrer">
https://review.openstack.org/#/c/616880/</a></span></p>
<p class="MsoNormal"><span style="color:black">This patch is to provide detailed exception info when no space in rbd. But in my environment, if rbd has no space, the function call to rbd will not return, there’s no exception raised.</span></p>
<p class="MsoNormal"><span style="color:black"> </span></p>
<p class="MsoNormal"><span style="color:black">Details:</span></p>
<p class="MsoNormal"><span style="color:black">In /usr/local/lib/python2.7/dist-packages/glance_store/_drivers/rbd.py</span></p>
<p class="MsoListParagraph" style="text-indent:-.25in"><span style="color:black">-</span><span style="font-size:7.0pt; font-family:"Times New Roman",serif; color:black">         
</span><span style="color:black">Function call will hang at line 484 (_create_image) if no space to create image at the beginning</span></p>
<p class="MsoNormal" style="text-indent:.5in"><span style="color:black"><img id="Picture_x0020_1" src="cid:image001.png@01D47B9B.E0DB9020" height="27" width="599" border="0"></span></p>
<p class="MsoListParagraph" style="text-indent:-.25in"><span style="color:black">-</span><span style="font-size:7.0pt; font-family:"Times New Roman",serif; color:black">         
</span><span style="color:black">Function call will hang at line 506 (image.resize) if no space at the middle of uploading.</span></p>
<p class="MsoListParagraph"><span style="color:black"><img id="Picture_x0020_2" src="cid:image002.png@01D47B9B.E0DB9020" height="17" width="437" border="0"></span></p>
<p class="MsoNormal"><span style="color:black"> </span></p>
<p class="MsoNormal"><span style="color:black">Could you please give some clue to reproduce this patch (raise rbd.NoSpace)?</span></p>
<p class="MsoNormal"><span style="color:black">Couple of other thought:</span></p>
<p class="MsoListParagraph" style="text-indent:-.25in"><span style="color:black">1.</span><span style="font-size:7.0pt; font-family:"Times New Roman",serif; color:black">      
</span><span style="color:black">This patch is to catch exception at v1 api, but v1 is about to be removed by community.</span></p>
<p class="MsoListParagraph" style="text-indent:-.25in"><span style="color:black">2.</span><span style="font-size:7.0pt; font-family:"Times New Roman",serif; color:black">      
</span><span style="color:black">rbd is just one type of the multiple types of backend, so I think catch specific backend’s exception at a common code is not so good. glance_store/rbd.py may be the better place to catch this exception. In fact rbd.py already
 did similar thing, see:</span></p>
<p class="MsoListParagraph"><span style="color:black"><img id="Picture_x0020_3" src="cid:image003.png@01D47B9B.E0DB9020" height="90" width="565" border="0"></span></p>
<p class="MsoNormal"><span style="color:black"> </span></p>
<p class="MsoNormal"><span style="color:black">Thanks</span></p>
<p class="MsoNormal"><span style="color:black">Liang</span></p>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>