<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 12pt;
font-family:微软雅黑
}
--></style></head>
<body class='hmmessage'><div dir='ltr'><p class="ecxMsoNormal" align="left" style="line-height: 19.880001068115234px; margin-bottom: 1.35em; font-size: 10.5pt; font-family: Calibri, sans-serif; color: rgb(68, 68, 68);"><span lang="EN-US" style="line-height: 18.933332443237305px; font-size: 10pt; font-family: 宋体; color: black;">According to some further analysis, I tend to consider what I found out as a bug now...</span></p><p class="ecxMsoNormal" align="left" style="line-height: 19.880001068115234px; margin-bottom: 1.35em; font-size: 10.5pt; font-family: Calibri, sans-serif; color: rgb(68, 68, 68);"><span lang="EN-US" style="line-height: 18.933332443237305px; font-size: 10pt; font-family: 宋体; color: black;"> </span></p><p class="ecxMsoNormal" align="left" style="line-height: 19.880001068115234px; margin-bottom: 1.35em; font-size: 10.5pt; font-family: Calibri, sans-serif; color: rgb(68, 68, 68);"><span lang="EN-US" style="line-height: 18.933332443237305px; font-size: 10pt; font-family: 宋体; color: black;">The execution flow of attaching a volume to an instance can be decoupled as the following steps:</span></p><p class="ecxMsoNormal" align="left" style="line-height: 19.880001068115234px; margin-bottom: 1.35em; font-size: 10.5pt; font-family: Calibri, sans-serif; color: rgb(68, 68, 68);"><span lang="EN-US" style="line-height: 18.933332443237305px; font-size: 10pt; font-family: 宋体; color: black;"> </span></p><p class="ecxMsoNormal" align="left" style="line-height: 19.880001068115234px; margin-bottom: 1.35em; font-size: 10.5pt; font-family: Calibri, sans-serif; color: rgb(68, 68, 68);"><span lang="EN-US" style="line-height: 18.933332443237305px; font-size: 10pt; font-family: 宋体; color: black;">Step 1. Nova to Cinder: Volume reservation                  Volume status: attaching</span></p><p class="ecxMsoNormal" align="left" style="line-height: 19.880001068115234px; margin-bottom: 1.35em; font-size: 10.5pt; font-family: Calibri, sans-serif; color: rgb(68, 68, 68);"><span lang="EN-US" style="line-height: 18.933332443237305px; font-size: 10pt; font-family: 宋体; color: black;">Step 2. Nova to Cinder: Connection initialization                 Volume status: attaching</span></p><p class="ecxMsoNormal" align="left" style="line-height: 19.880001068115234px; margin-bottom: 1.35em; font-size: 10.5pt; font-family: Calibri, sans-serif; color: rgb(68, 68, 68);"><span lang="EN-US" style="line-height: 18.933332443237305px; font-size: 10pt; font-family: 宋体; color: black;">Step 3. Nova: Volume protocol checking                    Volume status: attaching</span></p><p class="ecxMsoNormal" align="left" style="line-height: 19.880001068115234px; margin-bottom: 1.35em; font-size: 10.5pt; font-family: Calibri, sans-serif; color: rgb(68, 68, 68);"><span lang="EN-US" style="line-height: 18.933332443237305px; font-size: 10pt; font-family: 宋体; color: black;">Step 4. Nova connects to cinder-volume volume                Volume status: attaching</span></p><p class="ecxMsoNormal" align="left" style="line-height: 19.880001068115234px; margin-bottom: 1.35em; font-size: 10.5pt; font-family: Calibri, sans-serif; color: rgb(68, 68, 68);"><span lang="EN-US" style="line-height: 18.933332443237305px; font-size: 10pt; font-family: 宋体; color: black;">Step 5. Nova adds a volume to a VM via libvirt. The VM can access this volume from now on. </span></p><p class="ecxMsoNormal" align="left" style="line-height: 19.880001068115234px; margin-bottom: 1.35em; font-size: 10.5pt; font-family: Calibri, sans-serif; color: rgb(68, 68, 68);"><span lang="EN-US" style="line-height: 18.933332443237305px; font-size: 10pt; font-family: 宋体; color: black;">                                                                     Volume status: attaching (<b>but we can do "force delete" now!!</b>)</span></p><p class="ecxMsoNormal" align="left" style="line-height: 19.880001068115234px; margin-bottom: 1.35em; font-size: 10.5pt; font-family: Calibri, sans-serif; color: rgb(68, 68, 68);"><span lang="EN-US" style="line-height: 18.933332443237305px; font-size: 10pt; font-family: 宋体; color: black;">Step 6. Nova to Cinder: Volume attaching and volume status update    Volume status: attached</span></p><p class="ecxMsoNormal" align="left" style="line-height: 19.880001068115234px; margin-bottom: 1.35em; font-size: 10.5pt; font-family: Calibri, sans-serif; color: rgb(68, 68, 68);"><span lang="EN-US" style="line-height: 18.933332443237305px; font-size: 10pt; font-family: 宋体; color: black;"> </span></p><p class="ecxMsoNormal" align="left" style="line-height: 19.880001068115234px; margin-bottom: 1.35em; font-size: 10.5pt; font-family: Calibri, sans-serif; color: rgb(68, 68, 68);"><span lang="EN-US" style="line-height: 18.933332443237305px; font-size: 10pt; font-family: 宋体; color: black;">To verify that, I tested Nova and Cinder by force deleting a volume being attached to an instance and in "attaching" status.</span></p><p class="ecxMsoNormal" align="left" style="line-height: 19.880001068115234px; margin-bottom: 1.35em; font-size: 10.5pt; font-family: Calibri, sans-serif; color: rgb(68, 68, 68);"><span lang="EN-US" style="line-height: 18.933332443237305px; font-size: 10pt; font-family: 宋体; color: black;">After the volume is deleted, Disk IO errors just happened (I used "fdisk -l" to test it). A screen snapshot is attached below.</span></p><div style="display: inline-block" id="inlineImage0"><!--tmpl() _44--><span contenteditable="true"> </span><div style="display: inline-block" contenteditable="false" class="inlineImage" initheight="242" initwidth="553"><img src="cid:inlineImage0" height="242" width="553"></div><span contenteditable="true"> </span><!--/tmpl--></div><br><p class="ecxMsoNormal" align="left" style="line-height: 19.880001068115234px; margin-bottom: 1.35em; font-size: 10.5pt; font-family: Calibri, sans-serif; color: rgb(68, 68, 68);"><span lang="EN-US" style="line-height: 18.933332443237305px; font-size: 10pt; font-family: 宋体; color: black;"> </span></p><p class="ecxMsoNormal" align="left" style="line-height: 19.880001068115234px; margin-bottom: 1.35em; font-size: 10.5pt; font-family: Calibri, sans-serif; color: rgb(68, 68, 68);"><span lang="EN-US" style="line-height: 18.933332443237305px; font-size: 10pt; font-family: 宋体; color: black;">Moreover, disk info was still left as below:</span></p><div style="display: inline-block" id="inlineImage1"><!--tmpl() _44--><span contenteditable="true"> </span><div style="display: inline-block" contenteditable="false" class="inlineImage" initheight="54" initwidth="841"><img src="cid:inlineImage1" height="54" width="841"></div><span contenteditable="true"> </span><!--/tmpl--></div><br><p class="ecxMsoNormal" align="left" style="line-height: 19.880001068115234px; margin-bottom: 1.35em; font-size: 10.5pt; font-family: Calibri, sans-serif; color: rgb(68, 68, 68);"><span lang="EN-US" style="line-height: 18.933332443237305px; font-size: 10pt; font-family: 宋体; color: black;">Therefore, I think a "force delete" operation to a volume in "attaching" status is really risky. We need to get it fixed.</span></p><p class="ecxMsoNormal" align="left" style="line-height: 19.880001068115234px; margin-bottom: 1.35em; font-size: 10.5pt; font-family: Calibri, sans-serif; color: rgb(68, 68, 68);"><span lang="EN-US" style="line-height: 18.933332443237305px; font-size: 10pt; font-family: 宋体; color: black;"><br></span></p><p class="ecxMsoNormal" align="left" style="margin-bottom: 1.35em;"><font face="宋体" size="2"><span style="line-height: 18.933332443237305px;">Thanks!</span></font></p><div><hr id="stopSpelling">From: zhangyu11@huawei.com<br>To: openstack-dev@lists.openstack.org<br>Date: Wed, 26 Feb 2014 00:56:17 +0000<br>Subject: Re: [openstack-dev] [Cinder] [Nova]Do you think volume force delete operation should not apply to the volume being used?<br><br>



<style><!--
.ExternalClass p.ecxMsoNormal, .ExternalClass li.ecxMsoNormal, .ExternalClass div.ecxMsoNormal {
font-size:12.0pt;
font-family:SimSun;
}

.ExternalClass a:link, .ExternalClass span.ecxMsoHyperlink {
color:blue;
text-decoration:underline;
}

.ExternalClass span.ecxMsoHyperlinkFollowed {
color:purple;
text-decoration:underline;
}

.ExternalClass p {
font-size:12.0pt;
font-family:SimSun;
}

.ExternalClass span.ecxtextrun {
}

.ExternalClass span.ecxeop {
}

.ExternalClass span.ecxlinebreakblob {
}

.ExternalClass span.ecxscx96661126 {
}

.ExternalClass span.ecxEmailStyle22 {
font-family:"Calibri","sans-serif";
color:#1F497D;
}

.ExternalClass .ecxMsoChpDefault {
font-size:10.0pt;
}

.ExternalClass div.ecxWordSection1 {
}

--></style>


<div class="ecxWordSection1">
<p class="ecxMsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1F497D;">If I understand your question correctly, the case you describe should be like the following:</span></p>
<p class="ecxMsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1F497D;"> </span></p>
<p class="ecxMsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1F497D;">Assume we have created both an instance and a volume, then we try to  attach that volume to the instance.</span></p>
<p class="ecxMsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1F497D;">Before that operation is completed (the status of the volume is “attaching” now), for whatever reasons we decide to apply a “force delete” operation
 on that volume.</span></p>
<p class="ecxMsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1F497D;">Then, after we applied that force delete, we come to see that, from the Cinder side, the volume has been successfully deleted and the status is
 surely “deleted”.</span></p>
<p class="ecxMsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1F497D;">However, from the Nova side, we see that the status of the deleted volume remains to be “attaching”.</span></p>
<p class="ecxMsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1F497D;"> </span></p>
<p class="ecxMsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1F497D;">If this is truly your case, I think it is a bug. The reason might lie in that, Cinder forgets to refresh the attach_status attribute of a volume
 in DB when applying a “force delete” operation.</span></p>
<p class="ecxMsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1F497D;">Is there any other suggestions?</span></p>
<p class="ecxMsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1F497D;"> </span></p>
<p class="ecxMsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1F497D;">Thanks!</span></p>
<p class="ecxMsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1F497D;"> </span></p>
<p class="ecxMsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1F497D;"> </span></p>
<p class="ecxMsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1F497D;"> </span></p>
<div>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm;">
<p class="ecxMsoNormal"><b><span lang="EN-US" style="font-size:10.0pt;font-family:"Tahoma","sans-serif";">From:</span></b><span lang="EN-US" style="font-size:10.0pt;font-family:"Tahoma","sans-serif";"> yunling [mailto:yunlingzeng@hotmail.com]
<br>
<b>Sent:</b> Monday, February 17, 2014 9:14 PM<br>
<b>To:</b> openstack-dev@lists.openstack.org<br>
<b>Subject:</b> [openstack-dev] [Cinder]Do you think volume force delete operation should not apply to the volume being used?</span></p>
</div>
</div>
<p class="ecxMsoNormal"><span lang="EN-US"> </span></p>
<div>
<div>
<p class="ecxMsoNormal" style="vertical-align:baseline;"><span class="ecxtextrun"><span lang="EN-US" style="font-size:14.0pt;font-family:"Segoe UI","sans-serif";">Hi stackers:</span></span><span class="ecxeop"><span lang="EN-US" style="font-size:14.0pt;font-family:"Segoe UI","sans-serif";"> </span></span><span lang="EN-US" style="font-size:6.0pt;"></span></p>
</div>
<div>
<p class="ecxMsoNormal" style="vertical-align:baseline;word-wrap:break-word;"><span class="ecxscx96661126"><span lang="EN-US" style="font-size:11.0pt;"> </span></span><span lang="EN-US" style="font-size:11.0pt;"><br>
<span class="ecxeop"> </span></span><span lang="EN-US" style="font-size:6.0pt;"></span></p>
</div>
<div>
<p class="ecxMsoNormal" style="vertical-align:baseline;word-wrap:break-word;"><span class="ecxtextrun"><span lang="EN-US" style="font-size:14.0pt;font-family:"Segoe UI","sans-serif";">I found that volume status become inconsistent (nova volume status is attaching,
 verus cinder volume status is deleted) between nova and cinder when doing volume force delete operation on an attaching volume.</span></span><span class="ecxeop"><span lang="EN-US" style="font-size:14.0pt;font-family:"Segoe UI","sans-serif";"> </span></span><span lang="EN-US" style="font-size:6.0pt;"></span></p>
</div>
<div>
<p class="ecxMsoNormal" style="vertical-align:baseline;word-wrap:break-word;"><span class="ecxtextrun"><span lang="EN-US" style="font-size:14.0pt;font-family:"Segoe UI","sans-serif";">I think volume force delete operation should not apply to the volume being used,
 which included the attached status of attaching, attached and detached.</span></span><span class="ecxeop"><span lang="EN-US" style="font-size:14.0pt;font-family:"Segoe UI","sans-serif";"> </span></span><span lang="EN-US" style="font-size:6.0pt;"></span></p>
</div>
<div>
<p class="ecxMsoNormal" style="vertical-align:baseline;word-wrap:break-word;"><span class="ecxscx96661126"><span lang="EN-US" style="font-size:11.0pt;"> </span></span><span lang="EN-US" style="font-size:11.0pt;"><br>
<span class="ecxeop"> </span></span><span lang="EN-US" style="font-size:6.0pt;"></span></p>
</div>
<div>
<p class="ecxMsoNormal" style="vertical-align:baseline;word-wrap:break-word;"><span class="ecxtextrun"><span lang="EN-US" style="font-size:14.0pt;font-family:"Segoe UI","sans-serif";">How do you think?</span></span><span class="ecxeop"><span lang="EN-US" style="font-size:14.0pt;font-family:"Segoe UI","sans-serif";"> </span></span><span lang="EN-US" style="font-size:6.0pt;"></span></p>
</div>
<div>
<p class="ecxMsoNormal" style="vertical-align:baseline;word-wrap:break-word;"><span lang="EN-US" style="font-size:6.0pt;"> </span></p>
<p class="ecxMsoNormal" style="vertical-align:baseline;word-wrap:break-word;"><span lang="EN-US" style="font-size:6.0pt;"> </span></p>
</div>
<div>
<p class="ecxMsoNormal" style="vertical-align:baseline;word-wrap:break-word;"><span class="ecxtextrun"><span lang="EN-US" style="font-size:14.0pt;font-family:"Segoe UI","sans-serif";">thanks</span></span><span lang="EN-US" style="font-size:6.0pt;"></span></p>
</div>
</div>
</div>


<br>_______________________________________________
OpenStack-dev mailing list
OpenStack-dev@lists.openstack.org
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev</div>                                     </div></body>
</html>