[virt-tools-list] [PATCH virt-install] virtinst: Add --transient flag.
Pavel Hrdina
phrdina at redhat.com
Thu Jun 2 10:54:05 UTC 2016
On Thu, Jun 02, 2016 at 11:27:33AM +0100, Daniel P. Berrange wrote:
> On Thu, Jun 02, 2016 at 12:20:32PM +0200, Pavel Hrdina wrote:
> > On Thu, Jun 02, 2016 at 11:02:27AM +0100, Richard W.M. Jones wrote:
> > > On Thu, Jun 02, 2016 at 11:00:16AM +0200, Pavel Hrdina wrote:
> > > > We should forbid to use --transient with all other types of install
> > > > methods because it doesn't make any sense and it doesn't work.
> > > > Unfortunately we need to add a check "if options.transient and
> > > > (options.pxe or options.cdrom or ....), we cannot simply check for
> > > > --import or --boot because --boot can be combined with any other
> > > > install method.
> > >
> > > I'm not sure I understand. Surely a --pxe install (for example) could
> > > involve a boot, and so --transient could be appropriate?
> > >
> > > What other options are in the list elided above?
> >
> > The thing is that virt-install has 2 phases while installing and each phase has
> > its own XML. The first phase is the install phase where install XML is used.
> > After the installation is completed virt-install destroys the guest, replace the
> > domain XML with boot XML and starts it again.
> >
> > If you set that the domain is transient, the domain disappears after the first
> > phase is completed. Which leads to two different solutions:
>
> > 1. allow --transient only with --import or --boot but not with other install
> > options, because they redefine the domain XML
> >
> > 2. update the code so also all other install option would be able to destroy the
> > guest and start it again only as transient. Currently it doesn't work. If you
> > use --noautoconsole or kill the virt-install during first phase there is no
> > process that will start the guest again and if you let the virt-install to start
> > the guest again it will fail with error message that the domain cannot be found.
>
> IMHO it is valid to want to install a guest, but *not* start it after
> installation is complete. IOW, --transient is semantically valid even
> with --install IMHO - it just means you would not start it after intsall
> completes.
Sure it's valid to want to install a guest but not start it, however with
--transient it would mean that the guest will disappear, which is a valid
use-case, but it would require to implement it in the installation process,
that's the second solution.
But the patch as it is now isn't complete, it needs to handle the install
methods correctly, because right now using --transient and --location for
example will ends with this error:
ERROR Domain not found: no domain with matching uuid '9b7de69d-5838-44d6-8497-0121c4f35259' (tmp)
Domain installation does not appear to have been successful.
If it was, you can restart your domain by running:
virsh --connect qemu:///system start tmp
otherwise, please restart your installation.
and adding --noautoconsole will start the installation but after the
installation is completed and the guest is rebooted it will disappear. The
installation XML contains:
...
<on_poweroff>destroy</on_poweroff>
<on_reboot>destroy</on_reboot>
<on_crash>destroy</on_crash>
...
Pavel
More information about the virt-tools-list
mailing list