virt-manager/virtinst
Cole Robinson 1c8e6f8428 virt-install: Make --cloud-init reboot by default (again)
This basically reverts this commit from virt-manager 4.0.0

```
commit 825ec644b8
Author: Cole Robinson <crobinso@redhat.com>
Date:   Tue Mar 1 10:32:01 2022 -0500

    installer: Do not force reboot with --cloud-init

    Resolves: https://github.com/virt-manager/virt-manager/issues/189
```

After that commit, using `--cloud-init` or `--unattended` would
basically imply `--noreboot`

For some usage of `--cloud-init`, like in the initial report, this
makes sense to do. virt-install will drop you into the cloud image,
you mess without, run `poweroff`, and are surprised when virt-install
reboots the VM. I agreed, and made the change

But changing this was a bad idea.

cloud-init and unattended VMs have 2 XML phases. First XML is booting
off temporary media (the generated cloudinit iso), second XML is the
permanent boot config (booting off disk). We need to force the VM
to fully poweroff, so that the second XML config takes effect. We
make that happen with `<on_reboot>destroy</on_reboot>`, which tells
libvirt/qemu to poweroff the VM when it receives a guest reboot
notification. virt-install then defaults to restarting the VM when
it detects shutdown, to manually replicate the VM requested reboot,
but still get the second XML config to take effect.

The perennial problem with this is that, from outside the VM, we
don't know if the user inside the VM requested `poweroff` or `reboot`.
virt-install emulates the reboot behavior, and provides `--noreboot`
to override it. It's still confusing if a user puts a `poweroff`
command at the end of an anaconda kickstart file, and sees the VM
reboot, but it's been that way forever.

Except with that commit above, we flipped it for --cloud-init and
--unattended. Now, users who do `poweroff` are getting expected
behavior, but users who request `reboot` are not.

We could go further and add a `--yesreboot` option or similar. But
for consistency sake I think we should just revert that behavior,
and tell users to use --noreboot like usual.

Resolves: https://github.com/virt-manager/virt-manager/issues/497

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2024-10-11 14:40:03 +02:00
..
devices guest: convert_to_vnc: convert video device 2024-10-09 11:03:43 +02:00
domain cli: Add --features kvm.pv-ipi.state=on|off 2024-09-08 11:25:32 -04:00
install virt-install: Make --cloud-init reboot by default (again) 2024-10-11 14:40:03 +02:00
__init__.py i18n: globally install also the ngettext function 2020-07-14 11:24:14 -04:00
_progresspriv.py virtinstall: Hide total_size in the progress bar if it doesn't need 2022-12-14 13:18:36 -05:00
buildconfig.py Prep for release 4.1.0 2022-08-04 15:53:33 -04:00
capabilities.py capabilities: Exclude a line from code coverage 2024-09-10 13:13:46 -04:00
cli.py virt-xml: Add --edit --convert-to-vnc 2024-10-09 11:03:43 +02:00
cloner.py cloner: clone serial files 2023-03-22 17:44:06 -04:00
connection.py connection: De-duplicate ui and cli version logging 2022-08-01 06:04:48 -04:00
diskbackend.py Fix some pylint 2024-01-22 17:15:11 -05:00
domcapabilities.py domcapabilities: Add firmware patterns for loongarch64 2024-09-10 12:56:38 -04:00
generatename.py generatename: Move libvirt collision handling to callers 2019-06-11 17:54:45 -04:00
guest.py guest: convert_to_vnc: optionally add qemu-vdagent 2024-10-09 11:03:43 +02:00
logger.py tests: abide logging options for clitests 2019-12-11 17:57:28 -05:00
network.py hostnets: Remove SR-IOV info listing 2019-06-16 23:48:51 -04:00
nodedev.py nodedev: Move the CLI string format lookup to cli.py 2022-01-21 13:20:46 -05:00
osdict.py tests: test win11 XML generation 2023-01-19 11:54:03 -05:00
pollhelpers.py Fix pylint/pycodestyle warnings with latest versions 2022-12-13 11:23:45 -05:00
progress.py progress: Drop tqdm and revert back to local urlgrabber copy 2021-06-09 16:52:11 -04:00
snapshot.py virtinst: snapshot: add memory file attribute 2024-03-25 13:21:50 +01:00
storage.py virt-clone: Copy disk permissions as well 2023-09-10 11:19:31 -04:00
support.py domain: Use KEEP_TPM flag for domain rename 2024-09-19 05:48:01 +02:00
uri.py uri: Mock domcaps returning NO_SUPPORT 2024-01-22 17:07:31 -05:00
virtclone.py Remove shebangs from library paths 2021-06-22 19:54:37 -04:00
virtinstall.py virt-install: Make --cloud-init reboot by default (again) 2024-10-11 14:40:03 +02:00
virtxml.py virt-xml: Add --edit --convert-to-vnc 2024-10-09 11:03:43 +02:00
xmlapi.py cli: Add --xml xpath option for virt-install and virt-xml 2020-09-11 15:04:37 -04:00
xmlbuilder.py Fix some pylint 2023-09-12 11:54:04 -04:00
xmlutil.py xmlutil: Take unindent_device_xml from details.py 2022-08-03 12:34:47 -04:00