RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 646895 (LibvirtBootOrder) - RFE: Explicit per-device ordering for bootable devices.
Summary: RFE: Explicit per-device ordering for bootable devices.
Keywords:
Status: CLOSED ERRATA
Alias: LibvirtBootOrder
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: libvirt
Version: 6.0
Hardware: Unspecified
OS: Unspecified
low
medium
Target Milestone: rc
: ---
Assignee: Jiri Denemark
QA Contact: Virtualization Bugs
URL:
Whiteboard:
: 663275 (view as bug list)
Depends On: 643687 643688
Blocks: 628823 644849
TreeView+ depends on / blocked
 
Reported: 2010-10-26 15:16 UTC by Glauber Costa
Modified: 2015-09-28 02:10 UTC (History)
11 users (show)

Fixed In Version: libvirt-0.8.7-3.el6
Doc Type: Enhancement
Doc Text:
Device boot order could not be set more explicitly than Network, Disk, CD ROM, or Floppy. This meant that users could not select the exact boot device that they wished to use. A per-device <boot> element has been introduced, which can be used to specify the exact order of boot devices.
Clone Of:
Environment:
Last Closed: 2011-05-19 13:23:22 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2011:0596 0 normal SHIPPED_LIVE libvirt bug fix and enhancement update 2011-05-18 17:56:36 UTC

Description Glauber Costa 2010-10-26 15:16:33 UTC
Right now we can specify the boot order between network, disk, cdrom, etc,
but not between multiple instances of the same device type.

The current limitation is that qemu can't specify this.

We should be able to do it in upper levels as soon as qemu acquires this capability

Comment 1 Jiri Denemark 2010-12-21 15:55:55 UTC
The qemu support for this is now upstream:

commit 1ca4d09ae0bcc2fdd6aeef0fdc11f82394f7e757
Author: Gleb Natapov <gleb>
Date:   Wed Dec 8 13:35:05 2010 +0200

    Add bootindex parameter to net/block/fd device
    
    If bootindex is specified on command line a string that describes device
    in firmware readable way is added into sorted list. Later this list will
    be passed into firmware to control boot order.
    
    Signed-off-by: Gleb Natapov <gleb>
    Signed-off-by: Blue Swirl <blauwirbel>

The firmware support is not there yet so it's not usable now but we have the interface to use.

Comment 2 Gleb Natapov 2010-12-22 08:51:15 UTC
*** Bug 663275 has been marked as a duplicate of this bug. ***

Comment 3 Dave Allan 2011-01-05 19:44:55 UTC
(In reply to comment #1)
> The qemu support for this is now upstream:
> 
> commit 1ca4d09ae0bcc2fdd6aeef0fdc11f82394f7e757
> Author: Gleb Natapov <gleb>
> Date:   Wed Dec 8 13:35:05 2010 +0200
> 
>     Add bootindex parameter to net/block/fd device
> 
>     If bootindex is specified on command line a string that describes device
>     in firmware readable way is added into sorted list. Later this list will
>     be passed into firmware to control boot order.
> 
>     Signed-off-by: Gleb Natapov <gleb>
>     Signed-off-by: Blue Swirl <blauwirbel>
> 
> The firmware support is not there yet so it's not usable now but we have the
> interface to use.

Is the firmware support in qemu now?

Comment 4 Dor Laor 2011-01-06 11:21:36 UTC
(In reply to comment #3)

> Is the firmware support in qemu now?

yes

Comment 5 Jiri Denemark 2011-01-13 14:06:03 UTC
The patches were sent for upstream review: https://www.redhat.com/archives/libvir-list/2011-January/msg00540.html

Comment 6 Jiri Denemark 2011-01-17 16:39:21 UTC
Patches sent to rhvirt-patches.

Comment 9 zhanghaiyan 2011-01-18 06:12:42 UTC
This bug cannot be verified at this time because the latest qemu-kvm-0.12.1.2-2.129.el6.x86_64 in brew hasn't support this feature yet.


At the beginning I thought qemu-kvm has supported it and did the following test.
- libvirt-0.8.7-2.el6.x86_64
- rhel6-1.img is a bootable image file while haha.img is a fake null file.

1. Edit an xml specifying boot order as below
....
  <os>
    <type arch='x86_64' machine='rhel6.0.0'>hvm</type>
  </os>
....
  <devices>
    <emulator>/usr/libexec/qemu-kvm</emulator>
    <disk type='file' device='disk'>
      <driver name='qemu' type='raw' cache='none'/>
      <source file='/mnt/Share/yoyzhang/haha.img'/>
      <target dev='hdb' bus='ide'/>
      <boot order='1'/>
      <address type='drive' controller='0' bus='0' unit='1'/>
    </disk>
    <disk type='file' device='disk'>
      <driver name='qemu' type='raw' cache='none'/>
      <source file='/mnt/Share/yoyzhang/rhel6-1.img'/>
      <target dev='hda' bus='ide'/>
      <boot order='2'/>
      <address type='drive' controller='0' bus='0' unit='0'/>
    </disk>
2. Define and start the guest
# virsh start rhel6
Domain rhel6 started
The guest boot up successfully from the 2nd order hda device rhel6-1.img and can log in the guest
3. Check qemu command line
# ps axu|grep qemu
qemu     16065 10.1  4.3 1317348 346952 ?      Sl   00:59   0:18 /usr/libexec/qemu-kvm -S -M rhel6.0.0 -enable-kvm -m 1024 -smp 1,sockets=1,cores=1,threads=1 -name rhel6 -uuid a895bf3f-1354-68ac-5c49-c16af2c6a4d5 -nodefconfig -nodefaults -chardev socket,id=monitor,path=/var/lib/libvirt/qemu/rhel6.monitor,server,nowait -mon chardev=monitor,mode=control -rtc base=utc -drive file=/mnt/Share/yoyzhang/haha.img,if=none,id=drive-ide0-0-1,format=raw,cache=none -device ide-drive,bus=ide.0,unit=1,drive=drive-ide0-0-1,id=ide0-0-1 -drive file=/mnt/Share/yoyzhang/rhel6-1.img,if=none,id=drive-ide0-0-0,format=raw,cache=none -device ide-drive,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0 -netdev tap,fd=24,id=hostnet0 -device rtl8139,netdev=hostnet0,id=net0,mac=52:54:00:b1:94:d2,bus=pci.0,addr=0x3 -chardev pty,id=serial0 -device isa-serial,chardev=serial0 -usb -vnc 127.0.0.1:0 -k en-us -vga cirrus -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x4
root     16333  0.0  0.0 103152   832 pts/0    S+   01:02   0:00 grep qemu

Then I realized qemu-kvm doesn't support at all, because cannot see "bootindex=n" in qemu command line.

I have the 2 concerns about this bug
1) It seems strange that qemu-kvm doesn't support this in RHEL while libvirt does. For me and user cannot use this feature supported by libvirt at all without building upsteam qemu-kvm ourselves. And IMHO customers won't like to build package themselves. :)
2) As qemu-kvm doesn't support this feature, especillay in order qemu-kvm version, I think libvirt should report an error 'config is not supported' and not pretend everything is fine. For this I will report a bug and attach bug ID soon.

Comment 10 zhanghaiyan 2011-01-18 06:21:10 UTC
bug 670399 is filed to track issue 2) in comment 9

Comment 11 Keqin Hong 2011-01-18 06:29:41 UTC
FYI:
Patches are still in POST, see Bug 643687

Comment 12 Jiri Denemark 2011-01-18 08:12:12 UTC
This feature requires patches for qemu-kvm and seabios, both of them are planned for 6.1 and the corresponding bugs are in POST already so you just need to wait a little while until the review process finishes and packages are built.

qemu-kvm side is tracked by bug 643687
seabios side is tracked by bug 643688

Comment 14 Eric Blake 2011-01-18 18:13:33 UTC
Moving back into POST - additional patches from upstream should also be backported:

http://post-office.corp.redhat.com/archives/rhvirt-patches/2011-January/msg00878.html
http://post-office.corp.redhat.com/archives/rhvirt-patches/2011-January/msg00872.html

Comment 16 Vivian Bian 2011-01-28 06:10:20 UTC
bug 643687 is on POST status, and isn't pushed into the latest qemu-kvm-0.12.1.2-2.132. So leave this bug status to ON_QA till the patch is pushed into related kvm build .

Comment 18 zhanghaiyan 2011-02-10 09:35:36 UTC
Verified PASS with libvirt-0.8.7-5.el6.x86_64
- 2.6.32-94.el6.x86_64
- qemu-img-0.12.1.2-2.144.el6.x86_64
- qemu-kvm-0.12.1.2-2.144.el6.x86_64
- seabios-0.6.1.2-3.el6.x86_64

1. Edit an xml specifying boot order as below
....
  <os>
    <type arch='x86_64' machine='rhel6.0.0'>hvm</type>
  </os>
....
  <devices>
    <emulator>/usr/libexec/qemu-kvm</emulator>
    <disk type='file' device='disk'>
      <driver name='qemu' type='raw' cache='none'/>
      <source file='/mnt/Share/yoyzhang/rhel6-1.img'/>
      <target dev='hda' bus='ide'/>
      <boot order='2'/>
    </disk>
    <disk type='file' device='disk'>
      <driver name='qemu' type='raw' cache='none'/>
      <source file='/mnt/Share/yoyzhang/haha.img'/>
      <target dev='hdb' bus='ide'/>
      <boot order='1'/>
    </disk>
2. Define and start the guest
# virsh start rhel6
Domain rhel6 started
The guest failed to boot up from order1 haha.img
3. Change order between 2 disk 
The guest could be boot up from rhel6-1.img

Comment 19 Jiri Denemark 2011-05-03 13:02:52 UTC
    Technical note added. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    New Contents:
Cause
    device boot order could only be set to network, disk, cdrom, or floppy

Consequence
    users cannot chose the exact boot device

Change
    per-device <boot> element was introduced in domain XML

Result
    the <boot> element can be used to specify the exact order of boot devices

Comment 22 Laura Bailey 2011-05-04 05:40:22 UTC
    Technical note updated. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    Diffed Contents:
@@ -1,11 +1 @@
-Cause
+Device boot order could not be set more explicitly than Network, Disk, CD ROM, or Floppy. This meant that users could not select the exact boot device that they wished to use. A per-device <boot> element has been introduced, which can be used to specify the exact order of boot devices.-    device boot order could only be set to network, disk, cdrom, or floppy
-
-Consequence
-    users cannot chose the exact boot device
-
-Change
-    per-device <boot> element was introduced in domain XML
-
-Result
-    the <boot> element can be used to specify the exact order of boot devices

Comment 23 errata-xmlrpc 2011-05-19 13:23:22 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2011-0596.html


Note You need to log in before you can comment on or make changes to this bug.