9.18.13.3. Configuring descheduler evictions for virtual machines


After the descheduler is installed and configured, all migratable virtual machines (VMs) are eligible for eviction by default. You can configure the descheduler to manage VM evictions across the cluster and optionally exclude specific VMs from eviction.

Prerequisites

  • Install the descheduler in the OpenShift Container Platform web console or OpenShift CLI (oc).

Procedure

  1. Stop the VM.
  2. Configure the KubeDescheduler object with the KubeVirtRelieveAndMigrate profile and enable background evictions for improved VM eviction stability during live migration:

    apiVersion: operator.openshift.io/v1
    kind: KubeDescheduler
    metadata:
      name: cluster
      namespace: openshift-kube-descheduler-operator
    spec:
      deschedulingIntervalSeconds: 60
      profiles:
      - KubeVirtRelieveAndMigrate
      mode: Automatic
  3. Optional: To evict pods, set the mode field value to Automatic. By default, the descheduler does not evict pods.
  4. Optional: Configure limits for the number of parallel evictions to improve stability in large clusters.

    The descheduler can limit the number of concurrent evictions per node and across the cluster by using the evictionLimits field. Set these limits to match the migration limits configured in the HyperConverged custom resource (CR).

    spec:
      evictionLimits:
        node: 2
        total: 5

    Set values that correspond to the migration limits in the HyperConverged CR:

    spec:
      liveMigrationConfig:
        parallelMigrationsPerCluster: 5
        parallelOutboundMigrationsPerNode: 2
  5. Optional: To exclude the VM from eviction, add the descheduler.alpha.kubernetes.io/prefer-no-eviction annotation to the spec.template.metadata.annotations field. The change is applied dynamically and is propagated to the VirtualMachineInstance (VMI) object and the virt-launcher pod.

    Only the presence of the annotation is checked. The value is not evaluated, so "true" and "false" have the same effect.

    apiVersion: kubevirt.io/v1
    kind: VirtualMachine
    spec:
      template:
        metadata:
          annotations:
            descheduler.alpha.kubernetes.io/prefer-no-eviction: "true"
  6. Start the VM.

Result

The VM is now configured according to the descheduler settings.

Red Hat logoGithubredditYoutubeTwitter

詳細情報

試用、購入および販売

コミュニティー

会社概要

Red Hat は、企業がコアとなるデータセンターからネットワークエッジに至るまで、各種プラットフォームや環境全体で作業を簡素化できるように、強化されたソリューションを提供しています。

多様性を受け入れるオープンソースの強化

Red Hat では、コード、ドキュメント、Web プロパティーにおける配慮に欠ける用語の置き換えに取り組んでいます。このような変更は、段階的に実施される予定です。詳細情報: Red Hat ブログ.

Red Hat ドキュメントについて

Legal Notice

Theme

© 2026 Red Hat
トップに戻る