[Bug 989462] New: Virt-Manager Unable to Create VM
http://bugzilla.suse.com/show_bug.cgi?id=989462 Bug ID: 989462 Summary: Virt-Manager Unable to Create VM Classification: openSUSE Product: openSUSE Distribution Version: Leap 42.1 Hardware: aarch64 OS: openSUSE 42.1 Status: NEW Severity: Normal Priority: P5 - None Component: Virtualization:Tools Assignee: virt-bugs@suse.de Reporter: alan@softiron.co.uk QA Contact: qa-bugs@suse.de Found By: --- Blocker: --- I've had some trouble creating VM's with virt-manager and have identified what I think is the problem. I am able to work around it, but it requires editing the VM xml description manually with "virsh edit". The basic problem is that if you create a VM with virt-manager, it will not get the firmware line correct. What I think it's trying to generate (because I can't really verify it, because it fails) is: <os> <type arch='aarch64' machine='virt'>hvm</type> <loader readonly='yes' type='pflash'>/usr/share/AAVMF/AAVMF_CODE.fd</loader> ... <boot dev='hd'/> </os> Note the use of "pflash" as the type. Indeed this is what the libvirt documentation says to do: https://libvirt.org/formatdomain.html#elementsOSBIOS "For instance, if the loader path points to an UEFI image, type should be pflash." However, if pflash is used here, starting the VM will fail with: "virt-manager Initialization of device cfi.pflash01 failed: failed to read the initial flash content" If the type is changed to "rom" (manually), the VM boots up as expected. Steps to reproduce: # Install prerequisites: zypper install virsh virt-install vm-install ca-certificates libvirt-daemon-driver-qemu qemu qemu-tools # Download the firmware Image: wget http://snapshots.linaro.org/components/kernel/leg-virt-tianocore-edk2-upstre... # Install the firmware image and space for the variables: mkdir /usr/share/AAVMF cp QEMU_EFI.fd /usr/share/AAVMF/AAVMF_CODE.fd dd if=/dev/zero of=/usr/share/AAVMF/AAVMF_VARS.fd bs=16M count=1 # Download the OS Image wget http://download.opensuse.org/ports/aarch64/distribution/leap/42.1/appliances... # Convert the OS Image to qcow2 format for VM use: unxz openSUSE-Leap42.1*.xz qemu-img convert -f raw -O qcow2 openSUSE-Leap42.1*.raw leap.qcow2 qemu-img resize leap.qcow2 40G # Inspect the qcow2 image (see 40G) qemu-img info leap.qcow2 # Install qcow image: cp leap.qcow2 /var/lib/libvirt/images/ # Create and start the VM with virt-manager GUI: virt-manager File->New "Create new Virtual Machine" - Step 1 of 4 Select "Import Existing Disk Image" Archetecture Options: aarch64 virt Click "Forward" "Provide the existing Storage Path:" Click "Browse" Select leap.qcow2 Click "Select Volume" Choose OS Type: "Linux" "SUSE Enterprise 12 SP1" Click "Forward" "Choose Memory and CPU settings" RAM: 2048 (less than this will fail to load initrd!) CPU: 1 Click "Forward" "Ready to begin the Installation" Enter "sles12" as the name Click Finish "Begin Installation" Window click "Begin Installation" This will fail to create a VM, complaining about inability to find pflash, as described above. Click OK which will take you back to the "Begin Installation" Window. Click "Overview" on the left Change "Firmware" to "none" Click "Apply" Click "Begin Installation" This will Create and start a VM. It will not boot. To fix this, from the VM window Select: Virtual Machine -> Shutdown -> Force Off
From the Shell: virsh edit sles12 # sles12 is the name you entered above. Under the <os> tag, add the lines: <loader readonly='yes' type='rom'>/usr/share/AAVMF/AAVMF_CODE.fd</loader> <nvram template='/usr/share/AAVMF/AAVMF_VARS.fd'>/tmp/sles12VARS.fd</nvram> Close the editor (esc :wq) From virt-manager: Select the VM Press "Open" Virtual Machine -> Run Observe the VM boot SUSE and run.
Thanks for having a look at this and sorry about the verbosity, but I think it's all necessary to describe and characterize the problem. Alan. -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.suse.com/show_bug.cgi?id=989462 Matthias Brugger <mbrugger@suse.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |agraf@suse.com, | |dmueller@suse.com, | |ihno@suse.com, | |mbrugger@suse.com -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.suse.com/show_bug.cgi?id=989462 http://bugzilla.suse.com/show_bug.cgi?id=989462#c1 --- Comment #1 from Dirk Mueller <dmueller@suse.com> --- Thats a duplicate of bug 983747 and 981836, but this time for Leap 42.1 Here's the fix that need to be released as an update: https://build.opensuse.org/request/show/401809 -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.suse.com/show_bug.cgi?id=989462 Dirk Mueller <dmueller@suse.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |maintenance@opensuse.org Flags| |needinfo?(maintenance@opens | |use.org) -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.suse.com/show_bug.cgi?id=989462 http://bugzilla.suse.com/show_bug.cgi?id=989462#c2 Andreas Stieger <astieger@suse.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |astieger@suse.com Flags|needinfo?(maintenance@opens | |use.org) | --- Comment #2 from Andreas Stieger <astieger@suse.com> --- Please make a maintenance submission: https://en.opensuse.org/openSUSE:Package_maintenance -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.suse.com/show_bug.cgi?id=989462 http://bugzilla.suse.com/show_bug.cgi?id=989462#c3 --- Comment #3 from Alan Ott <alan@softiron.co.uk> --- Hi Dirk, thanks for having a look. I don't have permissions to view bug 983747, but bug 981836 is not quite the same thing. 981836 is about finding the firmware path automatically and adds a new place to the search path. My bug is that it _can_ find the firmware (because it shows in the virt-manager GUI) but it uses the wrong <loader ... type=""> in the generated XML file. It's trying to use "<loader ... type='pflash'>", but the only thing that seems to work is "<loader ... type='rom'>". Again though, my assertion of virt-manager's use of type='pflash' is only speculation, since the VM XML file never actually shows up on the drive (because it fails to be created). However, I know that if I change my working XML to type='pflash', I get the same error when I try to create it. So all that is to say that maybe bug 983747 does describe this issue (since I don't have permissions to view it), but bug 981836 is about something different. Thanks again for looking, Alan. -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.suse.com/show_bug.cgi?id=989462 Charles Arnold <carnold@suse.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |carnold@suse.com, | |jfehlig@suse.com Summary|Virt-Manager Unable to |Virt-Manager Unable to |Create VM |Create VM on aarch64 -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.suse.com/show_bug.cgi?id=989462 http://bugzilla.suse.com/show_bug.cgi?id=989462#c4 James Fehlig <jfehlig@suse.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |glin@suse.com --- Comment #4 from James Fehlig <jfehlig@suse.com> --- (In reply to Alan Ott from comment #3)
My bug is that it _can_ find the firmware (because it shows in the virt-manager GUI) but it uses the wrong <loader ... type=""> in the generated XML file. It's trying to use "<loader ... type='pflash'>", but the only thing that seems to work is "<loader ... type='rom'>".
But as you already noted, the type _should_ be pflash. Perhaps there is a problem with qemu, or the firmware blob. FYI, you can get debug info from ovmf by adding the following to your guest XML <domain type='kvm' xmlns:qemu='http://libvirt.org/schemas/domain/qemu/1.0'> ... <qemu:commandline> <qemu:arg value='-debugcon'/> <qemu:arg value='file:/tmp/ovmf-debug.log'/> <qemu:arg value='-global'/> <qemu:arg value='isa-debugcon.iobase=0x402'/> </qemu:commandline> ... </domain> Also, is there anything interesting in the VM's log file (/var/log/libvirt/qemu/<vm-name>.log? It would be good to verify libvirt created a correct qemu command line, although I think it did given the info you provided in #0. BTW, bug#983747 is essentially a SLE clone of bug#981836. -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.suse.com/show_bug.cgi?id=989462 http://bugzilla.suse.com/show_bug.cgi?id=989462#c5 --- Comment #5 from Alan Ott <alan@softiron.co.uk> --- Hi James, sorry I'm slow getting back to you. Thank you for your response. I've tried what you suggested, and the answer is that type='pflash' will generate on the qemu command line:
-drive file=/usr/share/AAVMF/AAVMF_CODE.fd,if=pflash,format=raw,unit=0,readonly=on
While type='rom' will generate:
-bios /usr/share/AAVMF/AAVMF_CODE.fd
If you look at Linaro's UEFI for QEMU page[1], it says to use -bios on ARM, at least for the images they generate and post on their site. I feel like the libvirt documentation that says to use 'pflash' for UEFI and 'rom' for BIOS images might be x86-centric. Alan. [1]https://wiki.linaro.org/LEG/UEFIforQEMU -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.suse.com/show_bug.cgi?id=989462 http://bugzilla.suse.com/show_bug.cgi?id=989462#c6 James Fehlig <jfehlig@suse.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |alan@softiron.co.uk Flags| |needinfo?(alan@softiron.co. | |uk) --- Comment #6 from James Fehlig <jfehlig@suse.com> --- (In reply to Alan Ott from comment #5)
If you look at Linaro's UEFI for QEMU page[1], it says to use -bios on ARM, at least for the images they generate and post on their site.
Have you tried the images SUSE makes available? qemu-uefi-aarch64-*.noarch.rpm contains the firmwares for ARM. The repo for 42.1 can be found at http://download.opensuse.org/repositories/Virtualization/openSUSE_Leap_42.1/ -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.suse.com/show_bug.cgi?id=989462 http://bugzilla.suse.com/show_bug.cgi?id=989462#c7 --- Comment #7 from Alan Ott <alan@softiron.co.uk> ---
Have you tried the images SUSE makes available? qemu-uefi-aarch64-*.noarch.rpm
Just tried, same result: works with 'rom', doesn't work with 'pflash'. I verified that it's using the proper firmware binary by inspecting the log. -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.suse.com/show_bug.cgi?id=989462 http://bugzilla.suse.com/show_bug.cgi?id=989462#c8 James Fehlig <jfehlig@suse.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |afaerber@suse.com --- Comment #8 from James Fehlig <jfehlig@suse.com> --- Heh, now I'm unsure about the proper way to invoke qemu with the aavmf images. For example on x86_64, with a guest using persistent UEFI variables, qemu is invoked as -drive file=/usr/share/qemu/ovmf-x86_64-ms-code.bin,if=pflash,format=raw,unit=0,readonly=on -drive file=/var/lib/libvirt/nvram/sles12sp2a2-ovfm-kvm_VARS.fd,if=pflash,format=raw,unit=1 On ARM, with a guest not using persistent variables, the linaro docs say to use -bios /path/to/code-image With persistent variables, the linaro docs recommend -pflash /path/to/code-image -pflash /path/to/var-image Gary, Alex, Andreas: Can you verify the correct qemu invocation for aavmf with and without persistent variables? Thanks. -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.suse.com/show_bug.cgi?id=989462 http://bugzilla.suse.com/show_bug.cgi?id=989462#c9 Dirk Mueller <dmueller@suse.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Flags|needinfo?(alan@softiron.co. | |uk) | --- Comment #9 from Dirk Mueller <dmueller@suse.com> --- Again, repeating what I said before. this bug is already fixed, we just need to submit the fix to Leap 42.1 as a maintenance update. for pflash, the efi roms need to be padded properly, see https://bugzilla.suse.com/show_bug.cgi?id=983747#c0 for the description and the fix of the problem. this was already fixed for Tumbleweed and SLE12 SP2, we just need to fix it for Leap 42.1/42.2 as well. -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.suse.com/show_bug.cgi?id=989462 http://bugzilla.suse.com/show_bug.cgi?id=989462#c11 --- Comment #11 from Gary Ching-Pang Lin <glin@suse.com> --- I tested on Tumbleweed, and this command works for me: qemu-system-aarch64 -m 1024 \ -cpu cortex-a57 \ -M virt \ -serial stdio \ -drive if=pflash,format=raw,readonly,file=/usr/share/qemu/aavmf-aarch64-code.bin \ -drive if=pflash,format=raw,file=aavmf-aarch64-vars.bin Just submitted the newer OVMF to Leap 42.1. -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.suse.com/show_bug.cgi?id=989462 http://bugzilla.suse.com/show_bug.cgi?id=989462#c12 Charles Arnold <carnold@suse.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution|--- |FIXED --- Comment #12 from Charles Arnold <carnold@suse.com> --- (In reply to Gary Ching-Pang Lin from comment #11)
I tested on Tumbleweed, and this command works for me:
qemu-system-aarch64 -m 1024 \ -cpu cortex-a57 \ -M virt \ -serial stdio \ -drive if=pflash,format=raw,readonly,file=/usr/share/qemu/aavmf-aarch64-code.bin \ -drive if=pflash,format=raw,file=aavmf-aarch64-vars.bin
Just submitted the newer OVMF to Leap 42.1.
Closing as fixed. -- You are receiving this mail because: You are on the CC list for the bug.
participants (1)
-
bugzilla_noreply@novell.com