<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 id="yui_3_10_3_1_1406273181464_2522" 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 id="yui_3_10_3_1_1406273181464_2522" 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><p id="yui_3_10_3_1_1406273181464_2522" 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 id="yui_3_10_3_1_1406273181464_2522" 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 id="yui_3_10_3_1_1406273181464_2522" 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_<wbr>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 id="yui_3_10_3_1_1406273181464_2522" 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 id="yui_3_10_3_1_1406273181464_2522" 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_<wbr>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_<wbr>mapping table, the problem mentioned above will occur.</p><p id="yui_3_10_3_1_1406273181464_2522" 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 id="yui_3_10_3_1_1406273181464_2522" 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 id="yui_3_10_3_1_1406273181464_2522" 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 id="yui_3_10_3_1_1406273181464_2512" 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>+----+-<wbr>-----+-<wbr>-------<wbr>+------<wbr>------+<wbr>-------<wbr>------+<wbr>-------<wbr>---+<br>| ID | Name | Status | Task State | Power State | Networks |<br>+----+-<wbr>-----+-<wbr>-------<wbr>+------<wbr>------+<wbr>-------<wbr>------+<wbr>-------<wbr>---+<br>+----+-<wbr>-----+-<wbr>-------<wbr>+------<wbr>------+<wbr>-------<wbr>------+<wbr>-------<wbr>---+<br>(2)root@devstack:~# nova boot --flavor m1.tiny --block-device id=61ebee75-<wbr>5883-49a3-<wbr>bf85-ad6f6c29fc<wbr>1b,source=<wbr>image,dest=<wbr>volume,<wbr>device=<wbr>vda,size=<wbr>1,shutdown=<wbr>removed,<wbr>bootindex=<wbr>0 --nic net-id=<wbr>354ba9ac-<wbr>e6a7-4fd6-<wbr>a49f-6ae18a815e<wbr>95 tralon_test<br>root@devstack:~# nova list<br>+------<wbr>-------<wbr>-------<wbr>-------<wbr>-------<wbr>----+--<wbr>-------<wbr>----+--<wbr>------+<wbr>-------<wbr>-------<wbr>-------<wbr>-+-----<wbr>-------<wbr>-+-----<wbr>-------<wbr>-------<wbr>+<br>| ID | Name | Status | Task State | Power State | Networks |<br>+------<wbr>-------<wbr>-------<wbr>-------<wbr>-------<wbr>----+--<wbr>-------<wbr>----+--<wbr>------+<wbr>-------<wbr>-------<wbr>-------<wbr>-+-----<wbr>-------<wbr>-+-----<wbr>-------<wbr>-------<wbr>+<br>| 57cbb39d-<wbr>c93f-44eb-<wbr>afda-9ce0011095<wbr>0d | tralon_test | BUILD | block_device_<wbr>mapping | NOSTATE | private=10.0.0.20 |<br>+------<wbr>-------<wbr>-------<wbr>-------<wbr>-------<wbr>----+--<wbr>-------<wbr>----+--<wbr>------+<wbr>-------<wbr>-------<wbr>-------<wbr>-+-----<wbr>-------<wbr>-+-----<wbr>-------<wbr>-------<wbr>+<br>(3)root@devstack:~# nova delete tralon_test<br>root@devstack:~# nova list<br>+----+-<wbr>-----+-<wbr>-------<wbr>+------<wbr>------+<wbr>-------<wbr>------+<wbr>-------<wbr>---+<br>| ID | Name | Status | Task State | Power State | Networks |<br>+----+-<wbr>-----+-<wbr>-------<wbr>+------<wbr>------+<wbr>-------<wbr>------+<wbr>-------<wbr>---+<br>+----+-<wbr>-----+-<wbr>-------<wbr>+------<wbr>------+<wbr>-------<wbr>------+<wbr>-------<wbr>---+<br>(4) root@devstack:~# cinder list<br>+------<wbr>-------<wbr>-------<wbr>-------<wbr>-------<wbr>----+--<wbr>-------<wbr>--+----<wbr>--+----<wbr>--+----<wbr>-------<wbr>--+----<wbr>------+<wbr>-------<wbr>-------<wbr>-------<wbr>-------<wbr>-------<wbr>---+<br>| ID | Status | Name | Size | Volume Type | Bootable | Attached to |<br>+------<wbr>-------<wbr>-------<wbr>-------<wbr>-------<wbr>----+--<wbr>-------<wbr>--+----<wbr>--+----<wbr>--+----<wbr>-------<wbr>--+----<wbr>------+<wbr>-------<wbr>-------<wbr>-------<wbr>-------<wbr>-------<wbr>---+<br>| 3e5579a9-<wbr>5aac-42b6-<wbr>9885-441e861f6c<wbr>c0 | available | None | 1 | None | false | |<br>| a4121322-<wbr>529b-4223-<wbr>ac26-0f569dc782<wbr>1e | available | | 1 | None | true | |<br>| a7ad846b-<wbr>8638-40c1-<wbr>be42-f2816638a9<wbr>17 | in-use | | 1 | None | true | 57cbb39d-<wbr>c93f-44eb-<wbr>afda-9ce0011095<wbr>0d |<br>+------<wbr>-------<wbr>-------<wbr>-------<wbr>-------<wbr>----+--<wbr>-------<wbr>--+----<wbr>--+----<wbr>--+----<wbr>-------<wbr>--+----<wbr>------+<wbr>-------<wbr>-------<wbr>-------<wbr>-------<wbr>-------<wbr>---+<br>we can see that the instance 57cbb39d-<wbr>c93f-44eb-<wbr>afda-9ce0011095<wbr>0d was deleted while the volume still exists with the "in-use" status</p><p id="yui_3_10_3_1_1406273181464_2514" 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@<wbr>devstack:<wbr>~# nova list<br>+----+-<wbr>-----+-<wbr>-------<wbr>+------<wbr>------+<wbr>-------<wbr>------+<wbr>-------<wbr>---+<br>| ID | Name | Status | Task State | Power State | Networks |<br>+----+-<wbr>-----+-<wbr>-------<wbr>+------<wbr>------+<wbr>-------<wbr>------+<wbr>-------<wbr>---+<br>+----+-<wbr>-----+-<wbr>-------<wbr>+------<wbr>------+<wbr>-------<wbr>------+<wbr>-------<wbr>---+<br>£¨2£©root@devstack:~# nova boot --flavor m1.tiny --image 61ebee75-<wbr>5883-49a3-<wbr>bf85-ad6f6c29fc<wbr>1b --nic net-id=<wbr>354ba9ac-<wbr>e6a7-4fd6-<wbr>a49f-6ae18a815e<wbr>95 --block-device id=61ebee75-<wbr>5883-49a3-<wbr>bf85-ad6f6c29fc<wbr>1b,source=<wbr>image,dest=<wbr>volume,<wbr>device=<wbr>vdb,size=<wbr>1,shutdown=<wbr>removed tralon_<wbr>image_instance<br>root@devstack:~# nova list<br>+------<wbr>-------<wbr>-------<wbr>-------<wbr>-------<wbr>----+--<wbr>-------<wbr>-------<wbr>-------<wbr>+------<wbr>--+----<wbr>-------<wbr>-------<wbr>----+--<wbr>-------<wbr>----+--<wbr>-------<wbr>-------<wbr>---+<br>| ID | Name | Status | Task State | Power State | Networks |<br>+------<wbr>-------<wbr>-------<wbr>-------<wbr>-------<wbr>----+--<wbr>-------<wbr>-------<wbr>-------<wbr>+------<wbr>--+----<wbr>-------<wbr>-------<wbr>----+--<wbr>-------<wbr>----+--<wbr>-------<wbr>-------<wbr>---+<br>| 25bcfe84-<wbr>0c3f-40d3-<wbr>a917-4791e092fa<wbr>06 | tralon_<wbr>image_instance | BUILD | block_device_<wbr>mapping | NOSTATE | private=10.0.0.26 |<br>+------<wbr>-------<wbr>-------<wbr>-------<wbr>-------<wbr>----+--<wbr>-------<wbr>-------<wbr>-------<wbr>+------<wbr>--+----<wbr>-------<wbr>-------<wbr>----+--<wbr>-------<wbr>----+--<wbr>-------<wbr>-------<wbr>---+<br>£¨3£©root@devstack:~# nova delete 25bcfe84-<wbr>0c3f-40d3-<wbr>a917-4791e092fa<wbr>06<br> ( 4 ) root@devstack:~# nova list<br>+----+-<wbr>-----+-<wbr>-------<wbr>+------<wbr>------+<wbr>-------<wbr>------+<wbr>-------<wbr>---+<br>| ID | Name | Status | Task State | Power State | Networks |<br>+----+-<wbr>-----+-<wbr>-------<wbr>+------<wbr>------+<wbr>-------<wbr>------+<wbr>-------<wbr>---+<br>+----+-<wbr>-----+-<wbr>-------<wbr>+------<wbr>------+<wbr>-------<wbr>------+<wbr>-------<wbr>---+<br> (5) root@devstack:~# cinder list<br>+------<wbr>-------<wbr>-------<wbr>-------<wbr>-------<wbr>----+--<wbr>-------<wbr>--+----<wbr>--+----<wbr>--+----<wbr>-------<wbr>--+----<wbr>------+<wbr>-------<wbr>-------<wbr>-------<wbr>-------<wbr>-------<wbr>---+<br>| ID | Status | Name | Size | Volume Type | Bootable | Attached to |<br>+------<wbr>-------<wbr>-------<wbr>-------<wbr>-------<wbr>----+--<wbr>-------<wbr>--+----<wbr>--+----<wbr>--+----<wbr>-------<wbr>--+----<wbr>------+<wbr>-------<wbr>-------<wbr>-------<wbr>-------<wbr>-------<wbr>---+<br>| 3e5579a9-<wbr>5aac-42b6-<wbr>9885-441e861f6c<wbr>c0 | available | None | 1 | None | false | |<br>| a7ad846b-<wbr>8638-40c1-<wbr>be42-f2816638a9<wbr>17 | in-use | | 1 | None | true | 57cbb39d-<wbr>c93f-44eb-<wbr>afda-9ce0011095<wbr>0d |<br>| f3df0f15-<wbr>6c9d-4084-<wbr>8fb5-dc2826bf3e<wbr>b0 | in-use | | 1 | None | true | 25bcfe84-<wbr>0c3f-40d3-<wbr>a917-4791e092fa<wbr>06 |<br>+------<wbr>-------<wbr>-------<wbr>-------<wbr>-------<wbr>----+--<wbr>-------<wbr>--+----<wbr>--+----<wbr>--+----<wbr>-------<wbr>--+----<wbr>------+<wbr>-------<wbr>-------<wbr>-------<wbr>-------<wbr>-------<wbr>---+<br>so, the instance 25bcfe84-<wbr>0c3f-40d3-<wbr>a917-4791e092fa<wbr>06 was deleted while the volume f3df0f15-<wbr>6c9d-4084-<wbr>8fb5-dc2826bf3e<wbr>b0 still exists with the "in-use" status</p> </div></body>
</html>