[PATCH 0/2] Change cdrom default bus type to scsi

From: Royce Lv <lvroyce@linux.vnet.ibm.com> tested: 1. sudo ./run_test.sh 2. create vm with a scsi cdrom successful install 3. add more than 4 cdrom success Royce Lv (2): Issue#338: Change the default cdrom bus to scsi Fix feature tests xml src/kimchi/featuretests.py | 6 +++--- src/kimchi/model/vmstorages.py | 2 +- src/kimchi/osinfo.py | 6 ++++-- 3 files changed, 8 insertions(+), 6 deletions(-) -- 1.8.1.2

From: Royce Lv <lvroyce@linux.vnet.ibm.com> CDROM cannot be extended to more than 4, this is limitation of IDE bus. Change default bus of cdrom to scsi to overcome this limitation. Signed-off-by: Royce Lv <lvroyce@linux.vnet.ibm.com> --- src/kimchi/model/vmstorages.py | 2 +- src/kimchi/osinfo.py | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/kimchi/model/vmstorages.py b/src/kimchi/model/vmstorages.py index c1c90ce..b858703 100644 --- a/src/kimchi/model/vmstorages.py +++ b/src/kimchi/model/vmstorages.py @@ -55,7 +55,7 @@ def _get_storage_xml(params): source.set(DEV_TYPE_SRC_ATTR_MAP[src_type], params.get('path')) disk.append(source) - disk.append(E.target(dev=params.get('dev'), bus='ide')) + disk.append(E.target(dev=params.get('dev'), bus='scsi')) return ET.tostring(disk) diff --git a/src/kimchi/osinfo.py b/src/kimchi/osinfo.py index 02dbabf..8d64422 100644 --- a/src/kimchi/osinfo.py +++ b/src/kimchi/osinfo.py @@ -32,7 +32,7 @@ SUPPORTED_ARCHS = {'x86': ('i386', 'x86_64'), 'power': ('ppc', 'ppc64')} common_spec = {'cpus': 1, 'cpu_cores': 1, 'cpu_threads': 1, 'memory': 1024, - 'disks': [{'index': 0, 'size': 10}], 'cdrom_bus': 'ide', + 'disks': [{'index': 0, 'size': 10}], 'cdrom_index': 2, 'mouse_bus': 'ps2'} @@ -40,8 +40,10 @@ modern_spec = dict(common_spec, disk_bus='virtio', nic_model='virtio') template_specs = {'x86': {'old': dict(common_spec, disk_bus='ide', - nic_model='e1000', sound_model='ich6'), + cdrom_bus='ide', nic_model='e1000', + sound_model='ich6'), 'modern': dict(common_spec, disk_bus='virtio', + cdrom_bus='scsi', nic_model='virtio', sound_model='ich6')}, 'power': {'old': dict(common_spec, disk_bus='scsi', -- 1.8.1.2

Reviewed-by: ShaoHe Feng <shaohef@linux.vnet.ibm.com> I have tried both SCSI and SATA are OK for cdrom. CC Adam King: I'm so sorry. I have check again, SATA also can works. The guest can boot from SATA cdrom. Maybe I make a mistake yesterday. I have set a 14 SATA cdrom on my guest. It can works. I also check the 440FX data sheet, it can also support SATA controller. But I have not tried how manySATA controllers that it can support. Just know one SATA controllers can support 6 SATA devices. On 03/13/2014 06:47 PM, lvroyce@linux.vnet.ibm.com wrote:
From: Royce Lv <lvroyce@linux.vnet.ibm.com>
CDROM cannot be extended to more than 4, this is limitation of IDE bus. Change default bus of cdrom to scsi to overcome this limitation.
Signed-off-by: Royce Lv <lvroyce@linux.vnet.ibm.com> --- src/kimchi/model/vmstorages.py | 2 +- src/kimchi/osinfo.py | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/src/kimchi/model/vmstorages.py b/src/kimchi/model/vmstorages.py index c1c90ce..b858703 100644 --- a/src/kimchi/model/vmstorages.py +++ b/src/kimchi/model/vmstorages.py @@ -55,7 +55,7 @@ def _get_storage_xml(params): source.set(DEV_TYPE_SRC_ATTR_MAP[src_type], params.get('path')) disk.append(source)
- disk.append(E.target(dev=params.get('dev'), bus='ide')) + disk.append(E.target(dev=params.get('dev'), bus='scsi')) return ET.tostring(disk)
diff --git a/src/kimchi/osinfo.py b/src/kimchi/osinfo.py index 02dbabf..8d64422 100644 --- a/src/kimchi/osinfo.py +++ b/src/kimchi/osinfo.py @@ -32,7 +32,7 @@ SUPPORTED_ARCHS = {'x86': ('i386', 'x86_64'), 'power': ('ppc', 'ppc64')}
common_spec = {'cpus': 1, 'cpu_cores': 1, 'cpu_threads': 1, 'memory': 1024, - 'disks': [{'index': 0, 'size': 10}], 'cdrom_bus': 'ide', + 'disks': [{'index': 0, 'size': 10}], 'cdrom_index': 2, 'mouse_bus': 'ps2'}
@@ -40,8 +40,10 @@ modern_spec = dict(common_spec, disk_bus='virtio', nic_model='virtio')
template_specs = {'x86': {'old': dict(common_spec, disk_bus='ide', - nic_model='e1000', sound_model='ich6'), + cdrom_bus='ide', nic_model='e1000', + sound_model='ich6'), 'modern': dict(common_spec, disk_bus='virtio', + cdrom_bus='scsi', nic_model='virtio', sound_model='ich6')}, 'power': {'old': dict(common_spec, disk_bus='scsi',
-- Thanks and best regards! Sheldon Feng(冯少合)<shaohef@linux.vnet.ibm.com> IBM Linux Technology Center

On 03/13/2014 08:18 PM, Sheldon wrote:
Reviewed-by: ShaoHe Feng <shaohef@linux.vnet.ibm.com>
I have tried both SCSI and SATA are OK for cdrom. seems SATA can not always works well. But SCSI can always works well.
CC Adam King: I'm so sorry. I have check again, SATA also can works. The guest can boot from SATA cdrom. Maybe I make a mistake yesterday.
I have set a 14 SATA cdrom on my guest. It can works.
I also check the 440FX data sheet, it can also support SATA controller.
But I have not tried how manySATA controllers that it can support.
Just know one SATA controllers can support 6 SATA devices.
On 03/13/2014 06:47 PM, lvroyce@linux.vnet.ibm.com wrote:
From: Royce Lv <lvroyce@linux.vnet.ibm.com>
CDROM cannot be extended to more than 4, this is limitation of IDE bus. Change default bus of cdrom to scsi to overcome this limitation.
Signed-off-by: Royce Lv <lvroyce@linux.vnet.ibm.com> --- src/kimchi/model/vmstorages.py | 2 +- src/kimchi/osinfo.py | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/src/kimchi/model/vmstorages.py b/src/kimchi/model/vmstorages.py index c1c90ce..b858703 100644 --- a/src/kimchi/model/vmstorages.py +++ b/src/kimchi/model/vmstorages.py @@ -55,7 +55,7 @@ def _get_storage_xml(params): source.set(DEV_TYPE_SRC_ATTR_MAP[src_type], params.get('path')) disk.append(source)
- disk.append(E.target(dev=params.get('dev'), bus='ide')) + disk.append(E.target(dev=params.get('dev'), bus='scsi')) return ET.tostring(disk)
diff --git a/src/kimchi/osinfo.py b/src/kimchi/osinfo.py index 02dbabf..8d64422 100644 --- a/src/kimchi/osinfo.py +++ b/src/kimchi/osinfo.py @@ -32,7 +32,7 @@ SUPPORTED_ARCHS = {'x86': ('i386', 'x86_64'), 'power': ('ppc', 'ppc64')}
common_spec = {'cpus': 1, 'cpu_cores': 1, 'cpu_threads': 1, 'memory': 1024, - 'disks': [{'index': 0, 'size': 10}], 'cdrom_bus': 'ide', + 'disks': [{'index': 0, 'size': 10}], 'cdrom_index': 2, 'mouse_bus': 'ps2'}
@@ -40,8 +40,10 @@ modern_spec = dict(common_spec, disk_bus='virtio', nic_model='virtio')
template_specs = {'x86': {'old': dict(common_spec, disk_bus='ide', - nic_model='e1000', sound_model='ich6'), + cdrom_bus='ide', nic_model='e1000', + sound_model='ich6'), 'modern': dict(common_spec, disk_bus='virtio', + cdrom_bus='scsi', nic_model='virtio', sound_model='ich6')}, 'power': {'old': dict(common_spec, disk_bus='scsi',
-- Thanks and best regards! Sheldon Feng(冯少合)<shaohef@linux.vnet.ibm.com> IBM Linux Technology Center

From: Royce Lv <lvroyce@linux.vnet.ibm.com> Feature test when kimchi starts, cdrom is configured to be ide, change it to be scsi to in line with our template configuration. Signed-off-by: Royce Lv <lvroyce@linux.vnet.ibm.com> --- src/kimchi/featuretests.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/kimchi/featuretests.py b/src/kimchi/featuretests.py index 045f72b..9b8f04b 100644 --- a/src/kimchi/featuretests.py +++ b/src/kimchi/featuretests.py @@ -46,10 +46,10 @@ ISO_STREAM_XML = """ <source protocol='%(protocol)s' name='/url/path/to/iso/file'> <host name='host.name' port='1234'/> </source> - <target dev='hdc' bus='ide'/> + <target dev='sr0' bus='scsi'/> <readonly/> - <alias name='ide0-1-0'/> - <address type='drive' controller='0' bus='1' target='0' unit='0'/> + <alias name='scsi0-0-1'/> + <address type='drive' controller='0' bus='0' target='0' unit='1'/> </disk> </devices> </domain>""" -- 1.8.1.2

Just a minor comment below On 03/13/2014 06:47 PM, lvroyce@linux.vnet.ibm.com wrote:
From: Royce Lv <lvroyce@linux.vnet.ibm.com>
Feature test when kimchi starts, cdrom is configured to be ide, change it to be scsi to in line with our template configuration.
Signed-off-by: Royce Lv <lvroyce@linux.vnet.ibm.com> --- src/kimchi/featuretests.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/kimchi/featuretests.py b/src/kimchi/featuretests.py index 045f72b..9b8f04b 100644 --- a/src/kimchi/featuretests.py +++ b/src/kimchi/featuretests.py @@ -46,10 +46,10 @@ ISO_STREAM_XML = """ <source protocol='%(protocol)s' name='/url/path/to/iso/file'> <host name='host.name' port='1234'/> </source> - <target dev='hdc' bus='ide'/> + <target dev='sr0' bus='scsi'/> <readonly/> - <alias name='ide0-1-0'/> - <address type='drive' controller='0' bus='1' target='0' unit='0'/> + <alias name='scsi0-0-1'/> Do we need alias? is alias not added at run time.
+ <address type='drive' controller='0' bus='0' target='0' unit='1'/> </disk> </devices> </domain>"""
-- Thanks and best regards! Sheldon Feng(冯少合)<shaohef@linux.vnet.ibm.com> IBM Linux Technology Center

Reviewed-by: Aline Manera <alinefm@linux.vnet.ibm.com> On 03/13/2014 07:47 AM, lvroyce@linux.vnet.ibm.com wrote:
From: Royce Lv <lvroyce@linux.vnet.ibm.com>
tested: 1. sudo ./run_test.sh 2. create vm with a scsi cdrom successful install 3. add more than 4 cdrom success
Royce Lv (2): Issue#338: Change the default cdrom bus to scsi Fix feature tests xml
src/kimchi/featuretests.py | 6 +++--- src/kimchi/model/vmstorages.py | 2 +- src/kimchi/osinfo.py | 6 ++++-- 3 files changed, 8 insertions(+), 6 deletions(-)

On 03/13/2014 07:47 AM, lvroyce@linux.vnet.ibm.com wrote:
From: Royce Lv <lvroyce@linux.vnet.ibm.com>
tested: 1. sudo ./run_test.sh 2. create vm with a scsi cdrom successful install 3. add more than 4 cdrom success
Royce Lv (2): Issue#338: Change the default cdrom bus to scsi Fix feature tests xml
src/kimchi/featuretests.py | 6 +++--- src/kimchi/model/vmstorages.py | 2 +- src/kimchi/osinfo.py | 6 ++++-- 3 files changed, 8 insertions(+), 6 deletions(-)
This is not working for me. I created a template from scratch and then a VM. The vm xml seems right: <disk type='file' device='cdrom'> <driver name='qemu' type='raw'/> <source file='/home/alinefm/isos/ubuntu-13.10-desktop-amd64.iso'/> <target dev='sdc' bus='scsi'/> <readonly/> <alias name='scsi0-0-2'/> <address type='drive' controller='0' bus='0' target='0' unit='2'/> </disk> But while starting the VM it could not find the boot device: screenshot
participants (3)
-
Aline Manera
-
lvroyce@linux.vnet.ibm.com
-
Sheldon