Bug 1380309
Summary: | libvirt: SCSI: hostdev / controller host-plug related fixes | ||
---|---|---|---|
Product: | Red Hat Enterprise Linux 7 | Reporter: | Marcel Kolaja <mkolaja> |
Component: | libvirt | Assignee: | Ján Tomko <jtomko> |
Status: | CLOSED ERRATA | QA Contact: | Virtualization Bugs <virt-bugs> |
Severity: | unspecified | Docs Contact: | |
Priority: | high | ||
Version: | 7.3 | CC: | dyuan, jdenemar, jherrman, jtomko, kchamart, lmiksik, rbalakri, xuzhang, yisun |
Target Milestone: | rc | Keywords: | ZStream |
Target Release: | --- | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
Whiteboard: | |||
Fixed In Version: | libvirt-1.2.17-13.el7_2.6 | Doc Type: | Bug Fix |
Doc Text: |
Previously, hot plugging a SCSI device to a guest with no usable SCSI controller failed. This update ensures that the automatic addition of the SCSI controller is performed in the correct order, and the SCSI hot plug now works properly in the described circumstances.
|
Story Points: | --- |
Clone Of: | 1377212 | Environment: | |
Last Closed: | 2016-11-09 17:17:26 UTC | Type: | --- |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: | |||
Bug Depends On: | 1377212 | ||
Bug Blocks: | 1343302 |
Description
Marcel Kolaja
2016-09-29 09:22:05 UTC
Verified on libvirt-1.2.17-13.el7_2.6.x86_64 and PASSED ===================== prepare following script, and having a powered on vm named "vm1" ====================== # cat test.sh #!/bin/bash # Purpose: Attach two SCSI disks to a SCSI controller '2'. The smaller # controller indices '1' and '0' should be automatically created. set -x image_dir="/var/lib/libvirt/images" vm_name="vm1" disk_scsi_index="2" # Create three raw disk images function create_disk() { for i in {b..c}; do qemu-img create -f raw $image_dir/$i.raw 512M; done } # This is incrementing the 'unit' (a "2-digit unit number on a bus") # attribute, for the 'address' sub-element, which describes where the # device is placed on the virtual bus presented to the guest. # http://libvirt.org/formatdomain.html#elementsAddress virsh dumpxml $vm_name | grep scsi j=1 # Construct a guest XML by attaching two SCSI disks onto the *second* controller # (and manually increment the 'unit' number) function attach_device() { for i in {b..c}; do j=$(expr $j + 1) cat << EOF > disk-$i.xml <disk type='file' device='disk'> <source file='$image_dir/$i.raw'/> <target dev='sd$i' bus='scsi'/> <address type='drive' controller='$disk_scsi_index' model='virtio-scsi' bus='0' target='0' unit='$j'/> </disk> EOF # Attach the device; it takes effect on next boot virsh attach-device $vm_name disk-$i.xml --live virsh dumpxml $vm_name | grep scsi done } create_disk attach_device ======================= disk_scsi_index="2" in script ======================== # sh test.sh + image_dir=/var/lib/libvirt/images + vm_name=vm1 + disk_scsi_index=2 + virsh dumpxml vm1 + grep scsi + j=1 + create_disk + for i in '{b..c}' + qemu-img create -f raw /var/lib/libvirt/images/b.raw 512M Formatting '/var/lib/libvirt/images/b.raw', fmt=raw size=536870912 + for i in '{b..c}' + qemu-img create -f raw /var/lib/libvirt/images/c.raw 512M Formatting '/var/lib/libvirt/images/c.raw', fmt=raw size=536870912 + attach_device + for i in '{b..c}' ++ expr 1 + 1 + j=2 + cat + virsh attach-device vm1 disk-b.xml --live Device attached successfully + virsh dumpxml vm1 + grep scsi <target dev='sdb' bus='scsi'/> <alias name='scsi2-0-0-2'/> <controller type='scsi' index='0'> <alias name='scsi0'/> <controller type='scsi' index='1'> <alias name='scsi1'/> <controller type='scsi' index='2'> <alias name='scsi2'/> + for i in '{b..c}' ++ expr 2 + 1 + j=3 + cat + virsh attach-device vm1 disk-c.xml --live Device attached successfully + virsh dumpxml vm1 + grep scsi <target dev='sdb' bus='scsi'/> <alias name='scsi2-0-0-2'/> <target dev='sdc' bus='scsi'/> <alias name='scsi2-0-0-3'/> <controller type='scsi' index='0'> <alias name='scsi0'/> <controller type='scsi' index='1'> <alias name='scsi1'/> <controller type='scsi' index='2'> <alias name='scsi2'/> ============================== disk_scsi_index="10" in script =========== # sh test.sh + image_dir=/var/lib/libvirt/images + vm_name=vm1 + disk_scsi_index=10 + virsh dumpxml vm1 + grep scsi + j=1 + create_disk + for i in '{b..c}' + qemu-img create -f raw /var/lib/libvirt/images/b.raw 512M Formatting '/var/lib/libvirt/images/b.raw', fmt=raw size=536870912 + for i in '{b..c}' + qemu-img create -f raw /var/lib/libvirt/images/c.raw 512M Formatting '/var/lib/libvirt/images/c.raw', fmt=raw size=536870912 + attach_device + for i in '{b..c}' ++ expr 1 + 1 + j=2 + cat + virsh attach-device vm1 disk-b.xml --live Device attached successfully + virsh dumpxml vm1 + grep scsi <target dev='sdb' bus='scsi'/> <alias name='scsi10-0-0-2'/> <controller type='scsi' index='0'> <alias name='scsi0'/> <controller type='scsi' index='1'> <alias name='scsi1'/> <controller type='scsi' index='2'> <alias name='scsi2'/> <controller type='scsi' index='3'> <alias name='scsi3'/> <controller type='scsi' index='4'> <alias name='scsi4'/> <controller type='scsi' index='5'> <alias name='scsi5'/> <controller type='scsi' index='6'> <alias name='scsi6'/> <controller type='scsi' index='7'> <alias name='scsi7'/> <controller type='scsi' index='8'> <alias name='scsi8'/> <controller type='scsi' index='9'> <alias name='scsi9'/> <controller type='scsi' index='10'> <alias name='scsi10'/> + for i in '{b..c}' ++ expr 2 + 1 + j=3 + cat + virsh attach-device vm1 disk-c.xml --live Device attached successfully + virsh dumpxml vm1 + grep scsi <target dev='sdb' bus='scsi'/> <alias name='scsi10-0-0-2'/> <target dev='sdc' bus='scsi'/> <alias name='scsi10-0-0-3'/> <controller type='scsi' index='0'> <alias name='scsi0'/> <controller type='scsi' index='1'> <alias name='scsi1'/> <controller type='scsi' index='2'> <alias name='scsi2'/> <controller type='scsi' index='3'> <alias name='scsi3'/> <controller type='scsi' index='4'> <alias name='scsi4'/> <controller type='scsi' index='5'> <alias name='scsi5'/> <controller type='scsi' index='6'> <alias name='scsi6'/> <controller type='scsi' index='7'> <alias name='scsi7'/> <controller type='scsi' index='8'> <alias name='scsi8'/> <controller type='scsi' index='9'> <alias name='scsi9'/> <controller type='scsi' index='10'> <alias name='scsi10'/> Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://rhn.redhat.com/errata/RHBA-2016-2688.html |