我要评分
获取效率
正确性
完整性
易理解

Configuring the Environment

BIOS Settings

  1. Access the BIOS.

    For details, see "Accessing the BIOS" in TaiShan Server BIOS Parameter Reference (Kunpeng 920 Processor).

  2. Choose Advanced > MISC Config.

  3. Set Support Smmu to Enabled.

  4. Return to the upper-level directory and choose PCIe Config.

  5. Set SRIOV to Enable.

Configuring Hugepage Memory and IOMMU

  1. Use an SSH remote management tool to log in to the server and switch to the root user account.
  2. Check whether hugepage memory has been configured.
    1
    cat /proc/meminfo |grep -i huge
    

    • If both HugePages_Total and Hugepagesize are greater than 0 and Hugepagesize is greater than 5 GB, no further action is required.
    • If either HugePages_Total or Hugepagesize is 0, go to 3.
  3. Add the hugepage memory and IOMMU configurations to the end of the startup item.
    • On openEuler 20.03:
      1. Open the grub2-efi.cfg file.
        vim /etc/grub2-efi.cfg
      2. Press I to enter the insert mode and add the following content to the position shown in the following figure.
        default_hugepagesz=512M hugepagesz=512M hugepages=128 iommu.passthrough=1

      3. Press Esc to exit the insert mode. Input :wq! and press Enter to save the file and exit.
    • On CentOS 7.6:
      1. Open the /boot/efi/EFI/centos/grub.cfg file.
        vim /boot/efi/EFI/centos/grub.cfg
      2. Press I to enter the insert mode and add the following content to the position shown in the following figure.
        default_hugepagesz=512M hugepagesz=512M hugepages=128

      3. Press Esc to exit the insert mode. Input :wq! and press Enter to save the file and exit.
      4. Open the /etc/grub2-efi.cfg file.
        1
        vim /etc/grub2-efi.cfg
        
      5. Press I to enter the insert mode and add the following content to the position shown in the following figure.
        isolcpus=0-5 iommu.passthrough=1

      6. Press Esc to exit the insert mode. Input :wq! and press Enter to save the file and exit.
  4. Configure the huge pages to be mounted upon system boot.
    1. Open the /etc/fstab file.
      1
      vim /etc/fstab
      
    2. Press I to enter the insert mode and add the following content:
      1
      nodev /mnt/huge hugetlbfs defaults 0 0
      

    3. Press Esc to exit the insert mode. Input :wq! and press Enter to save the file and exit.
  5. Create an /mnt/huge directory.
    1
    mkdir -p /mnt/huge
    
  6. Restart the server for the settings to take effect.
    1
    reboot
    
  7. Check whether the hugepage memory is successfully configured.
    cat /proc/meminfo |grep -i huge

    If the values of HugePages_Total and Hugepagesize are greater than 0, and the value of Hugepagesize exceeds 5 GB, the configuration is successful.

(Optional) Disabling NetworkManager

Perform this operation only when CentOS 7.6 is used.

Disable NetworkManager.

1
2
systemctl stop NetworkManager
systemctl disable NetworkManager

Disabling SELinux

The OVS flow table NIC acceleration feature provided by Kunpeng BoostKit for Virtualization requires creating VMs. However, the SELinux security mechanism enabled by default on Linux prevents guest VM images from being loaded. As a result, services for virtualization scenarios cannot be deployed. This is the behavior of Linux itself, and Kunpeng BoostKit for Virtualization does not provide a solution to this issue. If you want to use SELinux in your own system, please find a solution by yourself.

We provide a method for quickly disabling SELinux. The SELinux configuration method provided in Kunpeng BoostKit for Virtualization is for reference only. You need to evaluate the method and bear related risks.

Disabling SELinux may cause security issues. If you do not plan to enable SELinux, it is recommended that an end-to-end solution be used to eliminate the risks caused by disabling SELinux. You shall bear the security risks by yourself. If you need to enable SELinux, configure fine-grained security rules based on actual SELinux issues to ensure system security.

  1. Edit the /etc/selinux/config file.
    1. Open the /etc/SELINUX/config file.
      1
      vim /etc/SELINUX/config
      
    2. Press I to enter the insert mode and set SELINUX to disabled.

    3. Press Esc to exit the insert mode. Input :wq! and press Enter to save the file and exit.
  2. Restart the server for the settings to take effect.
    1
    reboot
    

To temporarily disable SELinux, run the setenforce 0 command.

Configuring the Local Yum Source

  1. Configure the local yum source.
    • On openEuler 20.03:
      mkdir /mnt/repo
      mount -o loop /home/iso/openEuler-20.03-LTS-SP1-everything-aarch64-dvd.iso /mnt/repo
      cd /etc/yum.repos.d
      mkdir backup
      mv *.repo backup
    • On CentOS 7.6:
      1
      2
      3
      4
      5
      mkdir /mnt/repo
      mount -o loop /home/iso/CentOS-7-aarch64-Everything-1810.iso /mnt/repo
      cd /etc/yum.repos.d
      mkdir backup
      mv *.repo backup
      
  2. Edit the local.repo file.
    1. Open the file.
      • On openEuler 20.03:
        vim local.repo
      • On CentOS 7.6:
        1
        vim /etc/yum.repo.d/local.repo
        
    2. Press I to enter the insert mode and add the following content:
      • On openEuler 20.03:
        [local]
        name=local repo
        baseurl=file:///mnt/repo
        enabled=1
        gpgcheck=0
        
        [arch_fedora_online]
        name=arch_fedora
        baseurl=https://mirrors.huaweicloud.com/fedora/development/rawhide/Everything/aarch64/os
        enabled=1
        gpgcheck=0
        priority=2
      • On CentOS 7.6:
        [local]
        name=local
        baseurl=file:///mnt/repo
        enable=1
        gpgcheck=0
        gpgkey=file:///mnt/repo/RPM-GPG-KEY-CentOS-7
    3. Press Esc to exit the insert mode. Input :wq! and press Enter to save the file and exit.
  3. Clear all the cached content.
    1
    yum clean all
    
  4. Update the yum cache.
    yum makecache

Installing the Mellanox NIC Driver

  1. Upload the Mellanox NIC driver package from the local PC to the server.
  2. Install the software packages and dependencies.
    • On openEuler 20.03:
      1
      yum install unbound tcl gcc-gfortran fuse-libs tk createrepo kernel-devel python-devel rpm-build gcc gcc-c++ tcsh lsof pciutils-devel fuse-devel
      
    • On CentOS 7.6:
      yum install unbound tcl gcc-gfortran fuse-libs tk createrepo kernel-devel python-devel redhat-rpm-config rpm-build gcc gcc-c++
  3. Decompress the driver package and go to the folder generated after the decompression.
    • On openEuler 20.03:
      tar -zxvf MLNX_OFED_LINUX-5.2-2.2.0.0-openeuler20.03-aarch64.tgz
      cd MLNX_OFED_LINUX-5.2-2.2.0.0-openeuler20.03-aarch64
    • On CentOS 7.6:
      tar -zxvf MLNX_OFED_LINUX-5.1-2.3.7.1-rhel7.6alternate-aarch64.tgz
      cd MLNX_OFED_LINUX-5.1-2.3.7.1-rhel7.6alternate-aarch64
  4. Install the driver.
    1
    ./mlnxofedinstall --ovs-dpdk --upstream-libs --add-kernel-support
    
  5. Update initramfs.
    1
    dracut -f
    
  6. Load the driver.
    1
    /etc/init.d/openibd restart
    

    If a FAILED error message is displayed, run the rmmod hns_roce_hw_v2 command to retry.

  7. Restart the server.
    1
    reboot
    
  8. (Optional) Disable 1822 NICs.

    If 1822 NICs exist in the environment, the server performance deteriorates due to a large number of software interrupts generated by the 1822 NICs. Therefore, disable all existing 1822 NICs for a higher server performance. You need to perform this operation each time you restart the server.

    1
    rmmod hinic