Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

podman machine start fails due to zero machine config #11824

Closed
afbjorklund opened this issue Oct 1, 2021 · 6 comments · Fixed by containers/common#795
Closed

podman machine start fails due to zero machine config #11824

afbjorklund opened this issue Oct 1, 2021 · 6 comments · Fixed by containers/common#795
Assignees
Labels
In Progress This issue is actively being worked by the assignee, please do not work on this at this time. kind/bug Categorizes issue or PR as related to a bug. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. machine

Comments

@afbjorklund
Copy link
Contributor

Is this a BUG REPORT or FEATURE REQUEST? (leave only one on its own line)

/kind bug

Description

Upgrading the podman configuration, hangs the machine boot.

Steps to reproduce the issue:

  1. podman machine init

  2. podman machine start

Describe the results you received:

Hangs, Waiting for VM .... There is no feedback.

When running with debug logs, the GUI show that it fails to load the initramfs.

machine-start

The root cause is that the VM gets no cpu and no ram, from the qemu command.

[/usr/bin/qemu-system-x86_64 -m 0 -smp 0 ...
There should probably be some validation, at least one CPU and at least one GB ?

Describe the results you expected:

The VM should start up.

Additional information you deem important (e.g. issue happens only occasionally):

This is the configuration, written to containers.conf

[machine]
  cpus = 0
  disk_size = 0
  memory = 0

Output of podman version:

podman version 4.0.0-dev

Output of podman info --debug:

(paste your output here)

Package info (e.g. output of rpm -q podman or apt list podman):

(paste your output here)

Have you tested with the latest version of Podman and have you checked the Podman Troubleshooting Guide? (https://github.com/containers/podman/blob/master/troubleshooting.md)

Yes

Additional environment details (AWS, VirtualBox, physical, etc.):

Ubuntu 20.04

@openshift-ci openshift-ci bot added the kind/bug Categorizes issue or PR as related to a bug. label Oct 1, 2021
@afbjorklund
Copy link
Contributor Author

Also, after running podman4 machine, podman3 machine shows warnings. But I guess that is to be expected... ?

WARN[0000] Failed to decode the keys ["engine.service_timeout" "machine" "machine.cpus" "machine.disk_size" "machine.memory"] from "/home/anders/.config/containers/containers.conf".

@Luap99
Copy link
Member

Luap99 commented Oct 1, 2021

I think the problem is that toml writes the empty values to the config file. Instead of omitempty we have to use omitzero for numeric config fields, see BurntSushi/toml#120

This is a serious problem because we already released this with podman 3.4. Once this is written to the config file every new VM will be broken.

@Luap99 Luap99 added the machine label Oct 1, 2021
@Luap99 Luap99 self-assigned this Oct 1, 2021
@Luap99 Luap99 added the In Progress This issue is actively being worked by the assignee, please do not work on this at this time. label Oct 1, 2021
Luap99 added a commit to Luap99/common that referenced this issue Oct 1, 2021
When toml writes the config file it does not use `omitempty` for numeric
values instead it requires `omitzero`. [1]

The problem is that without this change, `config.Write()` writes
```
[machine]
  cpus = 0
  disk_size = 0
  memory = 0
```
to the user file. Becuase podman machine system connection add code will
do this the config file is broken afterwads. The first vm will be created
successfully but after this every other vm will be broken because the
cpu, memory and disk size are set to zero.

[1] BurntSushi/toml#81

Fixes containers/podman#11824

Signed-off-by: Paul Holzinger <[email protected]>
Luap99 added a commit to Luap99/common that referenced this issue Oct 1, 2021
When toml writes the config file it does not use `omitempty` for numeric
values instead it requires `omitzero`. [1]

The problem is that without this change, `config.Write()` writes
```
[machine]
  cpus = 0
  disk_size = 0
  memory = 0
```
to the user file. Because podman machine system connection add code will
do this the config file is broken afterwards. The first vm will be created
successfully but after this every other vm will be broken because the
cpu, memory and disk size are set to zero.

[1] BurntSushi/toml#81

Fixes containers/podman#11824

Signed-off-by: Paul Holzinger <[email protected]>
@afbjorklund
Copy link
Contributor Author

afbjorklund commented Oct 1, 2021

The workaround is to supply all the parameters to the command.

podman machine init --cpus 1 --memory 2048 --disk-size 10

@Luap99
Copy link
Member

Luap99 commented Oct 1, 2021

Well you can also remove the bad config stuff

[machine]
  cpus = 0
  disk_size = 0
  memory = 0

It should work for the next podman machine init but after this the config file will be broken again.
PR containers/common#795 should fix this so that we do not write zero values to the config.

Luap99 added a commit to Luap99/common that referenced this issue Oct 1, 2021
When toml writes the config file it does not use `omitempty` for numeric
values instead it requires `omitzero`. [1]

The problem is that without this change, `config.Write()` writes
```
[machine]
  cpus = 0
  disk_size = 0
  memory = 0
```
to the user file. Because podman machine system connection add code will
do this the config file is broken afterwards. The first vm will be created
successfully but after this every other vm will be broken because the
cpu, memory and disk size are set to zero.

[1] BurntSushi/toml#81

Fixes containers/podman#11824

Signed-off-by: Paul Holzinger <[email protected]>
@Luap99
Copy link
Member

Luap99 commented Oct 1, 2021

Reopen because the fix is not in podman yet.

@Luap99 Luap99 reopened this Oct 1, 2021
Luap99 added a commit to Luap99/common that referenced this issue Oct 1, 2021
When toml writes the config file it does not use `omitempty` for numeric
values instead it requires `omitzero`. [1]

The problem is that without this change, `config.Write()` writes
```
[machine]
  cpus = 0
  disk_size = 0
  memory = 0
```
to the user file. Because podman machine system connection add code will
do this the config file is broken afterwards. The first vm will be created
successfully but after this every other vm will be broken because the
cpu, memory and disk size are set to zero.

[1] BurntSushi/toml#81

Fixes containers/podman#11824

Signed-off-by: Paul Holzinger <[email protected]>
Luap99 added a commit to Luap99/libpod that referenced this issue Oct 1, 2021
This fixes a bug where podman machine could create a broken config file.

Fixes containers#11824

Signed-off-by: Paul Holzinger <[email protected]>
wip-sync pushed a commit to NetBSD/pkgsrc-wip that referenced this issue Oct 3, 2021
The problem is probably due <containers/podman#11824>.
After applying it the `machine init' was successfully created together with the
`.ign'.
@Luap99
Copy link
Member

Luap99 commented Oct 5, 2021

This is fixed in the 3.4 branch and main so I close this.

@Luap99 Luap99 closed this as completed Oct 5, 2021
@github-actions github-actions bot added the locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. label Sep 21, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 21, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
In Progress This issue is actively being worked by the assignee, please do not work on this at this time. kind/bug Categorizes issue or PR as related to a bug. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. machine
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants