4

I have deployed Openstack on a multi-node architecture, hosted on VirtualBox machines. Now I am trying to launch my first instance, using a qcow2 centos image, but every time I do it I receive the following error:

Booting from Hard Disk... 

Boot failed: not a bootable disk

No bootable device

error printscreen

I am mentioning that I used images from official centos repository, but i also built my own qcow image using Virtualbox. In both cases, the same result. I have no clue what might cause this and from where should I start the investigations.

Patrick Mevzek
  • 10,995
  • 16
  • 38
  • 54
Laurentiu
  • 41
  • 1
  • 1
  • 2
  • Is this a screenshot from official centos VM image? If so I don't remember seeing any iPXE related logs in those VM images. Did you pick up the GenericCloud image from this URL: https://cloud.centos.org/centos/7/images/ ?? – Murli Aug 16 '18 at 14:26
  • @Murli Yes, is an official Centos image downloaded from the URL that you have mentioned and i picked the generic cloud version. – Laurentiu Aug 20 '18 at 08:48

1 Answers1

2

It appears that virt-manager does not read the hard drive image format of a pre-existing image when creating a new virtual machine and instead chooses the "raw" format. Since virt-manager seems to store it's setting internally, you cannot just edit the ~/.libvirt/qemu/VMNameHere.xml file.

You must export the libvirt vm settings to xml, fix the hard drive image formatting, and import the vm settings back into libvirt.

Get vm name: Code:

virsh -c qemu:///session list --all

If your vm is in the system account instead of your user account replace qemu:///session with qemu:///system

Export vm settings: Code:

virsh -c qemu:///session dumpxml VMName > ~/Desktop/VMName.xml

Update the hard drive format in the xml file:

Code:

From   
<devices>
    <emulator>/usr/bin/kvm</emulator>
    <disk type='file' device='disk'>
      <driver name='qemu' type='raw'/>
      <source file='/storage/vmimages/Windows7_x64-01/qcow2-60GB_HDD1.qcow2'/>
      <target dev='hda' bus='ide'/>
    </disk>
To
<devices>
    <emulator>/usr/bin/kvm</emulator>
    <disk type='file' device='disk'>
      <driver name='qemu' type='qcow2'/>
      <source file='/storage/vmimages/Windows7_x64-01/qcow2-60GB_HDD1.qcow2'/>
      <target dev='hda' bus='ide'/>
    </disk>

Remove old vm settings in virt-manager:

Open virt-manager and delete the problem vm but make sure to leave the hard drive image

Import in the fixed xml file:

Code:

virsh -c qemu:///session define ~/Desktop/VMName.xml

The vm will automatically appear in virt-manager.

The vm should now work fine.

Other notes: This qcow2/raw issue occurs to every hard drive image I load into a vm using virt-manager and so I must edit and reimport the xml each time.

You might be able to shutdown libvirt-bin and qemu-kvm services, edit the ~/.libvirt/qemu/VMNameHere.xml file and reboot as a shorter method but I didn't verify this works.

Hopefully this will save some several hours of searching.

Vishal Kute
  • 102
  • 5
  • I have performed all the steps but in the end, when i am trying to power on the VM, virt-manager shows the following error: `Error starting domain: internal error: process exited while connecting to monitor: 2018-08-16T15:04:49.630448Z qemu-kvm: -chardev pty,id=charserial0,logfile=/dev/fdset/1,logappend=on: char device redirected to /dev/pts/2 (label charserial0) 2018-08-16T15:04:49.632973Z qemu-kvm: -drive file=/dev/sdb,format=qcow2,if=none,id=drive-virtio-disk0,serial=ab3dc446-1247-4f40-baf3-f2d2f10a89b1,cache=none,aio=native: Image is not in qcow2 format` – Laurentiu Aug 16 '18 at 15:14
  • Performed the above steps in June 2021 on Mint 20.1 with all-fresh kvm, virt-manager etc and problem persisits. The xml file already contained type='qcow2' btw – Hektor Jun 05 '21 at 15:15