Rate This Document
Findability
Accuracy
Completeness
Readability

Installation and Deployment

  • Basic libvirt components must be installed and deployed in common application scenarios.
  • VSched contains two binary files vas-daemon and vas-cli whose user and user group are root and file permission is 500.
  • The service deployment path is /usr/local/vas/.
  • VSched supports both static and dynamic core binding. Static core binding is used by default. For details about dynamic core binding, see VSched Deployment (Dynamic Core Binding Mode).
  1. Obtain the BoostKit-boostvirt-vas-1.0.0.zip software package as instructed in Obtaining Software Packages and decompress the package to obtain the boostvirt-vas-1.0.0.rpm package.
  2. Check whether libsecurec is installed on all service nodes.
    1. Run the following command to check whether libsecurec has been installed on a node:
      rpm -qa | grep libsecurec
    2. If libsecurec has been installed, go to the next step. If not, install it using the software repository.
      yum install libsecurec
  3. Check that the libvirt virtualization software is installed on all service nodes and configure the software.
    1. Install the libvirt virtualization software.
      yum install qemu libvirt edk2-aarch64
    2. After the installation is complete, configure the qemu.conf file.

      Modify the following configuration items in /etc/libvirt/qemu.conf:

      user = "root"
      group = "root"
    3. After the configuration is complete, reload the configuration.
      systemctl daemon-reload
    4. Restart the libvirt service.
      systemctl restart libvirtd
    5. Check the libvirt service status.
      After the restart, check the service status and ensure that the service is in the active (running) state.
      systemctl status libvirtd
  4. Install the boostvirt-vas-1.0.0.rpm package on all service nodes.
    1. Check whether the boostvirt-vas-1.0.0.rpm package has been installed in the environment.
      rpm -qa| grep vas-daemon

      If the RPM package has been installed in the environment, uninstall it to ensure that the environment is clean.

      rpm -e boostvirt-vas-1.0.0
    2. Go to the RPM package storage directory and install the package.
      rpm -ivh boostvirt-vas-1.0.0.rpm

      If the following information is displayed during the installation of the UBS Virt-awaresched RPM package, check whether the corresponding component has been installed and deployed as prompted. If the component is not installed, install it.

      Failed dependencies
  5. After the installation is complete on the service nodes, start vas-daemon.
    1. Check the vas-daemon status.
      systemctl status vas-daemon
      If the service is not started, run the following command to start the service:
      systemctl start vas-daemon
    2. Optional: Modify the service configuration file /usr/lib/systemd/system/vas-daemon.service as instructed in Configuration Description.
      [Unit]
      Description=virtual machine schedule daemon
      After=network.target
      
      [Service]
      Type=simple
      User=root
      Group=root
      RestartSec=5s
      CPUQuota=100%
      MemoryLimit=128M
      ExecStart=/usr/local/vas/bin/vas_daemon start server -smt true --sched-policy affinity --dynamic-util-thresh 85 --skip-cpuset "" --range-affinity true
      Restart=on-failure
      CapabilityBoundingSet=CAP_CHOWN CAP_DAC_OVERRIDE
      AmbientCapabilities=CAP_CHOWN CAP_DAC_OVERRIDE
      [Install]
      WantedBy=multi-user.target
    3. After the modification is complete, save and exit the service configuration file. Then, run the following command to load the configuration:
      systemctl daemon-reload
    4. Restart the service.
      systemctl restart vas-daemon

VSched Deployment (Dynamic Core Binding Mode)

  1. Configure grub.cfg.
    1. Open /boot/efi/EFI/openEuler/grub.cfg.
      vi /boot/efi/EFI/openEuler/grub.cfg
    2. Press i to enter the insert mode and add dynamic_affinity=enable to the end of the startup sub-item of the current OS.

      You can run the cat /proc/cmdline command to check the startup sub-item of the current OS. The following uses 6.6.0-98.0.0.103.oe2403sp2.aarch64 as an example.

      linux   /vmlinuz-6.6.0-98.0.0.103.oe2403sp2.aarch64 root=/dev/mapper/openeuler-root ro rd.lvm.lv=openeuler/root rd.lvm.lv=openeuler/swap cgroup_disable=files apparmor=0 crashkernel=1024M,high smmu.bypassdev=0x1000:0x17 smmu.bypassdev=0x1000:0x15 arm64.nopauth console=tty0 dynamic_affinity=enable
    3. Press Esc, type :wq!, and press Enter to save the file and exit. Restart the OS for the command line parameter settings to take effect.
  2. Optional: Obtain and install the optimization patch, and recompile and install the kernel.
    Table 1 Obtaining the patch code

    Patch Code

    How to Obtain

    Optimization patch code

    sched: optimize dynamic affinity

    SP2 patch code

    Fix wrong CPU aff3 conversion between MPIDR and SYS_LSUDVMBM_EL2

    NOTE:

    If the SP2 version is used, install the SP2 patch code.

    1. Configure the local Yum repository. For details, see Configuring the Local Yum Repository.

      Obtain the local repository image file openEuler-24.03-LTS-SP2-everything-aarch64-dvd.iso.

    2. Install the compilation software and its dependencies.
      yum install gcc make patch kernel-source-6.6.0-98.0.0.103.oe2403sp2.aarch64 flex bison openssl-devel elfutils-libelf-devel dwarves rpm-build
    3. Go to the compilation directory and modify the .config file in the directory.
      cd /usr/src/linux-6.6.0-98.0.0.103.oe2403sp2.aarch64/

      Leave the value of the following configuration item in the .config file blank:

      CONFIG_SYSTEM_TRUSTED_KEYS="certs/openeuler-cert.pem"

      The following shows the modification result. Save the file after the modification.

      CONFIG_SYSTEM_TRUSTED_KEYS=""
    4. After applying the patch code to the corresponding file, run the following commands to compile and install the kernel:
      make binrpm-pkg -j 128
      rpm -ivh /home/linux-6.6.0-98.0.0.103.oe2403sp2.aarch64/rpmbuild/RPMS/aarch64/kernel-6.6.0+-xxx.aarch64.rpm --force

      After the installation is complete, restart the OS. On the BMC, you can select the kernel to be started during the startup. After the startup, run the following command to check whether BOOT_IMAGE is the newly compiled kernel. The vmlinuz-6.6.0+ kernel is used as an example. The returned output contains the kernel version.

      cat /proc/cmdline
    5. Enable the optimization function.
      echo 1 > /proc/sys/kernel/dynamic_affinity_cluster_sched
  3. Determine the core selection range.

    The DA_UTIL_TASKGROUP switch determines the CPU core usage threshold policy in dynamic affinity mode. By default, it is enabled. Table 2 describes the configurations.

    Table 2 DA_UTIL_TASKGROUP configuration description

    Configuration Item

    Command

    Description

    Enabled

    echo DA_UTIL_TASKGROUP > /sys/kernel/debug/sched/features

    This switch is enabled by default.

    When it is enabled, the core selection range is determined by the preferred core usage by the task group.

    Disabled

    echo NO_DA_UTIL_TASKGROUP > /sys/kernel/debug/sched/features

    You are advised to disable this switch if group scheduling is not used.

    When it is disabled, the core selection range is determined by the total preferred core usage (including processes not included in the task group).

  4. Configure VSched parameters.
    1. Open the /usr/lib/systemd/system/vas-daemon.service file.
      vi /usr/lib/systemd/system/vas-daemon.service
    2. Press i to enter the insert mode and change affinity to dynamicAffinity. The following is an example:
      ExecStart=/usr/local/vas/bin/vas_daemon start server -smt true --sched-policy dynamicAffinity --dynamic-util-thresh 85 --skip-cpuset "" --range-affinity true
    3. Press Esc, type :wq!, and press Enter to save the file and exit.
    4. Run the following commands for the settings to take effect:
      systemctl daemon-reload
      systemctl restart vas-daemon
    5. Check the service status. If the service status is active (running), the service is started.
      systemctl status vas-daemon