Navigation Menu

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Option to add/remove CD-ROM device and load/eject ISO #13454

Closed
Az3RuS opened this issue Jan 28, 2020 · 9 comments
Closed

Option to add/remove CD-ROM device and load/eject ISO #13454

Az3RuS opened this issue Jan 28, 2020 · 9 comments

Comments

@Az3RuS
Copy link

Az3RuS commented Jan 28, 2020

Hello !

Have you thought about adding an option to add CD-ROM devices but also to eject and load ISOs into them?

Like qemu-guest-agent command :

Insert : virsh change-media $VMName --path sda --source $ISO --insert --live

<disk type='file' device='cdrom'>
      <driver name='qemu' type='raw'/>
      <source file='/datastore/ISOs/CentOS-7-x86_64-Minimal-1908.iso'/>
      <backingStore/>
      <target dev='sda' bus='sata'/>
      <readonly/>
      <alias name='sata0-0-0'/>
      <address type='drive' controller='0' bus='0' target='0' unit='0'/>
    </disk>

image

Eject : virsh change-media $VMName --path sda --eject --live

    <disk type='file' device='cdrom'>
      <driver name='qemu' type='raw'/>
      <target dev='sda' bus='sata' tray='open'/>
      <readonly/>
      <alias name='sata0-0-0'/>
      <address type='drive' controller='0' bus='0' target='0' unit='0'/>
    </disk>

image
PS : When you use its controls you can already see on the cockpit the disc being added or ejected.

@KKoukiou
Copy link
Contributor

@Az3RuS thanks for opening this feature request, it's definitely a valid feature, once I find some time I will implement it.

@deajan
Copy link

deajan commented May 15, 2020

I'd totally love to see that feature too ;)

@LucienShui
Copy link

sorry for bothering, is there any implementation now?

@KKoukiou
Copy link
Contributor

KKoukiou commented Nov 9, 2020

sorry for bothering, is there any implementation now?

Not yet unfortunately.

@KKoukiou
Copy link
Contributor

This feature will be part of 238 release.
Screen Shot 2021-02-12 at 22 52 51

@lzap
Copy link

lzap commented Jul 15, 2021

Just a small nitpick - when I was trying this feature on F33, both cache and bus was set to "default" but when I hit Add, it fails with error that "bus is undefined". Once I set ti to "sata" or "scsi" it works fine.

@shodanshok
Copy link

While attaching a cdrom drive is now possible, one can not eject/change the virtual cdrom. Please add this capability.

@garrett
Copy link
Member

garrett commented Sep 26, 2022

While attaching a cdrom drive is now possible, one can not eject/change the virtual cdrom. Please add this capability.

You can actually remove a CD from a VM. It was implemented quite some time ago.

It's in the "Disks" section of an individual VM's details page. It looks like this:

image

Click on the "Remove" button that corresponds to the ISO.

I tried today and was successful when doing so. However, I did have to shut down the VM before removing the ISO. (I think you can also just make sure it's unmounted inside of the VM, but this was on a VM in the installation phase, so the ISO was actively in use.)

When the disk was in use, I did get this confusing error message, however:

Screenshot 2022-09-26 at 10-57-14 Virtual machines - garrett@Bolt

I think this error message is directly from libvirt, which is why it's so strange. We should rephrase the error to make it more straightforward. It could say something like the disc cannot be ejected as it is in use.

@shodanshok
Copy link

@garrett removing the virtual drive is not the same thing as ejecting the virtual cdrom.

Removing the virtual drive means detaching the ide/sata virtual device, a thing libvirt will not accept when the domain is running (ie: it is the equivalent of virsh detach-disk)

Ejecting the virtual cdrom means removing (or changing) the virtual ISO "inserted" in the virtual drive, a thing which can be done on a running domain (the equivalent of virsh change-media)

virt-manager provides the capability to eject/change the virtual drive from the beginning. With Red Hat deprecating it, it become important to have it in cockpit-machines.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants