Open cheesesashimi opened 3 months 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?
@baude I've been trying to figure out a work-around for this issue by either modifying the default ignition file and replacing it with my own, or creating the missing JSON file.
When I try the above methods and then try podman machine start
the process just hangs and it never actually starts. However, I just realized, that the reason it hasn't appeared to work is probably because of the ready.service unit. Right now I see it only mentioned that the user needs to handle this themselves.
--ignition-path
Fully qualified path of the ignition file.
If an ignition file is provided, the file is copied into the user’s CONF_DIR and renamed. Additionally, no SSH keys are generated, nor are any system connections made. It is assumed that the user does these things manually or handled otherwise.
Is there documentation somewhere for me to learn how to do this manually or add the necessary units to my butane file?
Also, is that right that an ignition file that has been tested to work on FCOS running elsewhere (e.g on a VPS) would have problems starting using podman machine start
(assuming this issue about the JSON file is fixed)?
What is the progress of this ? Do we know what constitute service.ready yet - Also can someone maybe point me to more reading material on it - I also would like a workaround - I mean for those that don't included SSH authorize public keys and users and potentially only specify other things in their ignition file, it would have been nice to be able to have a working podman machine afterwards.
Any details regarding that service.ready unit will help!
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.