9.18. Advanced virtual machine management


9.18.1. Working with resource quotas for virtual machines

Manage and control virtual machine resource consumption to prevent overcommitment and ensure stable workload performance.

Create and manage resource quotas for virtual machines.

9.18.1.1. Setting resource quota limits for virtual machines

By default, OpenShift Virtualization automatically manages CPU and memory limits for virtual machines (VMs) if a namespace enforces resource quotas that require limits to be set. The memory limit is automatically set to twice the requested memory and the CPU limit is set to one per vCPU.

You can customize the memory limit ratio for a specific namespace by adding the alpha.kubevirt.io/auto-memory-limits-ratio label to the namespace. For example, the following command sets the memory limit ratio to 1.2:

$ oc label ns/my-virtualization-project  alpha.kubevirt.io/auto-memory-limits-ratio=1.2
주의

Avoid managing resource quota limits manually. To prevent misconfigurations or scheduling issues, rely on the automatic resource limit management provided by OpenShift Virtualization unless you have a specific need to override the defaults.

Resource quotas that only use requests automatically work with VMs. If your resource quota uses limits, you must manually set resource limits on VMs. Memory resource limits, defined by the spec.template.spec.domain.resources.limits.memory value, must be at least 500 MiB, or 2% larger than the spec.template.spec.domain.memory.guest value.

Procedure

  1. Set limits for a VM by editing the VirtualMachine manifest. For example:

    apiVersion: kubevirt.io/v1
    kind: VirtualMachine
    metadata:
      name: with-limits
    spec:
      runStrategy: Halted
      template:
        spec:
          domain:
            memory:
              guest: 128Mi
            resources:
              limits:
                memory: 256Mi

    where

    spec.template.spec.domain.memory.guest
    Specifies the actual amount of RAM that is shown to the guest operating system (OS) in the VM.
    spec.template.spec.domain.resources.limits.memory

    Specifies the hard limit for total memory consumption by the virt-launcher pod that hosts the VM. This limit must account for the guest OS RAM plus the hypervisor overhead.

    This example configuration is supported because the spec.template.spec.domain.resources.limits.memory value is at least 100Mi larger than the spec.template.spec.domain.memory.guest value.

  2. Save the VirtualMachine manifest.
Red Hat logoGithubredditYoutubeTwitter

자세한 정보

평가판, 구매 및 판매

커뮤니티

Red Hat 소개

Red Hat은 기업이 핵심 데이터 센터에서 네트워크 에지에 이르기까지 플랫폼과 환경 전반에서 더 쉽게 작업할 수 있도록 강화된 솔루션을 제공합니다.

보다 포괄적 수용을 위한 오픈 소스 용어 교체

Red Hat은 코드, 문서, 웹 속성에서 문제가 있는 언어를 교체하기 위해 최선을 다하고 있습니다. 자세한 내용은 다음을 참조하세요.Red Hat 블로그.

Red Hat 문서 정보

Legal Notice

Theme

© 2026 Red Hat
맨 위로 이동