[openstack-dev] [OpenStack] Support attach CD-ROM to instance
Vishvananda Ishaya
vishvananda at gmail.com
Fri Dec 21 19:00:15 UTC 2012
On Dec 21, 2012, at 10:44 AM, Nikola Đipanov <ndipanov at redhat.com> wrote:
> 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
Type is used to differentiate volumes from snapshots:
https://github.com/4P/python-novaclient/blob/nebula-release/latest/novaclient/v1_1/base.py#L134
But that doesn't stop us from adding image as a possible type as you say below.
>
> 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.
I don't even know if we need a new api extension. We could just make novaclient construct
a bdm for you if you pass in --cdrom or --volume.
>
> 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.
Overall I agree.
Vish
More information about the OpenStack-dev
mailing list