remove qemu:commandline after first start (at least give a hint in documentation)
Describe the bug
Creating a CoreOS VM with kickstart using an ign file, the ign file must not be removed.
Reproduction steps
- 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" - Stop the VM (with login and shutdown)
- Remove the ignition file: rm /tmp/coreos_5988.ign
- 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>
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
I suggest adding the following hint:
virt-xml core1 --edit --xml xpath.delete=./qemu:commandline