In my testing I found that when we add a volume after the server is
already created, we don't honor hw_disk_bus='sata' and it instead
defaults to 'scsi'. This is also shown in your output. Example from my test:
I think that not honoring hw_disk_bus='sata' when adding a volume is
probably a bug.
I don't know if it would fixing that would fix your issue though, as I'm
not able to reproduce the same behavior you are seeing. And according to
the doc [3], it should have stayed in order if it "preserves the order
of the buses", so I'm not sure why it's happening.
I think you can go ahead and open a BZ about this issue and at the very
least, we can track our findings there. This might somehow be expected
behavior but I will need to get some input from the virt team to confirm.
Reproducing Mel's comment here:
In my testing I found that when we add a volume after the server is
already created, we don't honor hw_disk_bus='sata' and it instead
defaults to 'scsi'. This is also shown in your output. Example from my test:
<devices> /usr/bin/ qemu-system- x86_64< /emulator>
<backingStore/ >
<serial> f0314323- 07a8-4d0c- 8f8f-01de2f2df0 29</serial>
<backingStore/ >
<serial> c0166f77- bf65-48a8- 8393-bf2dfd7bdc ec</serial>
<emulator>
<disk type='block' device='disk'>
<driver name='qemu' type='raw' cache='none' io='native'/>
<source dev='/dev/sdc' index='3'/>
<target dev='sda' bus='sata'/>
<alias name='sata0-0-0'/>
<address type='drive' controller='0' bus='0' target='0' unit='0'/>
</disk>
<disk type='block' device='disk'>
<driver name='qemu' type='raw' cache='none' io='native'/>
<source dev='/dev/sdd' index='2'/>
<target dev='sdb' bus='scsi'/>
<alias name='scsi0-0-1'/>
<address type='drive' controller='0' bus='0' target='0' unit='1'/>
</disk>
Contrast that with specifying two volumes at server create time where
both disks get bus='sata':
<devices> /usr/bin/ qemu-system- x86_64< /emulator>
<backingStore/ >
<serial> f0314323- 07a8-4d0c- 8f8f-01de2f2df0 29</serial>
<backingStore/ >
<serial> c0166f77- bf65-48a8- 8393-bf2dfd7bdc ec</serial>
<emulator>
<disk type='block' device='disk'>
<driver name='qemu' type='raw' cache='none' io='native'/>
<source dev='/dev/sdc' index='2'/>
<target dev='sda' bus='sata'/>
<alias name='sata0-0-0'/>
<address type='drive' controller='0' bus='0' target='0' unit='0'/>
</disk>
<disk type='block' device='disk'>
<driver name='qemu' type='raw' cache='none' io='native'/>
<source dev='/dev/sdd' index='1'/>
<target dev='sdb' bus='sata'/>
<alias name='sata0-0-1'/>
<address type='drive' controller='0' bus='0' target='0' unit='1'/>
</disk>
I think that not honoring hw_disk_bus='sata' when adding a volume is
probably a bug.
I don't know if it would fixing that would fix your issue though, as I'm
not able to reproduce the same behavior you are seeing. And according to
the doc [3], it should have stayed in order if it "preserves the order
of the buses", so I'm not sure why it's happening.
I think you can go ahead and open a BZ about this issue and at the very
least, we can track our findings there. This might somehow be expected
behavior but I will need to get some input from the virt team to confirm.