<div dir="ltr"><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Jul 25, 2014 at 2:03 AM, zhangtralon <span dir="ltr"><<a href="mailto:ztralon@hotmail.com" target="_blank">ztralon@hotmail.com</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">


<div><div dir="ltr"><p style="margin-bottom:1.2em;width:auto;max-width:45em;color:rgb(51,51,51);font-family:monospace;font-size:12px;line-height:18px;background-color:rgb(255,255,255)">Hi</p><p style="margin-bottom:1.2em;width:auto;max-width:45em;color:rgb(51,51,51);font-family:monospace;font-size:12px;line-height:18px;background-color:rgb(255,255,255)">

Here,there is a problem to discuss with you.</p></div></div></blockquote><div><br></div><div>This sounds like a bug. We use <a href="https://bugs.launchpad.net/nova/">https://bugs.launchpad.net/nova/</a> to track bugs and discuss possible solutions etc.</div>

<div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div><div dir="ltr"><p style="margin-bottom:1.2em;width:auto;max-width:45em;color:rgb(51,51,51);font-family:monospace;font-size:12px;line-height:18px;background-color:rgb(255,255,255)">

<b>Problem:</b> a volume may leave over when we delete an instance</p><p style="margin-bottom:1.2em;width:auto;max-width:45em;color:rgb(51,51,51);font-family:monospace;font-size:12px;line-height:18px;background-color:rgb(255,255,255)">

   </p><p style="margin-bottom:1.2em;width:auto;max-width:45em;color:rgb(51,51,51);font-family:monospace;font-size:12px;line-height:18px;background-color:rgb(255,255,255)"><b>Description</b>:Here, two scenes may cause that a volume is legacy when we delete instance whose task_state is block_device_<u></u>mapping .The first scene is that using the boot volume created by image creates instance; The other scene is that using image create instance with a volume created through a image.</p>

<p style="margin-bottom:1.2em;width:auto;max-width:45em;color:rgb(51,51,51);font-family:monospace;font-size:12px;line-height:18px;background-color:rgb(255,255,255)"><br></p><p style="margin-bottom:1.2em;width:auto;max-width:45em;color:rgb(51,51,51);font-family:monospace;font-size:12px;line-height:18px;background-color:rgb(255,255,255)">

<b>Reason:</b>Through analyzing, we find that the volume id is not update to block_device_<u></u>mapping table in DB until a volume created by an image through setting parameters in Blocking Device Mapping v2 is attached to an instance completely.If we delete the instance before the volume id is not update to the block_device_<u></u>mapping table, the problem mentioned above will occur.</p>

<p style="margin-bottom:1.2em;width:auto;max-width:45em;color:rgb(51,51,51);font-family:monospace;font-size:12px;line-height:18px;background-color:rgb(255,255,255)"><br></p><p style="margin-bottom:1.2em;width:auto;max-width:45em;background-color:rgb(255,255,255)">

<font color="#333333" face="monospace"><span style="font-size:12px;line-height:18px">Although the reason of the problem is found, I want to discuss the solution about it with you   </span></font></p><p style="margin-bottom:1.2em;width:auto;max-width:45em;color:rgb(51,51,51);font-family:monospace;font-size:12px;line-height:18px;background-color:rgb(255,255,255)">

<br></p><p style="margin-bottom:1.2em;width:auto;max-width:45em;color:rgb(51,51,51);font-family:monospace;font-size:12px;line-height:18px;background-color:rgb(255,255,255)">Two examples to reproduce the problem on latest icehousce:<br>

1. the first scene<br>(1)root@devstack:~# nova list<br>+----+-<u></u>-----+-<u></u>-------<u></u>+------<u></u>------+<u></u>-------<u></u>------+<u></u>-------<u></u>---+<br>| ID | Name | Status | Task State | Power State | Networks |<br>

+----+-<u></u>-----+-<u></u>-------<u></u>+------<u></u>------+<u></u>-------<u></u>------+<u></u>-------<u></u>---+<br>+----+-<u></u>-----+-<u></u>-------<u></u>+------<u></u>------+<u></u>-------<u></u>------+<u></u>-------<u></u>---+<br>

(2)root@devstack:~# nova boot --flavor m1.tiny --block-device id=61ebee75-<u></u>5883-49a3-<u></u>bf85-ad6f6c29fc<u></u>1b,source=<u></u>image,dest=<u></u>volume,<u></u>device=<u></u>vda,size=<u></u>1,shutdown=<u></u>removed,<u></u>bootindex=<u></u>0 --nic net-id=<u></u>354ba9ac-<u></u>e6a7-4fd6-<u></u>a49f-6ae18a815e<u></u>95 tralon_test<br>

root@devstack:~# nova list<br>+------<u></u>-------<u></u>-------<u></u>-------<u></u>-------<u></u>----+--<u></u>-------<u></u>----+--<u></u>------+<u></u>-------<u></u>-------<u></u>-------<u></u>-+-----<u></u>-------<u></u>-+-----<u></u>-------<u></u>-------<u></u>+<br>

| ID | Name | Status | Task State | Power State | Networks |<br>+------<u></u>-------<u></u>-------<u></u>-------<u></u>-------<u></u>----+--<u></u>-------<u></u>----+--<u></u>------+<u></u>-------<u></u>-------<u></u>-------<u></u>-+-----<u></u>-------<u></u>-+-----<u></u>-------<u></u>-------<u></u>+<br>

| 57cbb39d-<u></u>c93f-44eb-<u></u>afda-9ce0011095<u></u>0d | tralon_test | BUILD | block_device_<u></u>mapping | NOSTATE | private=10.0.0.20 |<br>+------<u></u>-------<u></u>-------<u></u>-------<u></u>-------<u></u>----+--<u></u>-------<u></u>----+--<u></u>------+<u></u>-------<u></u>-------<u></u>-------<u></u>-+-----<u></u>-------<u></u>-+-----<u></u>-------<u></u>-------<u></u>+<br>

(3)root@devstack:~# nova delete tralon_test<br>root@devstack:~# nova list<br>+----+-<u></u>-----+-<u></u>-------<u></u>+------<u></u>------+<u></u>-------<u></u>------+<u></u>-------<u></u>---+<br>| ID | Name | Status | Task State | Power State | Networks |<br>

+----+-<u></u>-----+-<u></u>-------<u></u>+------<u></u>------+<u></u>-------<u></u>------+<u></u>-------<u></u>---+<br>+----+-<u></u>-----+-<u></u>-------<u></u>+------<u></u>------+<u></u>-------<u></u>------+<u></u>-------<u></u>---+<br>

(4) root@devstack:~# cinder list<br>+------<u></u>-------<u></u>-------<u></u>-------<u></u>-------<u></u>----+--<u></u>-------<u></u>--+----<u></u>--+----<u></u>--+----<u></u>-------<u></u>--+----<u></u>------+<u></u>-------<u></u>-------<u></u>-------<u></u>-------<u></u>-------<u></u>---+<br>

| ID | Status | Name | Size | Volume Type | Bootable | Attached to |<br>+------<u></u>-------<u></u>-------<u></u>-------<u></u>-------<u></u>----+--<u></u>-------<u></u>--+----<u></u>--+----<u></u>--+----<u></u>-------<u></u>--+----<u></u>------+<u></u>-------<u></u>-------<u></u>-------<u></u>-------<u></u>-------<u></u>---+<br>

| 3e5579a9-<u></u>5aac-42b6-<u></u>9885-441e861f6c<u></u>c0 | available | None | 1 | None | false | |<br>| a4121322-<u></u>529b-4223-<u></u>ac26-0f569dc782<u></u>1e | available | | 1 | None | true | |<br>| a7ad846b-<u></u>8638-40c1-<u></u>be42-f2816638a9<u></u>17 | in-use | | 1 | None | true | 57cbb39d-<u></u>c93f-44eb-<u></u>afda-9ce0011095<u></u>0d |<br>

+------<u></u>-------<u></u>-------<u></u>-------<u></u>-------<u></u>----+--<u></u>-------<u></u>--+----<u></u>--+----<u></u>--+----<u></u>-------<u></u>--+----<u></u>------+<u></u>-------<u></u>-------<u></u>-------<u></u>-------<u></u>-------<u></u>---+<br>

we can see that the instance 57cbb39d-<u></u>c93f-44eb-<u></u>afda-9ce0011095<u></u>0d was deleted while the volume still exists with the "in-use" status</p><p style="margin-bottom:1.2em;width:auto;max-width:45em;color:rgb(51,51,51);font-family:monospace;font-size:12px;line-height:18px;background-color:rgb(255,255,255)">

2. the scend scene<br> (1)root@<u></u>devstack:<u></u>~# nova list<br>+----+-<u></u>-----+-<u></u>-------<u></u>+------<u></u>------+<u></u>-------<u></u>------+<u></u>-------<u></u>---+<br>| ID | Name | Status | Task State | Power State | Networks |<br>

+----+-<u></u>-----+-<u></u>-------<u></u>+------<u></u>------+<u></u>-------<u></u>------+<u></u>-------<u></u>---+<br>+----+-<u></u>-----+-<u></u>-------<u></u>+------<u></u>------+<u></u>-------<u></u>------+<u></u>-------<u></u>---+<br>

(2)root@devstack:~# nova boot --flavor m1.tiny --image 61ebee75-<u></u>5883-49a3-<u></u>bf85-ad6f6c29fc<u></u>1b --nic net-id=<u></u>354ba9ac-<u></u>e6a7-4fd6-<u></u>a49f-6ae18a815e<u></u>95 --block-device id=61ebee75-<u></u>5883-49a3-<u></u>bf85-ad6f6c29fc<u></u>1b,source=<u></u>image,dest=<u></u>volume,<u></u>device=<u></u>vdb,size=<u></u>1,shutdown=<u></u>removed tralon_<u></u>image_instance<br>

root@devstack:~# nova list<br>+------<u></u>-------<u></u>-------<u></u>-------<u></u>-------<u></u>----+--<u></u>-------<u></u>-------<u></u>-------<u></u>+------<u></u>--+----<u></u>-------<u></u>-------<u></u>----+--<u></u>-------<u></u>----+--<u></u>-------<u></u>-------<u></u>---+<br>

| ID | Name | Status | Task State | Power State | Networks |<br>+------<u></u>-------<u></u>-------<u></u>-------<u></u>-------<u></u>----+--<u></u>-------<u></u>-------<u></u>-------<u></u>+------<u></u>--+----<u></u>-------<u></u>-------<u></u>----+--<u></u>-------<u></u>----+--<u></u>-------<u></u>-------<u></u>---+<br>

| 25bcfe84-<u></u>0c3f-40d3-<u></u>a917-4791e092fa<u></u>06 | tralon_<u></u>image_instance | BUILD | block_device_<u></u>mapping | NOSTATE | private=10.0.0.26 |<br>+------<u></u>-------<u></u>-------<u></u>-------<u></u>-------<u></u>----+--<u></u>-------<u></u>-------<u></u>-------<u></u>+------<u></u>--+----<u></u>-------<u></u>-------<u></u>----+--<u></u>-------<u></u>----+--<u></u>-------<u></u>-------<u></u>---+<br>

(3)root@devstack:~# nova delete 25bcfe84-<u></u>0c3f-40d3-<u></u>a917-4791e092fa<u></u>06<br>  ( 4 ) root@devstack:~# nova list<br>+----+-<u></u>-----+-<u></u>-------<u></u>+------<u></u>------+<u></u>-------<u></u>------+<u></u>-------<u></u>---+<br>

| ID | Name | Status | Task State | Power State | Networks |<br>+----+-<u></u>-----+-<u></u>-------<u></u>+------<u></u>------+<u></u>-------<u></u>------+<u></u>-------<u></u>---+<br>+----+-<u></u>-----+-<u></u>-------<u></u>+------<u></u>------+<u></u>-------<u></u>------+<u></u>-------<u></u>---+<br>

 (5) root@devstack:~# cinder list<br>+------<u></u>-------<u></u>-------<u></u>-------<u></u>-------<u></u>----+--<u></u>-------<u></u>--+----<u></u>--+----<u></u>--+----<u></u>-------<u></u>--+----<u></u>------+<u></u>-------<u></u>-------<u></u>-------<u></u>-------<u></u>-------<u></u>---+<br>

| ID | Status | Name | Size | Volume Type | Bootable | Attached to |<br>+------<u></u>-------<u></u>-------<u></u>-------<u></u>-------<u></u>----+--<u></u>-------<u></u>--+----<u></u>--+----<u></u>--+----<u></u>-------<u></u>--+----<u></u>------+<u></u>-------<u></u>-------<u></u>-------<u></u>-------<u></u>-------<u></u>---+<br>

| 3e5579a9-<u></u>5aac-42b6-<u></u>9885-441e861f6c<u></u>c0 | available | None | 1 | None | false | |<br>| a7ad846b-<u></u>8638-40c1-<u></u>be42-f2816638a9<u></u>17 | in-use | | 1 | None | true | 57cbb39d-<u></u>c93f-44eb-<u></u>afda-9ce0011095<u></u>0d |<br>

| f3df0f15-<u></u>6c9d-4084-<u></u>8fb5-dc2826bf3e<u></u>b0 | in-use | | 1 | None | true | 25bcfe84-<u></u>0c3f-40d3-<u></u>a917-4791e092fa<u></u>06 |<br>+------<u></u>-------<u></u>-------<u></u>-------<u></u>-------<u></u>----+--<u></u>-------<u></u>--+----<u></u>--+----<u></u>--+----<u></u>-------<u></u>--+----<u></u>------+<u></u>-------<u></u>-------<u></u>-------<u></u>-------<u></u>-------<u></u>---+<br>

so, the instance 25bcfe84-<u></u>0c3f-40d3-<u></u>a917-4791e092fa<u></u>06 was deleted while the volume f3df0f15-<u></u>6c9d-4084-<u></u>8fb5-dc2826bf3e<u></u>b0 still exists with the "in-use" status</p>                                       </div>

</div>
<br>_______________________________________________<br>
OpenStack-dev mailing list<br>
<a href="mailto:OpenStack-dev@lists.openstack.org">OpenStack-dev@lists.openstack.org</a><br>
<a href="http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev" target="_blank">http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev</a><br>
<br></blockquote></div><br></div></div>