<div dir="auto"><div>Dear lee,</div><div dir="auto"><br></div><div dir="auto">Thank you for your reply. We will try this solution by changing db. </div><div dir="auto"><br></div><div dir="auto">Regards,</div><div dir="auto">Munna<br><br><div class="gmail_quote" dir="auto"><div dir="ltr" class="gmail_attr">On Wed, 17 Mar 2021, 16:29 Lee Yarwood, <<a href="mailto:lyarwood@redhat.com">lyarwood@redhat.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On Mon, 15 Mar 2021 at 15:38, Md. Hejbul Tawhid MUNNA<br>
<<a href="mailto:munnaeebd@gmail.com" target="_blank" rel="noreferrer">munnaeebd@gmail.com</a>> wrote:<br>
><br>
> Hi,<br>
><br>
> We are using openstack rocky.<br>
><br>
> One of our openstack vm was running with 3 volume ,  1 is bootable and another 2 is normal volume . We have deleted 1 normal volume without properly detaching.<br>
><br>
> So volume is deleted but instance is still showing 3 volume is attached. Now we can't snapshot the instance and facing some others issue.<br>
><br>
> Please advise how we can detach the volume(deleted) from the instance<br>
><br>
> Note: We have reset state volume attached status to detached and delete the volume.<br>
<br>
Ewww I wish we made this harder. Please try to avoid resetting states<br>
like this unless you really have to.<br>
<br>
The cleanest way of detaching the volume from the instance is going to<br>
be to mark the volume attachment as deleted within the Nova database<br>
and hard rebooting the instance.<br>
<br>
$ mysql nova_cell1<br>
MariaDB [nova_cell1]> update block_device_mapping set deleted = id<br>
where volume_id = '$volume_id' and instance_uuid = '$instance_uuid';<br>
<br>
Confirm the volume is no longer listed as attached and then hard reboot:<br>
<br>
$ openstack server volume list $instance<br>
$ openstack server reboot --hard $instance<br>
<br>
Depending on your volume backend you will likely need to manually<br>
clean up any now stale volume connections on the host. For example,<br>
deleting any mpath devices etc. You might want to consider a full<br>
compute host reboot to ensure things are clean.<br>
<br>
Anyway, hope this helps,<br>
<br>
Lee<br>
<br>
</blockquote></div></div></div>