Ask Your Question
0

Adding an iso to instance launch

asked 2019-12-12 16:43:33 -0500

teleute gravatar image

updated 2019-12-12 19:38:37 -0500

I'm trying to launch an instance from an image, and also attach an iso to it that contains config data for that instance. I can do this via --block-device on a test box where I have Cinder installed. However, on my test box without Cinder (I don't actually need it for anything else in this test) this doesn't work. I tried changing the destination to local rather than volume and it says that combination is not supported. I tried switching to using a config-drive, and while this works with a small config file, it fails with the message "request is too large" when I include all of the info I actually need. Is there any other way to handle this short of installing Cinder? I just tried to add it on and got lots of errors (never added it after initial install before), and I don't need it for anything else, so I'm hoping to avoid going down this path if possible.

Thanks!

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
0

answered 2019-12-13 03:20:20 -0500

nicholas666 gravatar image

If you use KVM you can use " virsh attach-disk instance-uuid XXX.iso hda --sourcetype block --driver qemu --subdriver raw --type cdrom" to attach a iso with cdrom.

if don't have hda dev . you can change nova/virt/libvirt/driver.py

    cd_cfg = vconfig.LibvirtConfigGuestDisk()
    cd_cfg.driver_name = 'qemu'
    cd_cfg.source_device = 'cdrom'
    cd_cfg.driver_format = 'raw'
    cd_cfg.driver_cache = 'none'
    cd_cfg.target_bus = 'ide'
    cd_cfg.target_dev = 'hda'
    cd_cfg.root_name = 'disk'
    cd_cfg.source_type = 'file'
    cd_cfg.source_path = ''

also you can modify KVM xml boot dev = 'cdrom' to change order

<os>
<type>hvm</type>
<boot dev="hd" />
<smbios mode="sysinfo" />
</os>

https://blog.csdn.net/zhongbeida_xue/article/details/90295987 (link text)

edit flag offensive delete link more

Comments

Interesting...thanks! I'd wondered about doing it that way, but saw a post elsewhere that said not to directly use libvirt commands in OpenStack. Have you tried it this way personally? Any gotchas or odd potential behaviours to be aware of?

teleute gravatar imageteleute ( 2019-12-13 11:39:18 -0500 )edit

Yes, I've done this before, but the important thing to note is that the migration and ceilometer will collect this hda device.You can use libvirt python sdk instead of virsh commands.

nicholas666 gravatar imagenicholas666 ( 2019-12-16 20:26:36 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower

Stats

Asked: 2019-12-12 16:43:33 -0500

Seen: 28 times

Last updated: Dec 13 '19