Skip to main content
Version: latest

Manage CPU and Memory

You can use the KubeVirt CPU Hotplug and KubeVirt Memory Hotplug feature in Palette, which allows the Virtual Machine (VM) to add and remove virtual CPUs and increase or decrease memory while the VM is active. By default, live migration is automatically enabled to apply the changes without rebooting the VM.

Limitations

  • CPU and memory hotplug is not currently supported by the ARM64 architecture.
  • The current CPU and memory hotplug implementation requires the live migration of the VM workload.

Prerequisites

  • A VM deployed and active in Palette.

Manage CPU and Memory

Select the tab that corresponds to the method you want to use to enable CPU or memory hotplug in your VM.

  1. Log in to Palette.

  2. From the left main menu, select Clusters, and then select the cluster with the VM you want to update.

  3. Select the Virtual Machines tab, then select the necessary VM and open its Configuration tab. Click on the pencil icon for CPU|Memory.

    Palette with a Virtual Machine Configuration tab displayed.

  4. Change the desired CPU sockets under vCPU and memory for the VM. You can also select Set CPU topology manually to configure specific cores, sockets, and threads for the VM.

    View of the Memory and CPU Change Box

    warning

    You must restart the VM to apply any changes made to Cores or Threads.

  5. Select Save.

  6. A live migration of the VM occurs automatically if changes have been made to the CPU sockets or memory. If you adjusted the cores or threads, you must restart the VM to apply those changes.

Validate

  1. Log in to Palette.

  2. From the left main menu, select Clusters, and then select the cluster with the VM you want to update.

  3. Select the Virtual Machines tab, then select the necessary VM and open its Console tab.

  4. Log in to the VM using the appropriate credentials specified in the YAML template. The provided templates contain the default credentials for the VM in the cloudInitNoCloud.userData section.

  5. Verify that the VM has the expected number of CPUs or memory size. Use the following commands to verify the number of CPUs, memory size, and number of CPU cores. Keep in mind that the commands may vary based on the OS.

    To verify the number of CPUs and cores, issue the following command.

    lscpu
    Example lscpu output
    ...
    CPU(s): 12
    ...
    Thread(s) per core: 1
    Core(s) per socket: 3
    Socket(s): 4
    ...

    To verify the memory size, issue the following command.

    free --human
    Example free output
                  total        used        free      shared  buff/cache   available
    Mem: 2.0Gi 168Mi 1.5Gi 8.0Mi 320Mi 1.7Gi
    Swap: 2.0Gi 0B 2.0Gi