Project

General

Profile

action #12848

os-autoinst: CDROM assumed to be on SCSI controller

Added by rpalethorpe almost 6 years ago. Updated almost 6 years ago.

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

100%

Estimated time:
Difficulty:

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.

History

#1 Updated by rpalethorpe almost 6 years ago

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

#2 Updated by okurz almost 6 years ago

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

#3 Updated by rpalethorpe almost 6 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.

#4 Updated by okurz almost 6 years ago

  • Assignee set to dzedro

you recently worked on this right? can you help?

#5 Updated by okurz almost 6 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

#6 Updated by dzedro almost 6 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

#7 Updated by rpalethorpe almost 6 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.

#8 Updated by rpalethorpe almost 6 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.

#9 Updated by rpalethorpe almost 6 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

#10 Updated by rpalethorpe almost 6 years ago

  • Status changed from New to Feedback
  • % Done changed from 0 to 90

#11 Updated by rpalethorpe almost 6 years ago

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

Also available in: Atom PDF