Functionality

Module expands the functionality of the libvirt driver for KVM and QEMU hypervisors. Virt allows to set the maximum number of processor cores and RAM instance. You can set values ​​for one specific instance or directly to the instances group by their type. In this case, additional resources are connected “on the fly”, that is, without rebooting of instances and within the limits specified for the type of maximum values.

It is needed to specify the following parameters in flavor metadata to set the maximum values for flavor:

cpu:maximum
mem:maximum

Where:

  • cpu:maximum is value for the maximum number of processor cores;
  • mem:maximum is value for the maximum amount of RAM in KB.

After that, the newly created instance will inherit the maximum allowed parameters from the flavor.

It is needed to specify in the metadata to set the current values for specific instances:

cpu:current
mem:current

Where:

  • cpu:current is value for the current number of processor cores;
  • mem:current is value for the current amount of RAM in KB.

If the guest system instance supports hot plugging of processor cores and RAM, then these values will be applied without rebooting. Otherwise, these values will be set only after restarting, while the saved maximum and current values are saved for instance.

By default, the connected RAM is immediately available in the guest system. The processor cores are connected in the off (offline) state.

They can be brought online by the command:

echo 1 > /sys/devices/system/cpu/cpu<номер>/online

In order for cores to be connected immediately online, it is necessary:

  1. In the metadata of the image (or instance snapshot, or other), from which the guest system is launched, specify the flag hw_qemu_guest_agent with the value yes. This option creates channel to connect to the qemu guest agent on the guest system:

    nova image-meta <id-image> set hw_qemu_guest_agent=yes
    
  2. Install qemu guest agent on the guest system:

    apt-get install -y qemu-guest-agent
    systemctl enable qemu-guest-agent
    systemctl start qemu-guest-agent
    

When the number of cores is set to less than the current value, the disabled cores go offline and are completely disconnected from the system upon reboot.

Transfer of information about the instance hardware

  1. To configure the transmission of instance hardware data , it is necessary:

  2. When creating instance via Nova Virt Driver, hardware information is transferred to the directory /tmp created instance. The information is presented in two files cpu.info and harware.info:

    • File /tmp/cpu.info contains columns:

      Processor number NUMA node Cores
           

      Where:

      • Processor number is serial number of the instance processor;
      • NUMA node is serial number of the NUMA node, which device belongs to;
      • Cores are serial numbers of compute node processor cores.
    • File /tmp/harware.info contains columns:

      Device model Device type NUMA node
           

      Where:

      • Device model is the device model;
      • Device type is the type of device (for example: network, HBA, FC);
      • NUMA node is serial number of the NUMA node, which device belongs to.