GNOME Bugzilla – Bug 673856
Missing ISO source should not be treated as a fatal error
Last modified: 2016-03-31 13:59:17 UTC
To reproduce: - download an ISO image, e.g. an Ubuntu ISO - create a VM for it in Boxes and install it - once the whole installation process finishes, shut down the VM - delete the original ISO file - the VM doesn't start anymore; no error is displayed, but on the command line there's an error mentioning qemu-kvm is not able to find the original ISO file Editing the qemu configuration file with virsh and removing the drive device makes the VM boot again. Boxes should take care of automatically updating the configuration file instead, if the missing drive is not required for booting the machine.
Created attachment 211892 [details] [review] Mark CD-ROM device as optional This is done to tell libvirt/qemu to not panic if ISO file/device is unavailable.
(In reply to comment #1) > Created an attachment (id=211892) [details] [review] > Mark CD-ROM device as optional > > This is done to tell libvirt/qemu to not panic if ISO file/device is > unavailable. Requires my 'Getter/setter for disk source's startupPolicy attribute' libvirt-glib patch that is pending review on libvir list.
If the install is done, we don't need to keep the iso around. If the install is not done, the VM will be non-functional without the iso. In this case, it would probably be nicer to explain the user what's going on with some kind of error message/notification. I don't know if we need to be careful about livecds too here where my understanding is that the iso is mandatory?
(In reply to comment #3) > If the install is done, we don't need to keep the iso around. If the install is > not done, the VM will be non-functional without the iso. In this case, it would > probably be nicer to explain the user what's going on with some kind of error > message/notification. virt-manager unmounts automatically, which sometime works and sometime doesn't, depending on how you performed the installation. I guess unattended install have more chance to do this right. btw, something I think we miss in the VM settings, is a way to mount/unmount isos. > I don't know if we need to be careful about livecds too here where my > understanding is that the iso is mandatory? yes
Created attachment 211959 [details] [review] Mark CD-ROM device as optional after installation This is done to tell libvirt/qemu to not panic if ISO file/device is unavailable after OS installation.
Why not remove (eject) them?
(In reply to comment #6) > Why not remove (eject) them? Sometimes you (as user) need the installation media after installation (especially in case of windows) and we currently dont have any way to add cdrom devices to existing domains.
(In reply to comment #7) > (In reply to comment #6) > > Why not remove (eject) them? > > Sometimes you (as user) need the installation media after installation > (especially in case of windows) I don't think I've ever had that need in a long time... Aren't you told to remove the CD most of the time at the end of installers?
(In reply to comment #8) > (In reply to comment #7) > > (In reply to comment #6) > > > Why not remove (eject) them? > > > > Sometimes you (as user) need the installation media after installation > > (especially in case of windows) > > I don't think I've ever had that need in a long time... Aren't you told to > remove the CD most of the time at the end of installers? Yes but there is the assumption that user can easily insert the CD back in whenever needed.
(In reply to comment #9) > Yes but there is the assumption that user can easily insert the CD back in > whenever needed. Which would be the thing to fix rather than workarounding it, no?
(In reply to comment #10) > (In reply to comment #9) > > > Yes but there is the assumption that user can easily insert the CD back in > > whenever needed. > > Which would be the thing to fix rather than workarounding it, no? Unless there is a good reason to remove the cdrom after installation (keep in mind that our detection for "installation complete" is hardly reliable), I don't see this is a work-around.
To me that just makes our installation code look unpolished...
(In reply to comment #12) > To me that just makes our installation code look unpolished... Or that there is no (not so extremely difficult to implement) way to do this. Suggestions on better logic are more than welcomed here.
"this"? detect the end of the install? Or something else?
(In reply to comment #14) > "this"? detect the end of the install? Yes.
So whats the verdict on this one?
Well, I don't know what to tell you, at first you insist that things should be done this way for reasons that were not convincing to me, then you bring up some limitations in the current code which would make alternative worse than what your patch does, but I don't know where these current limitations are documented, which makes it hard to think about them. So dunno unfortunately
Attachment 211959 [details] pushed as 7e46c24 - Mark CD-ROM device as optional after installation
fwiw, this seems quite flaky to me too. I think we could have reached a better decision. It feels like hiding a problem.
I would have split into various bug: - the error message should have been made explicit - there could be an additional property to unmount iso - there could be a way to mount back iso - we should find a way to unmount the iso automatically when no longer need. It might not be possible for all distro today, but it should be possible for some. For example, some distro eject CD/DVD at end of install. We could also push for an agent notification etc..
(In reply to comment #20) > - there could be an additional property to unmount iso > - there could be a way to mount back iso For everything related to removable media and devices, we don't have any designs at the moment afaik, we'll need help there. > We could also push for an agent notification etc.. Yes, I was thinking that spice-gtk could expose a property telling us if an agent is running, this would be a reliable way to detect when an automatic install is done imo.
(In reply to comment #21) > For everything related to removable media and devices, we don't have any > designs at the moment afaik, we'll need help there. Yes, but at least we could have a simple lable and a button in the properties page. Somethink like CD/DVD: path-to-iso [⏏] CD/DVD: [Mount an ISO] Not saying it should be the final design, but at least we would have it ready, only UI would need to be modified. > > We could also push for an agent notification etc.. > > Yes, I was thinking that spice-gtk could expose a property telling us if an > agent is running, this would be a reliable way to detect when an automatic > install is done imo. That's not just agent is running (there is agent-connected property for that in spice-gtk), and I don't think it fits very well in spice agent. We have plenty of agents, so we just need to find which one is best. No clear idea.
I forgot to say why agent-connected is not enough: we also want the installers and live-cd to use the agent.
(In reply to comment #20) > I would have split into various bug: > - the error message should have been made explicit > - there could be an additional property to unmount iso > - there could be a way to mount back iso > - we should find a way to unmount the iso automatically when no longer need. It > might not be possible for all distro today, but it should be possible for some. > For example, some distro eject CD/DVD at end of install. We could also push for > an agent notification etc.. Could you file those as separate bugs please, then we can solve/discuss them one by one.
(In reply to comment #23) > I forgot to say why agent-connected is not enough: we also want the installers > and live-cd to use the agent. Ah comment #22 makes more sense with this :) I was indeed thinking of using agent-connected for that.