[openstack-dev] [OpenStack] Support attach CD-ROM to instance

Nikola Đipanov ndipanov at redhat.com
Fri Dec 21 18:44:01 UTC 2012

On 21/12/12 18:51, Vishvananda Ishaya wrote:
> On Dec 20, 2012, at 9:18 PM, Jian Hua Geng <gengjh at cn.ibm.com
> <mailto:gengjh at cn.ibm.com>> wrote:
>> According to the comments in https://review.openstack.org/#/c/18469/,
>> I summary the following work items need to be done, pls give me your
>> suggestion:
>> 1. I prefer to provide a new attribute when run new instance, for
>> example: --cdrom <image id>
> This is fine for user experience, but it should still use the block
> device mapping under the covers.

An idea I had in mind was to first make use of the 'type' attribute that
is available in the nova client but is currently not used at all.

Currently nova help boot gives us:

 --block-device-mapping <dev-name=mapping>
     Block device mapping in the format
     <dev-name>=<id>:<type>:<size(GB)>:<delete on-terminate>.

But a closer look tells me that the type bit is never passed

So this could be the first step: generalize your patch to attach images
as devices if type of the bdm is 'image'. If it is empty it can default
to 'volume' for example.

Then we make sure it is safe to use (limit the size etc... what Vish
mentioned already)

>From there we can continue adding an API extension and some code to
allow --cdrom (maybe) and code to make sure it attaches properly and
making it more user friendly.

This is the path I would take - and the reason is that we want to make
block_device_mappings a facility to keep all the stuff related to
devices around rather than have it scattered around the nova code-base.



>> 2. This image is from glance and accept any format not only iso.
> It makes sense that we shouldn't require the user's to set the glance
> metadata 'iso' on their image to use the above command, so accepting any
> image is fine, but we probably should limit the size of the image and
> verify that it will actually attach properly as a cdrom.
> Vish

PS. I am posting this on the dev list as there might be more interested
people monitoring that list.

More information about the OpenStack-dev mailing list