<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
</head>
<body>
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
<div id="divtagdefaultwrapper" style="font-size:12pt;color:#000000;font-family:Calibri,Arial,Helvetica,sans-serif;" dir="ltr">
<p><font face="Calibri,Arial,Helvetica,sans-serif" color="black" size="3"><span style="font-size:12pt;" dir="ltr" id="divtagdefaultwrapper">Zhenyu,</span></font></p>
<p><font face="Calibri,Arial,Helvetica,sans-serif" color="black" size="3"><span style="font-size:12pt;" dir="ltr" id="divtagdefaultwrapper"><br>
</span></font></p>
<p><font face="Calibri,Arial,Helvetica,sans-serif" color="black" size="3"><span style="font-size:12pt;" dir="ltr" id="divtagdefaultwrapper">btw iianm if you specify image only (w/o bdm) in the command line, nova cli sends exactly that combination which you're
 interesting for: image_ref and bdmv2.</span></font><br>
</p>
</div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> Feodor Tersin <ftersin@hotmail.com><br>
<b>Sent:</b> Wednesday, February 8, 2017 2:11:05 PM<br>
<b>To:</b> OpenStack Development Mailing List (not for usage questions)<br>
<b>Subject:</b> Re: [openstack-dev] [Nova] How boot with bdm_v2={source_type=image, destination_type=local} should been used?</font>
<div> </div>
</div>
<div><style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
<div id="divtagdefaultwrapper" style="font-size:12pt;color:#000000;font-family:Calibri,Arial,Helvetica,sans-serif;" dir="ltr">
<p>HI Zhenyu</p>
<p><br>
</p>
<p>You're referring to API doc, but you're checking it with nova cli, which does not do exactly that what you want. In the case when you specify image and block-device parameters, nova cli sends image_ref and two (!) bdms. Both these bdms have the same boot_index
 and conflict with each other.</p>
<p><br>
</p>
<p>AFAIK nova cli adds the bdm for specified image_ref (not always, though).</p>
<p><br>
</p>
<p>In other words if you want to check API in this case, use pure curl instead of nova cli to avoid these implicit behavior. Or you may use write tests on Python using nova client.</p>
</div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> Zhenyu Zheng <zhengzhenyulixi@gmail.com><br>
<b>Sent:</b> Wednesday, February 8, 2017 12:47:08 PM<br>
<b>To:</b> OpenStack Development Mailing List (not for usage questions)<br>
<b>Subject:</b> [openstack-dev] [Nova] How boot with bdm_v2={source_type=image, destination_type=local} should been used?</font>
<div> </div>
</div>
<div>
<div dir="ltr">Hi All,
<div><br>
</div>
<div>As I was working on "Check destination_type when booting with bdm provided": <a href="https://review.openstack.org/#/c/402372/">https://review.openstack.org/#/c/402372/</a> and addressing reviewers comments, I find out that the current source_type=image,
 destination_type=local seems unusable.</div>
<div><br>
</div>
<div>According to docs: <a href="http://docs.openstack.org/developer/nova/block_device_mapping.html#block-device-mapping-v2">
http://docs.openstack.org/developer/nova/block_device_mapping.html#block-device-mapping-v2</a>, it seems to me that "image --> local" means "boot from image", and as the doc says, I should also provide image_ref param, but if I do so, Error raised:</div>
<div><br>
</div>
<div><span style="color:rgb(51,51,51);font-family:monospace;font-size:12px">ERROR (BadRequest): Block Device Mapping is Invalid: Boot sequence for the instance and image/block device mapping combination is not valid. (HTTP 400) (Request-ID: req-f848c6c1-</span><wbr style="color:rgb(51,51,51);font-family:monospace;font-size:12px"><span style="color:rgb(51,51,51);font-family:monospace;font-size:12px">0961-46c4-</span><wbr style="color:rgb(51,51,51);font-family:monospace;font-size:12px"><span style="color:rgb(51,51,51);font-family:monospace;font-size:12px">ac51-713fde0422</span><wbr style="color:rgb(51,51,51);font-family:monospace;font-size:12px"><span style="color:rgb(51,51,51);font-family:monospace;font-size:12px">15)</span><br>
</div>
<div><span style="color:rgb(51,51,51);font-family:monospace;font-size:12px"><br>
</span></div>
<div><span style="color:rgb(51,51,51);font-family:monospace;font-size:12px">If I just use bdm, it goes:</span></div>
<div><span style="color:rgb(51,51,51);font-family:monospace;font-size:12px">2017-02-08 11:04:24.929 24141 ERROR nova.compute.</span><wbr style="color:rgb(51,51,51);font-family:monospace;font-size:12px"><span style="color:rgb(51,51,51);font-family:monospace;font-size:12px">manager
 [instance: 6e44cafd-</span><wbr style="color:rgb(51,51,51);font-family:monospace;font-size:12px"><span style="color:rgb(51,51,51);font-family:monospace;font-size:12px">b330-4a10-</span><wbr style="color:rgb(51,51,51);font-family:monospace;font-size:12px"><span style="color:rgb(51,51,51);font-family:monospace;font-size:12px">8c77-eac60d58f2</span><wbr style="color:rgb(51,51,51);font-family:monospace;font-size:12px"><span style="color:rgb(51,51,51);font-family:monospace;font-size:12px">0c]
 ImageNotFound: Image could not be found.</span><span style="color:rgb(51,51,51);font-family:monospace;font-size:12px"><br>
</span></div>
<div><span style="color:rgb(51,51,51);font-family:monospace;font-size:12px"><br>
</span></div>
<div><span style="color:rgb(51,51,51);font-family:monospace;font-size:12px">turned out we use '' as image ID to fetch image from glance, and obviously we cannot get it.</span></div>
<div><span style="color:rgb(51,51,51);font-family:monospace;font-size:12px"><br>
</span></div>
<div><span style="color:rgb(51,51,51);font-family:monospace;font-size:12px">Detailed Log and explaination could be found in my bug report:</span></div>
<div><font color="#333333" face="monospace"><span style="font-size:12px"><a href="https://bugs.launchpad.net/nova/+bug/1662748">https://bugs.launchpad.net/nova/+bug/1662748</a></span></font><br>
</div>
<div><font color="#333333" face="monospace"><span style="font-size:12px"><br>
</span></font></div>
<div><font color="#333333" face="monospace"><span style="font-size:12px">So, what do we expect for this API usage?</span></font></div>
<div><font color="#333333" face="monospace"><span style="font-size:12px"><br>
</span></font></div>
<div><font color="#333333" face="monospace"><span style="font-size:12px">Thanks,</span></font></div>
<div><font color="#333333" face="monospace"><span style="font-size:12px">Kevin Zheng</span></font></div>
</div>
</div>
</div>
</body>
</html>