Configuring the Environment
BIOS Settings
Configuring Hugepage Memory and IOMMU
- Use an SSH remote management tool to log in to the server and switch to the root user account.
- Check whether hugepage memory has been configured.
1cat /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.
- Add the hugepage memory and IOMMU configurations to the end of the startup item.
- On openEuler 20.03:
- Open the grub2-efi.cfg file.
vim /etc/grub2-efi.cfg
- 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

- Press Esc to exit the insert mode. Input :wq! and press Enter to save the file and exit.
- Open the grub2-efi.cfg file.
- On CentOS 7.6:
- Open the /boot/efi/EFI/centos/grub.cfg file.
vim /boot/efi/EFI/centos/grub.cfg
- 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

- Press Esc to exit the insert mode. Input :wq! and press Enter to save the file and exit.
- Open the /etc/grub2-efi.cfg file.
1vim /etc/grub2-efi.cfg - 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

- Press Esc to exit the insert mode. Input :wq! and press Enter to save the file and exit.
- Open the /boot/efi/EFI/centos/grub.cfg file.
- On openEuler 20.03:
- Configure the huge pages to be mounted upon system boot.
- Open the /etc/fstab file.
1vim /etc/fstab - Press I to enter the insert mode and add the following content:
1nodev /mnt/huge hugetlbfs defaults 0 0

- Press Esc to exit the insert mode. Input :wq! and press Enter to save the file and exit.
- Open the /etc/fstab file.
- Create an /mnt/huge directory.
1mkdir -p /mnt/huge
- Restart the server for the settings to take effect.
1reboot
- 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.
- Edit the /etc/selinux/config file.
- Open the /etc/SELINUX/config file.
1vim /etc/SELINUX/config - Press I to enter the insert mode and set SELINUX to disabled.

- Press Esc to exit the insert mode. Input :wq! and press Enter to save the file and exit.
- Open the /etc/SELINUX/config file.
- Restart the server for the settings to take effect.
1reboot
To temporarily disable SELinux, run the setenforce 0 command.
Configuring the Local Yum Source
- 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
- On openEuler 20.03:
- Edit the local.repo file.
- Open the file.
- On openEuler 20.03:
vim local.repo
- On CentOS 7.6:
1vim /etc/yum.repo.d/local.repo
- On openEuler 20.03:
- 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
- On openEuler 20.03:
- Press Esc to exit the insert mode. Input :wq! and press Enter to save the file and exit.
- Open the file.
- Clear all the cached content.
1yum clean all
- Update the yum cache.
yum makecache
Installing the Mellanox NIC Driver
- Upload the Mellanox NIC driver package from the local PC to the server.
- Install the software packages and dependencies.
- On openEuler 20.03:
1yum 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++
- On openEuler 20.03:
- 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
- On openEuler 20.03:
- Install the driver.
1./mlnxofedinstall --ovs-dpdk --upstream-libs --add-kernel-support
- Update initramfs.
1dracut -f - Load the driver.
1/etc/init.d/openibd restartIf a FAILED error message is displayed, run the rmmod hns_roce_hw_v2 command to retry.

- Restart the server.
1reboot
- (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.
1rmmod hinic



