[nova][dev] image to local block device mapping not supported
Nemanja Miletic
nemanja at nemanjamiletic.com
Mon Apr 3 13:05:42 UTC 2023
On Mon, Apr 3, 2023, at 2:33 PM, Sean Mooney wrote:
> On Mon, 2023-04-03 at 10:44 +0200, Nemanja Miletic wrote:
>> Hello,
>>
>> Nova does not support image to local block device mapping since issue in this bug is fixed:
>> https://bugs.launchpad.net/nova/+bug/1377958
>>
>> In particular I am interested in scenario best described with this command:
>> openstack server create --flavor m1.small --network mgmt --image XXX \
>> --block-device uuid=YYY,source_type=image,\
>> destination_type=local,disk_bus=ide,device_type=cdrom,boot_index=1 testvm300
>>
>> For above command nova gives error:
>> Block Device Mapping is Invalid: Mapping image to local is not supported.
>>
>> Libvirt does not have issues with having two block devices which have file source.
>>
>> My question is what am I missing here? Why Nova does not support image to local block device mapping?
> the simple answer is that if we allow this then you could eiasly fill
> the hosts root file system
>
> in yoru exmaple you are using two diffent images but the size of the
> second image YYY would not be accounted for in the
> placment resouce allocation of local vm usage.
>
> if you created a 100TB glance image as a qcow and then specifed it on a
> host that was configure ot use raw storage
> that file will get converted and fill the host storage.
> if the YYY image is a driver disk or install iso then generally we
> would suggest takign a differnt approch
> if its a driver disk then you would boot a vm form the XXX image as
> normal and attach the iso as a cinder volume.
> if it was a install iso then the normal workflow is described here
> https://docs.openstack.org/nova/rocky/user/launch-instance-using-ISO-image.html
>
In my use case both boot image and CD-ROM need to be present on first
boot. (cd-rom contains bootstrap data for the image, can not use user-data
as it is limited to 64k). I have a cluster without Cinder (block
storage). The only workaround I see is to deploy Cinder with LVM backend on one
node and use volume as a destination_type for cd-rom. That is a waste as
cd-rom data can be thrown away after first boot but it seems like an only
option. Please correct me if I am wrong. I am also planing to use Heat to
deploy the image in an automated way so first booting and then attaching
cdrom is not an option.
More information about the openstack-discuss
mailing list