Attach/Detach CDROM not supported

Hi C.R. and Javi,
thanks for your replies, appreciated :slight_smile:
Ok, now that you mention it, when I think about how many times I properly hotplugged a IDE CDROM in hardware back in the day…no that was not very often :wink:

I tried to change my oned.conf to have scsi drives (sd) as a default for cdroms. From this message it seems to me that it doesn’t actually mean the scsi bus, but the device type CDROM that is not supported for detaching:

Tue Feb 7 17:04:14 2017 [Z0][VMM][D]: Message received: LOG I 156 Command execution fail: cat << EOT | /var/tmp/one/vmm/kvm/detach_disk ‘one-156’ ‘/var/lib/one//datastores/0/156/disk.0’ ‘sda’ ‘0’ 156 s001310a
Tue Feb 7 17:04:14 2017 [Z0][VMM][D]: Message received: LOG E 156 detach_disk: Command “virsh --connect qemu:///system detach-disk --domain one-156 --target sda” failed: error: Failed to detach disk
Tue Feb 7 17:04:14 2017 [Z0][VMM][D]: Message received: LOG I 156 error: Operation not supported: disk device type ‘cdrom’ cannot be detached
Tue Feb 7 17:04:14 2017 [Z0][VMM][D]: Message received: LOG E 156 Could not detach sda from one-156
Tue Feb 7 17:04:14 2017 [Z0][VMM][D]: Message received: LOG I 156 ExitCode: 1
Tue Feb 7 17:04:14 2017 [Z0][VMM][D]: Message received: LOG I 156 Failed to execute virtualization driver operation: detach_disk.

I am thinking about extending the script /var/lib/one/remotes/vmm/kvm/detach_disk, so it does the change-media command when it is definitely a CDROM device that is to be detached.

but does this script actually “know” that it is a cdrom?

looks like it’s getting this variables:
DOMAIN="$1"
SOURCE="$2"
TARGET="$3"
TARGET_INDEX="$4"

TARGET tells me only that it is a hd*, vd* or hd*, which does not say anything about the image-type. what is TARGET_INDEX Javi?

thanks a lot!!!
best Jojo