Open cheesesashimi opened 1 month ago
I would welcome a PR and nice find! The behavior is like so. If the user provides an ignition file, we do no additional ignition changes (so no ready unit). And yes, we should be writing a JSON and we should write a regression test as such with your PR (just init and check the json is there, we dont have to start it). lmk if you need any help with this one.
I am running into this bug as well. Is there a work-around that can be used in the meantime?
Issue Description
Whenever the
--ignition-path
argument is provided topodman machine init
, Podman silently fails to write the<machine-name>.json
config file. If I add the--now
flag or when I try to runpodman machine start <machine-name>
, I get the following error:Steps to reproduce the issue
Steps to reproduce the issue
podman machine init --ignition-path=./ignition.json
.podman machine start
.Describe the results you received
Whenever I run
podman machine init --ignition-path=./ignition.json
, it fails to create thepodman-machine-default.json
andpodman-machine-default.ign
files. Running this with--log-level=debug
below provides the following output:Trying to start the machine, I get the following output:
Neither the
podman-machine-default.json
file nor thepodman-machine-default.ign
files were created:By comparison, omitting the
--ignition-path
flag yields the following normal behaviors:When this happens, I can start the Podman VM normally. Additionally, I can see that the config files were created as expected:
Describe the results you expected
I would have expected the
podman-machine-default.json
file to be created and the VM should be able to start by runningpodman machine start <vm-name>
.podman info output
Podman in a container
No
Privileged Or Rootless
None
Upstream Latest Release
No
Additional environment details
Additional environment details
Additional information
This only occurs whenever the
--ignition-path=
option is provided topodman machine init
. Otherwise, it works as it should. I did a bit of debugging and code spelunking to try to figure out how / why this is happening, and found this:https://github.com/containers/podman/blob/main/pkg/machine/shim/host.go#L193-L198
So essentially, we return early and never make it to this part:
https://github.com/containers/podman/blob/main/pkg/machine/shim/host.go#L237-L247
I feel like I have enough context that I can submit a PR to fix this issue. However, what I'm not sure of is what the preferred behavior should be whenever a user provides their own Ignition config. In other words, should the
ready.service
unit be added to the user-provided Ignition config or should the user-provided Ignition config be used as-is:https://github.com/containers/podman/blob/main/pkg/machine/shim/host.go#L200-L220
Personally, I'm of the opinion that the
ready.service
unit should not be added to user-supplied Ignition, but I could be persuaded otherwise. Anyway, please let me know if there is any further information that would be helpful here.