fedora-coreos-docs icon indicating copy to clipboard operation
fedora-coreos-docs copied to clipboard

remove qemu:commandline after first start (at least give a hint in documentation)

Open pampelmuse76 opened this issue 2 years ago • 2 comments

Describe the bug

Creating a CoreOS VM with kickstart using an ign file, the ign file must not be removed.

Reproduction steps

  1. Create a CoreOs VM with an ignition file: virt-install
    --name core1
    [...]
    --qemu-commandline="-fw_cfg name=opt/com.coreos/config,file=/tmp/coreos_5988.ign"
  2. Stop the VM (with login and shutdown)
  3. Remove the ignition file: rm /tmp/coreos_5988.ign
  4. Tring to restart the VM

virsh start core1 gives: error: Failed to start domain 'core1' error: internal error: qemu unexpectedly closed the monitor: 2023-02-04T17:40:10.657128Z qemu-system-x86_64: -fw_cfg name=opt/com.coreos/config,file=/tmp/coreos_5988.ign: can't load /tmp/coreos_5988.ign: Failed to open file “/tmp/coreos_5988.ign”: No such file or directory

Expected behavior

Removing of the ign file should be possible.

Actual behavior

There must be a manual interaction. (see Additional information)

System details

virt-install
--name core1
--vcpus 2
--memory 4096
--disk vol=m2ssd/core1
--os-variant fedora-coreos-stable
--network bridge=virbr0
--mac=${MAC}
--import
--graphics none
--noautoconsole
--qemu-commandline="-fw_cfg name=opt/com.coreos/config,file=/tmp/coreos_5988.ign"

Ignition config

variant: fcos version: 1.4.0 passwd: users: - name: core ssh_authorized_keys: - ssh-rsa [...]

Additional information

I can "solve" this problem by using

virsh edit core1 and than removing the following part at the end of the file: qemu:commandline <qemu:arg value='-fw_cfg'/> <qemu:arg value='name=opt/com.coreos/config,file=/tmp/coreos_5988.ign'/> </qemu:commandline>

pampelmuse76 avatar Feb 04 '23 17:02 pampelmuse76

Right. There's no way to make it optional. As you found out you must review it from the machine definition.

We can improve our docs around this. We'd probably need to edit https://github.com/coreos/fedora-coreos-docs/blob/main/modules/ROOT/pages/getting-started-libvirt.adoc

dustymabe avatar Feb 10 '23 17:02 dustymabe

I suggest adding the following hint:

virt-xml core1 --edit --xml xpath.delete=./qemu:commandline

pampelmuse76 avatar Feb 12 '23 20:02 pampelmuse76