Project

General

Profile

Actions

action #12848

closed

os-autoinst: CDROM assumed to be on SCSI controller

Added by rpalethorpe over 7 years ago. Updated over 7 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
Category:
Feature requests
Target version:
-
Start date:
2016-07-25
Due date:
% Done:

100%

Estimated time:

Description

Observation

When running os-autoinst separately from OpenQA. If CDMODEL in vars.json is not set to something beginning with virtio-scsi then it will fail to start the virtual machine.

QEMU: qemu-system-x86_64: -device scsi-cdrom,drive=cd0,bus=scsi0.0: 'scsi-cdrom' is not a valid device model name

Reproduction

Create a vars.json similar to this

{
   "ARCH" : "x86_64",   
   "BACKEND" : "qemu",
   "CASEDIR" : "/home/richie/qa/os-autoinst-distri-opensuse",
   "CDMODEL" : "scsi-cdrom",
   "DISTRI" : "opensuse",
   "ISO" : "/var/lib/openqa/factory/iso/openSUSE-Tumbleweed-DVD-x86_64-Snapshot20160715-Media.iso",
   "PRODUCTDIR" : "/home/richie/qa/os-autoinst-distri-opensuse/products/opensuse",
   "VNC" : 90,
}

and run isotovideo. Changing CDROM to virtio-scsi-pci allows isotovideo to run succesfully, however it overwrites the value with scsi-cdrom meaning that it will fail on the next run.

Discussion

In the file qemu.pm on line 305 it decides whether or not to create a SCSI controller based on the type of drives being used. It looks for drives beginning with virtio-scsi, if none are present then no scsi controller is created. Then on line 548 it assumes the CDROM has the bus address scsi0.0.

It is not clear to me where the value scsi-cdrom comes from. The default for CDMODEL in qemu.pm is virtio-scsi-pci.

Actions #1

Updated by rpalethorpe over 7 years ago

It appears there is a commit which should fix this: 0d7a8130c21ad0d6fceca6d8f8f882d98c4d2026

Actions #2

Updated by okurz over 7 years ago

so we are good? For the record, rpalethorpe refers to the commit in https://github.com/os-autoinst/os-autoinst/pull/539

Actions #3

Updated by rpalethorpe over 7 years ago

Actually it still will not work if CDMODEL is set to scsi-cd and for some reason CDMODEL is changed to scsi-cd if isotovideo is run with virtio-scsi-pci.

Actions #4

Updated by okurz over 7 years ago

  • Assignee set to dzedro

you recently worked on this right? can you help?

Actions #5

Updated by okurz over 7 years ago

I could confirm this also posed a problem for me when trying to run plain isotovideo on a vars.json generated by a recent openQA job

Actions #6

Updated by dzedro over 7 years ago

CDMODEL is by default scsi-cd not scsi-cdrom, no need to define CDMODEL
CDMODEL can be set to ide-cd e.g. to test old ide bus, or in case of windows, which doesn't have scsi drivers by default

Actions #7

Updated by rpalethorpe over 7 years ago

Sorry scsi-cdrom was a typo on my part, I meant scsi-cd. However if you let it default to scsi-cd and your HDD device type does not start with virtio-scsi either, then no scsi controller is created.

Actions #8

Updated by rpalethorpe over 7 years ago

  • Assignee changed from dzedro to rpalethorpe

I can write a simple fix for this by adding scsi-cd to the regex which is used to decide whether or a scsi controller is created. It might not be the best way to do it, but the pull request can be reviewed later.

Actions #9

Updated by rpalethorpe over 7 years ago

Turned out to be a bit more complicated than I thought, but I think I have found a reasonable fix and workaround: https://github.com/os-autoinst/os-autoinst/pull/556

Actions #10

Updated by rpalethorpe over 7 years ago

  • Status changed from New to Feedback
  • % Done changed from 0 to 90
Actions #11

Updated by rpalethorpe over 7 years ago

  • Status changed from Feedback to Resolved
  • % Done changed from 90 to 100
Actions

Also available in: Atom PDF