<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Hey dude :)<div>Remember my doc.</div><div>In fact the main issue is not about the database state... it's about the ISCSI session that is lost after the node reboots.</div><div>Check out my drp script. It does handle that for you : </div><div><a href="https://github.com/Razique/BashStuff/blob/master/SYSTEMS/OpenStack/SCR_5006_V00_NUAC-OPENSTACK-DRP-OpenStack.sh">https://github.com/Razique/BashStuff/blob/master/SYSTEMS/OpenStack/SCR_5006_V00_NUAC-OPENSTACK-DRP-OpenStack.sh</a></div><div><br></div><div>There are much more better way, but that script saved me several times. the part you are looking for is here : </div><div><br></div><div><span class="Apple-style-span" style="line-height: 14px; "><pre style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font: normal normal normal 12px/normal 'Bitstream Vera Sans Mono', Courier, monospace; line-height: 1.4; "><div class="line" id="LC79" style="font-size: 12px; font-family: 'Bitstream Vera Sans Mono', Courier, monospace; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 1em; "><span class="s" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(221, 17, 68); ">                    use nova;</span></div><div class="line" id="LC80" style="font-size: 12px; font-family: 'Bitstream Vera Sans Mono', Courier, monospace; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 1em; "><span class="s" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(221, 17, 68); ">                   update volumes set mountpoint=NULL;</span></div><div class="line" id="LC81" style="font-size: 12px; font-family: 'Bitstream Vera Sans Mono', Courier, monospace; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 1em; "><span class="s" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(221, 17, 68); ">                 update volumes set status="available" where status <> "error_deleting";</span></div><div class="line" id="LC82" style="font-size: 12px; font-family: 'Bitstream Vera Sans Mono', Courier, monospace; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 1em; "><span class="s" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(221, 17, 68); ">                   update volumes set attach_status="detached";</span></div><div class="line" id="LC83" style="font-size: 12px; font-family: 'Bitstream Vera Sans Mono', Courier, monospace; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 1em; "><span class="s" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(221, 17, 68); ">                      update volumes set instance_id=0;       </span></div><div class="line" id="LC83" style="font-size: 12px; font-family: 'Bitstream Vera Sans Mono', Courier, monospace; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 1em; "><span class="s" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(221, 17, 68); "><br></span></div><div class="line" id="LC83" style="font-size: 12px; font-family: 'Bitstream Vera Sans Mono', Courier, monospace; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 1em; "><font class="Apple-style-span" color="#dd1144"><br></font></div><div class="line" id="LC83" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 1em; "><font class="Apple-style-span" face="'Lucida Grande'">The other way around would be to cron a script that saves the iscsi sessions, and after a reboot, and BEFORE the openstack services start, recreate the sessions.</font></div><div class="line" id="LC83" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 1em; "><font class="Apple-style-span" face="'Lucida Grande'">I'll try that and see if it's working on a long-term basis.</font></div><div class="line" id="LC83" style="font-size: 12px; font-family: 'Bitstream Vera Sans Mono', Courier, monospace; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 1em; "><font class="Apple-style-span" color="#dd1144"><br></font></div></pre></span><div><br></div><div apple-content-edited="true">
<span class="Apple-style-span" style="font-family: Helvetica; "><span class="Apple-style-span" style="font-family: Helvetica; "><b style="color: rgb(19, 112, 138); ">Nuage & Co - Razique Mahroua</b></span><span class="Apple-style-span" style="color: rgb(19, 112, 138); font-family: Helvetica; "><b> </b></span><span class="Apple-style-span" style="border-collapse: separate; font-family: Helvetica; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><span class="Apple-style-span" style="border-collapse: separate; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><span class="Apple-style-span" style="border-collapse: separate; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><div style="color: rgb(0, 0, 0); font-family: Helvetica; font-size: medium; font-weight: normal; font-style: normal; "><font class="Apple-style-span" color="#13708a"><a href="mailto:razique.mahroua@gmail.com">razique.mahroua@gmail.com</a></font></div></span><br class="Apple-interchange-newline"><span></span><span style="color: rgb(0, 0, 0); font-family: Helvetica; font-size: medium; font-weight: normal; font-style: normal; "></span><span style="color: rgb(0, 0, 0); font-weight: normal; "></span></span><span><img height="125" width="125" id="8ca51459-25e6-4181-9500-ee30a51957e8" apple-width="yes" apple-height="yes" src="cid:00E07450-433E-43E6-9005-48B8FD5C669F@la.fabrique"></span>
</span></span></div>
<br><div><div>Le 28 déc. 2011 à 08:23, DeadSun a écrit :</div><br class="Apple-interchange-newline"><blockquote type="cite">I have write a blog about re-attach<div><a href="http://livemoon.dyndns.org/life/2011/12/how-to-re-attach-volume-in-openstack-if-vm-down-since-of-host-down.html">http://livemoon.dyndns.org/life/2011/12/how-to-re-attach-volume-in-openstack-if-vm-down-since-of-host-down.html</a></div>
<div><br clear="all"><div>I think my way is stupid . Better way should exists.</div><div><br></div><div><div>The case is: </div><div>The vm using volume, and then host where vm is runnning down because some reason. After host up, we can reboot vm using "nova reboot <server>", but the disk(filesystem mounted) in vm will be lost. In novaclient, using "nova volume-list", it show volume status is still in-used by this vm. </div>
<div>At first, I want to detach it and re-attach it again. This way can work if we reboot vm in normal(host not down unexpectedly), but now it will show error like this:</div><div><b style="background-color:rgb(255,255,255)"><font color="#ff0000"><br>
</font></b></div><div><b style="background-color:rgb(255,255,255)"><font color="#ff0000">2011-12-28 14:30:08,269 AUDIT nova.compute.manager [661dae13-05ec-4365-9f44-15d9072e000a admin 1] Detach volume 6 from mountpoint /dev/vdb on instance 74</font></b></div>
<div><b style="background-color:rgb(255,255,255)"><font color="#ff0000">(nova.rpc): TRACE: DiskNotFound: No disk at vdb</font></b></div><div><br></div><div>I don't know how to write "vdb" to somewhere. But I think I can clear the database about it.</div>
<div>So following steps I do:</div><div><ul><li>update nova database, volumes table, found this vm, set mountpoint to NULL, set status='available' , set attach_status='detach'</li><li>logout iscsi volume in host where vm running, like this:</li>
</ul>             $ sudo iscsiadm -m node -T iqn.2010-10.org.openstack:volume-00000006 -p <a href="http://10.200.200.5:23260/">10.200.200.5:23260</a> --logout</div><div><ul><li>attach volume again using "nova volume-attach <server> <volume> /dev/vdb</li>
</ul></div></div><div> </div><div>It can work, but I want to know , is this way correct ?</div>-- <br>非淡薄无以明志,非宁静无以致远<br>
</div>
_______________________________________________<br>Mailing list: <a href="https://launchpad.net/~openstack">https://launchpad.net/~openstack</a><br>Post to     : <a href="mailto:openstack@lists.launchpad.net">openstack@lists.launchpad.net</a><br>Unsubscribe : <a href="https://launchpad.net/~openstack">https://launchpad.net/~openstack</a><br>More help   : <a href="https://help.launchpad.net/ListHelp">https://help.launchpad.net/ListHelp</a><br></blockquote></div><br></div></body></html>