Bug 707653

Summary: [vdsm] Boot sequence - vm tries to boot from the wrong disk.
Product: Red Hat Enterprise Linux 6 Reporter: David Naori <dnaori>
Component: vdsmAssignee: Erez Shinan <erez>
Status: CLOSED DUPLICATE QA Contact: yeylon <yeylon>
Severity: medium Docs Contact:
Priority: medium    
Version: 6.1CC: abaron, bazulay, dallan, danken, dnaori, hateya, iheim, jdenemar, mgoldboi, srevivo, ykaul
Target Milestone: rcKeywords: Regression
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-06-02 08:09:12 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description David Naori 2011-05-25 16:04:23 UTC
Description of problem:
When vm's system disk interface = VirtIO and adding IDE data disk the vm tries to boot from the additional disk instead of the system VirtIO disk.

vdsm send the domain-xml with the following BIOS bootloader parameters:
  <os>
    <type arch='x86_64' machine='rhel6.0.0'>hvm</type>
    <boot dev='hd'/>
    <smbios mode='sysinfo'/>
  </os>

those are general boot elements while per-device boot elements can be used (tested with the following parameters which works):

    <disk type='block' device='disk'>
      <driver name='qemu' type='qcow2' cache='none' error_policy='stop' io='native'/>
      <source dev='/rhev/data-center/0085ed54-d00b-47f0-a6fc-550e85544994/15224294-0cc0-460a-b715-f881309cfe23/images/84d325cd-5e43-47dab6c0-680b89ec5b07/e13948e5-7a94-447b-9dfe-4fe95c304d98'/>
      <target dev='hda' bus='virtio'/>
+     <boot order='1'/>
      <serial>da-b6c0-680b89ec5b07</serial>
      <alias name='virtio-disk0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/>
    </disk>


Version-Release number of selected component (if applicable):
vdsm-4.9-69.el6.x86_64

How reproducible:
100%

Steps to Reproduce:
1.install os on VirtIO system disk
2.add IDE data disk
  
Actual results:
boot fails ; not a bootable disk

Additional info:

domain xml:

<domain type='kvm' id='5'>
  <name>iscsi-libvirt-002</name>
  <uuid>1b649d07-e576-41ff-a20e-0bb116bb9d4a</uuid>
  <memory>262144</memory>
  <currentMemory>262144</currentMemory>
  <vcpu>1</vcpu>
  <sysinfo type='smbios'>
    <system>
      <entry name='manufacturer'>Red Hat</entry>
      <entry name='product'>RHEL</entry>
      <entry name='version'>6Server-6.1.0.2.el6</entry>
      <entry name='serial'>5CE56207-BBAF-30D4-B673-4EE33E855A7C_00:10:18:24:47:F2</entry>
      <entry name='uuid'>1b649d07-e576-41ff-a20e-0bb116bb9d4a</entry>
    </system>
  </sysinfo>
  <os>
    <type arch='x86_64' machine='rhel6.0.0'>hvm</type>
    <boot dev='hd'/>
    <smbios mode='sysinfo'/>
  </os>
  <features>
    <acpi/>
  </features>
  <cpu match='exact'>
    <model>Conroe</model>
    <topology sockets='1' cores='1' threads='1'/>
  </cpu>
  <clock offset='variable' adjustment='0'/>
  <on_poweroff>destroy</on_poweroff>
  <on_reboot>restart</on_reboot>
  <on_crash>destroy</on_crash>
  <devices>
    <emulator>/usr/libexec/qemu-kvm</emulator>
    <disk type='block' device='disk'>
      <driver name='qemu' type='qcow2' cache='none' error_policy='stop' io='native'/>
      <source dev='/rhev/data-center/0085ed54-d00b-47f0-a6fc-550e85544994/15224294-0cc0-460a-b715-f881309cfe23/images/84d325cd-5e43-47da-b6c0-680b89ec5b07/e13948e5-7a94-447b-9dfe-4fe95c304d98'/>
      <target dev='hda' bus='virtio'/>
      <serial>da-b6c0-680b89ec5b07</serial>
      <alias name='virtio-disk0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/>
    </disk>
    <disk type='block' device='disk'>
      <driver name='qemu' type='raw' cache='none' error_policy='stop' io='native'/>
      <source dev='/rhev/data-center/0085ed54-d00b-47f0-a6fc-550e85544994/15224294-0cc0-460a-b715-f881309cfe23/images/affa8ca9-4eb0-4413-b198-3353687f9a42/67d4d4db-c2df-4a0a-a386-206cb44b3b9f'/>
      <target dev='hda' bus='ide'/>
      <serial>13-b198-3353687f9a42</serial>
      <alias name='ide0-0-0'/>
      <address type='drive' controller='0' bus='0' unit='0'/>
    </disk>
    <disk type='file' device='cdrom'>
      <driver name='qemu' type='raw'/>
      <target dev='hdc' bus='ide'/>
      <readonly/>
      <alias name='ide0-1-0'/>
      <address type='drive' controller='0' bus='1' unit='0'/>
    </disk>
    <controller type='virtio-serial' index='0' ports='16'>
      <alias name='virtio-serial0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>
    </controller>
    <controller type='ide' index='0'>
      <alias name='ide0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/>
    </controller>
    <interface type='bridge'>
      <mac address='00:1a:4a:16:02:3f'/>
      <source bridge='rhevm'/>
      <target dev='vnet5'/>
      <model type='e1000'/>
      <alias name='net0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
    </interface>
    <channel type='unix'>
      <source mode='bind' path='/var/lib/libvirt/qemu/channels/iscsi-libvirt-002.com.redhat.rhevm.vdsm'/>
      <target type='virtio' name='com.redhat.rhevm.vdsm'/>
      <alias name='channel0'/>
      <address type='virtio-serial' controller='0' bus='0' port='1'/>
    </channel>
    <channel type='spicevmc'>
      <target type='virtio' name='com.redhat.spice.0'/>
      <alias name='channel1'/>
      <address type='virtio-serial' controller='0' bus='0' port='2'/>
    </channel>
    <input type='mouse' bus='ps2'/>
    <graphics type='spice' port='5902' tlsPort='5903' autoport='yes' listen='0' keymap='en-us' passwdValidTo='1970-01-01T00:00:01'>
      <channel name='main' mode='secure'/>
      <channel name='inputs' mode='secure'/>
    </graphics>
    <sound model='ich6'>
      <alias name='sound0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
    </sound>
    <video>
      <model type='qxl' vram='65536' heads='1'/>
      <alias name='video0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
    </video>
    <memballoon model='none'>
      <alias name='balloon0'/>
    </memballoon>
  </devices>
  <seclabel type='dynamic' model='selinux'>
    <label>system_u:system_r:svirt_t:s0:c872,c974</label>
    <imagelabel>system_u:object_r:svirt_image_t:s0:c872,c974</imagelabel>
  </seclabel>
</domain>


qemu-kvm command:

/usr/libexec/qemu-kvm -S -M rhel6.0.0 -cpu Conroe -enable-kvm -m 256 -smp 1,sockets=1,cores=1,threads=1 -name iscsi-libvirt-002 -uuid 1b649d07-e576-41ff-a20e-0bb116bb9d4a -smbios type=1,manufacturer=Red Hat,product=RHEL,version=6Server-6.1.0.2.el6,serial=5CE56207-BBAF-30D4-B673-4EE33E855A7C_00:10:18:24:47:F2,uuid=1b649d07-e576-41ff-a20e-0bb116bb9d4a -nodefconfig -nodefaults -chardev socket,id=charmonitor,path=/var/lib/libvirt/qemu/iscsi-libvirt-002.monitor,server,nowait -mon chardev=charmonitor,id=monitor,mode=control -rtc base=2011-05-25T15:59:59 -boot c -device virtio-serial-pci,id=virtio-serial0,max_ports=16,bus=pci.0,addr=0x5 -drive file=/rhev/data-center/0085ed54-d00b-47f0-a6fc-550e85544994/15224294-0cc0-460a-b715-f881309cfe23/images/84d325cd-5e43-47da-b6c0-680b89ec5b07/e13948e5-7a94-447b-9dfe-4fe95c304d98,if=none,id=drive-virtio-disk0,format=qcow2,serial=da-b6c0-680b89ec5b07,cache=none,werror=stop,rerror=stop,aio=native -device virtio-blk-pci,bus=pci.0,addr=0x6,drive=drive-virtio-disk0,id=virtio-disk0 -drive file=/rhev/data-center/0085ed54-d00b-47f0-a6fc-550e85544994/15224294-0cc0-460a-b715-f881309cfe23/images/affa8ca9-4eb0-4413-b198-3353687f9a42/67d4d4db-c2df-4a0a-a386-206cb44b3b9f,if=none,id=drive-ide0-0-0,format=raw,serial=13-b198-3353687f9a42,cache=none,werror=stop,rerror=stop,aio=native -device ide-drive,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0 -drive if=none,media=cdrom,id=drive-ide0-1-0,readonly=on,format=raw -device ide-drive,bus=ide.1,unit=0,drive=drive-ide0-1-0,id=ide0-1-0 -netdev tap,fd=24,id=hostnet0 -device e1000,netdev=hostnet0,id=net0,mac=00:1a:4a:16:02:3f,bus=pci.0,addr=0x3 -chardev socket,id=charchannel0,path=/var/lib/libvirt/qemu/channels/iscsi-libvirt-002.com.redhat.rhevm.vdsm,server,nowait -device virtserialport,bus=virtio-serial0.0,nr=1,chardev=charchannel0,id=channel0,name=com.redhat.rhevm.vdsm -chardev spicevmc,id=charchannel1,name=vdagent -device virtserialport,bus=virtio-serial0.0,nr=2,chardev=charchannel1,id=channel1,name=com.redhat.spice.0 -usb -spice port=5902,tls-port=5903,addr=0,x509-dir=/etc/pki/vdsm/libvirt-spice,tls-channel=main,tls-channel=inputs -k en-us -vga qxl -global qxl-vga.vram_size=67108864 -device intel-hda,id=sound0,bus=pci.0,addr=0x4 -device hda-duplex,id=sound0-codec0,bus=sound0.0,cad=0

Comment 5 Dan Kenigsberg 2011-05-29 16:20:09 UTC
Dave, could it be that the relatively-recent <bootorder> feature of libvirt caused a change to the behavior of the old <boot> element? If I'm not mistaken, with boot=c, boot was attempted from disk according to their specification order.

Comment 6 Dan Kenigsberg 2011-05-30 19:35:01 UTC
David N, which vdsm and libvirt versions are you using? Please try with libvirt-0.8.7 if you haven't.

Comment 7 David Naori 2011-05-31 17:01:28 UTC
(In reply to comment #6)
> David N, which vdsm and libvirt versions are you using? Please try with
> libvirt-0.8.7 if you haven't.

I used:
vdsm-4.9-69.el6.x86_64
libvirt-0.9.1-1.el6.x86_64

Tested with libvirt-0.8.7-18.el6.x86_64- same behaviour.

Comment 8 Dan Kenigsberg 2011-05-31 18:48:16 UTC
(In reply to comment #7)
> 
> Tested with libvirt-0.8.7-18.el6.x86_64- same behaviour.

This puts the problem squarely on vdsm's field.

Comment 9 Dave Allan 2011-06-01 20:59:14 UTC
Dan, Jiri did a bunch of work in this area, so I've asked him to respond.

Comment 10 Jiri Denemark 2011-06-02 08:09:12 UTC
Actually, the regression is caused by qemu-kvm so just downgrading libvirt doesn't make it work again. However, the regression in qemu-kvm was intentional and libvirt needs to be learned to work with that.

More details can be found in bug 704144. In short, libvirt used to use boot=on to say which disk is bootable but that is not supported by rhel qemu anymore and libvirt needs to use bootindex for this.

*** This bug has been marked as a duplicate of bug 704144 ***