Working with resource quotas for virtual machines

Create and manage resource quotas for virtual machines.

Setting resource quota limits for virtual machines

Resource quotas that only use requests automatically work with virtual machines (VMs). If your resource quota uses limits, you must manually set resource limits on VMs. Resource limits must be at least 100 MiB larger than resource requests.

Procedure

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

    1. apiVersion: kubevirt.io/v1
    2. kind: VirtualMachine
    3. metadata:
    4. name: with-limits
    5. spec:
    6. running: false
    7. template:
    8. spec:
    9. domain:
    10. # ...
    11. resources:
    12. requests:
    13. memory: 128Mi
    14. limits:
    15. memory: 256Mi (1)
    1This configuration is supported because the limits.memory value is at least 100Mi larger than the requests.memory value.
  2. Save the VirtualMachine manifest.

Additional resources