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>