Visitar URL original
`nerdctl run --isolation hyperv --memory` fails: UVM memory annotation is set in bytes · Issue #5337 · containerd/nerdctl · GitHub
Skip to content

nerdctl run --isolation hyperv --memory fails: UVM memory annotation is set in bytes #5337

Open

Description

@vitaliy-leschenko

nerdctl run --isolation hyperv --memory 2g <image> fails on Windows Server 2025 (nerdctl 2.4.2):

hcs::CreateComputeSystem <id>@vm: winapi error #2147749931

The Microsoft-Windows-Hyper-V-Compute-Admin log shows "Memory virtual quantity above maximum."

pkg/cmd/container/run_windows.go writes mem64 (bytes, from units.RAMInBytes) into
io.microsoft.virtualmachine.computetopology.memory.sizeinmb. hcsshim documents this
annotation as MB: "the caller MUST use MB or sizing will be wrong".

With --memory 2g the annotation in the OCI spec is 2147483648.
--memory 2048 (2048 bytes) gives a 2047 MB utility VM.
--memory 2g --annotation io.microsoft.virtualmachine.computetopology.memory.sizeinmb=2048 works.

Suggested fix: fmt.Sprintf("%v", mem64/(1024*1024)).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions