containers / podman

Podman: A tool for managing OCI containers and pods.
https://podman.io
Apache License 2.0
23.83k stars 2.42k forks source link

`podman machine list` returns wrong units for Memory and Disk size #21917

Closed tnk4on closed 8 months ago

tnk4on commented 8 months ago

Issue Description

In Podman v5, podman machine list returns wrong units for Memory and DiskSize.

Steps to reproduce the issue

Steps to reproduce the issue

% git clone https://github.com/containers/podman.git
% cd podman
% make podman-remote
% ./bin/darwin/podman machine init
% ./bin/darwin/podman machine list
NAME                    VM TYPE     CREATED         LAST UP     CPUS        MEMORY      DISK SIZE
podman-machine-default  applehv     11 minutes ago  Never       5           2KiB        100B

Describe the results you received

MEMORY      DISK SIZE
2KiB        100B

Describe the results you expected

MEMORY      DISK SIZE
2GiB        100GiB

podman info output

host:
  arch: arm64
  buildahVersion: 1.35.0-dev
  cgroupControllers:
  - cpu
  - io
  - memory
  - pids
  cgroupManager: systemd
  cgroupVersion: v2
  conmon:
    package: conmon-2.1.10-1.fc39.aarch64
    path: /usr/bin/conmon
    version: 'conmon version 2.1.10, commit: '
  cpuUtilization:
    idlePercent: 89.77
    systemPercent: 4.39
    userPercent: 5.84
  cpus: 5
  databaseBackend: sqlite
  distribution:
    distribution: fedora
    variant: coreos
    version: "39"
  eventLogger: journald
  freeLocks: 2048
  hostname: localhost.localdomain
  idMappings:
    gidmap:
    - container_id: 0
      host_id: 1000
      size: 1
    - container_id: 1
      host_id: 100000
      size: 1000000
    uidmap:
    - container_id: 0
      host_id: 501
      size: 1
    - container_id: 1
      host_id: 100000
      size: 1000000
  kernel: 6.7.5-200.fc39.aarch64
  linkmode: dynamic
  logDriver: journald
  memFree: 1487331328
  memTotal: 2047864832
  networkBackend: netavark
  networkBackendInfo:
    backend: netavark
    dns:
      package: aardvark-dns-1.10.0-1.20240229100444279141.main.16.g03ce519.fc39.aarch64
      path: /usr/libexec/podman/aardvark-dns
      version: aardvark-dns 1.11.0-dev
    package: netavark-1.10.1-1.20240229113356745230.main.40.g773fd54.fc39.aarch64
    path: /usr/libexec/podman/netavark
    version: netavark 1.11.0-dev
  ociRuntime:
    name: crun
    package: crun-1.14.4-1.20240301105205908802.main.6.gcde8f10.fc39.aarch64
    path: /usr/bin/crun
    version: |-
      crun version UNKNOWN
      commit: 856958c6c531ef30254a6e91630f56bfdedd5308
      rundir: /run/user/501/crun
      spec: 1.0.0
      +SYSTEMD +SELINUX +APPARMOR +CAP +SECCOMP +EBPF +CRIU +LIBKRUN +WASM:wasmedge +YAJL
  os: linux
  pasta:
    executable: /usr/bin/pasta
    package: passt-0^20240220.g1e6f92b-1.fc39.aarch64
    version: |
      pasta 0^20240220.g1e6f92b-1.fc39.aarch64-pasta
      Copyright Red Hat
      GNU General Public License, version 2 or later
        <https://www.gnu.org/licenses/old-licenses/gpl-2.0.html>
      This is free software: you are free to change and redistribute it.
      There is NO WARRANTY, to the extent permitted by law.
  remoteSocket:
    exists: true
    path: /run/user/501/podman/podman.sock
  security:
    apparmorEnabled: false
    capabilities: CAP_CHOWN,CAP_DAC_OVERRIDE,CAP_FOWNER,CAP_FSETID,CAP_KILL,CAP_NET_BIND_SERVICE,CAP_SETFCAP,CAP_SETGID,CAP_SETPCAP,CAP_SETUID,CAP_SYS_CHROOT
    rootless: true
    seccompEnabled: true
    seccompProfilePath: /usr/share/containers/seccomp.json
    selinuxEnabled: true
  serviceIsRemote: true
  slirp4netns:
    executable: /usr/bin/slirp4netns
    package: slirp4netns-1.2.2-1.fc39.aarch64
    version: |-
      slirp4netns version 1.2.2
      commit: 0ee2d87523e906518d34a6b423271e4826f71faf
      libslirp: 4.7.0
      SLIRP_CONFIG_VERSION_MAX: 4
      libseccomp: 2.5.3
  swapFree: 0
  swapTotal: 0
  uptime: 0h 0m 14.00s
  variant: v8
plugins:
  authorization: null
  log:
  - k8s-file
  - none
  - passthrough
  - journald
  network:
  - bridge
  - macvlan
  - ipvlan
  volume:
  - local
registries:
  search:
  - docker.io
store:
  configFile: /var/home/core/.config/containers/storage.conf
  containerStore:
    number: 0
    paused: 0
    running: 0
    stopped: 0
  graphDriverName: overlay
  graphOptions: {}
  graphRoot: /var/home/core/.local/share/containers/storage
  graphRootAllocated: 106769133568
  graphRootUsed: 2959720448
  graphStatus:
    Backing Filesystem: xfs
    Native Overlay Diff: "true"
    Supports d_type: "true"
    Supports shifting: "false"
    Supports volatile: "true"
    Using metacopy: "false"
  imageCopyTmpDir: /var/tmp
  imageStore:
    number: 0
  runRoot: /run/user/501/containers
  transientStore: false
  volumePath: /var/home/core/.local/share/containers/storage/volumes
version:
  APIVersion: 5.0.0-dev-460fc4d65
  Built: 1709251200
  BuiltTime: Fri Mar  1 09:00:00 2024
  GitCommit: ""
  GoVersion: go1.21.7
  Os: linux
  OsArch: linux/arm64
  Version: 5.0.0-dev-460fc4d65

Podman in a container

No

Privileged Or Rootless

None

Upstream Latest Release

Yes

Additional environment details

% ./bin/darwin/podman version
Client:       Podman Engine
Version:      5.0.0-dev
API Version:  5.0.0-dev
Go Version:   go1.21.7
Git Commit:   460fc4d65f3681c3b0dbd78d6521ddd905578b6d
Built:        Sun Mar  3 01:34:38 2024
OS/Arch:      darwin/arm64

Server:       Podman Engine
Version:      5.0.0-dev-460fc4d65
API Version:  5.0.0-dev-460fc4d65
Go Version:   go1.21.7
Built:        Fri Mar  1 09:00:00 2024
OS/Arch:      linux/arm64

% sw_vers
ProductName:        macOS
ProductVersion:     14.3
BuildVersion:       23D56

Additional information

No response

tnk4on commented 8 months ago

In Podman Desktop, when the podman machine is stopped, it returns incorrect units as well. (No problem when running). Screenshot 2024-03-03 at 1 09 04

afbjorklund commented 8 months ago

On a side note, it would be nice if Podman Desktop would switch to use the same units

https://en.wikipedia.org/wiki/Byte#Multiple-byte_units - currently "2.15 GB, 107.37 GB"