Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

I found a sneaky way to do something like this. I can't guarantee it will work for you too. I am on Newton. basically you can change the libvirt xml file and the restart the instance via virsh fast enough that openstack doesn't re-write the xml file (until the instance is restarted normally)

so, make 2 volumes the first volume is a empty disk. say 40GB, no source, empty volume, bootable the second volume is created using the DVD ISO of the install media for source. say CentOS-4.8-64bit-binDVD.iso or any OS install, bootable.

create an instance using the first volume as vHD, when the instance boots it will fail because vda is a empty drive. note: there may also be a vdb if a metadata drive is being defined automatically.

attach the second DVD ISO volume to the instance, this may end up being vdc.

Boot the instance again to see it fails boot again for the same reason as above

find the hypervisor running the instance, and the instance's uuid

login to the hypervisor and find the instance you are working with "grep <uuid> /etc/libvirt/qemu"

say grep shows filename instance-00001cd1.xml

run "virsh edit instance-00001cd1"

reorder the <disk..... <="" disk=""> sections so that the vdc DVD ISO volume is first.

exit the editor and quickly "virsh destroy instance-00001cd1" (destroy is only a stop/shutdown)

and then quickly "virsh start instance-00001cd1"

if all has gone well openstack won't re-write to the instance-00001cd1.xml file and the DVD ISO volume will boot. check the console.

install the OS onto vdc and reboot the instance.

at this point the xml file will be re-written and the first volume will again be the first boot device and the newly installed OS will boot.

at this point you can detached the DVD ISO volume, vdc, if desired

worked for me! hope it works for you!

I found a sneaky way to do something like this. I can't guarantee it will work for you too. too, but I wanted to share it.

I am on Newton. basically you can change the libvirt xml file and the restart the instance via virsh fast enough that openstack doesn't re-write the xml file (until the instance is restarted normally)

so, make 2 volumes the first volume is a empty disk. say 40GB, no source, empty volume, bootable the second volume is created using the DVD ISO of the install media for source. say CentOS-4.8-64bit-binDVD.iso or any OS install, bootable.

create an instance using the first volume as vHD, when the instance boots it will fail because vda is a empty drive. note: there may also be a vdb if a metadata drive is being defined automatically.

attach the second DVD ISO volume to the instance, this may end up being vdc.

Boot the instance again to see it fails boot again for the same reason as above

find the hypervisor running the instance, and the instance's uuid

login to the hypervisor and find the instance you are working with "grep <uuid> /etc/libvirt/qemu"

say grep shows filename instance-00001cd1.xml

run "virsh edit instance-00001cd1"

reorder the <disk..... <="" disk=""> sections so that the vdc DVD ISO volume is first.

exit the editor and quickly "virsh destroy instance-00001cd1" (destroy is only a stop/shutdown)

and then quickly "virsh start instance-00001cd1"

if all has gone well openstack won't re-write to the instance-00001cd1.xml file and the DVD ISO volume will boot. check the console.

install the OS onto vdc and reboot the instance.

at this point the xml file will be re-written and the first volume will again be the first boot device and the newly installed OS will boot.

at this point you can detached the DVD ISO volume, vdc, if desired

worked for me! hope it works for you!