Rate This Document
Findability
Accuracy
Completeness
Readability

vhost_user Acceleration for cVMs on OpenStack

On OpenStack, enabling the OVS+DPDK for cVMs requires no more than 3 GB huge pages. cVMs support only 1 GB huge pages. The huge pages are not bound to NUMA nodes. virtCCA cVMs and common VMs cannot be deployed together.

  1. Prepare the environment by following instructions in Enabling DPDK-OVS Network Acceleration.
    • When executing ife_topology.sh, you need to specify the external NIC br-ex of OpenStack. The command is as follows:
      sh ife_topology.sh clean
      ife_topology.sh normal BDF br-ex
      • clean/normal: The clean method of the ife_topology.sh script is used to clear the OVS bridge configuration. The normal method is used to configure the OVS+DPDK.
      • BDF: specifies the BDF number of the NIC used by the DPDK.
      • br-ex: specifies the name of the external bridge used by OpenStack.
    • After the network for directly connecting the VM started using libvirt to the NIC, the network connectivity between the IP addresses in the same network segment is normal, indicating that the basic environment has been deployed.

      For details about how to deploy the environment for the first time, see Enabling DPDK-OVS Network Acceleration. After the compute node is restarted, the NIC taken over by the DPDK is managed by the kernel instead. Therefore, you need to use the DPDK to take over the NIC again. After the restart, run the following command, among which ${BDF} indicates the BDF number of the NIC. Modify dpdk-socket-mem based on the number of NUMA nodes.

      modprobe uio_pci_generic
      dpdk-devbind.py -b uio_pci_generic --force ${BDF}
      dpdk-devbind.py -s
      service openvswitch restart
      ovs-vsctl --no-wait set Open_vSwitch . other_config:dpdk-init=true other_config:dpdk-socket-mem="4096,4096,4096,4096" other_config:dpdk-lcore-mask="0x1F" other_config:pmd-cpu-mask="0x1E" other_config:dpdk-pmd-driver=/lib64/librte_pmd_hinic.so other_config:vhost-iommu-support=true
      service openvswitch restart
      systemctl restart neutron-openvswitch-agent.service
  2. Modify the openstack-nova configuration file.
    1. Open the configuration file.
      vim /etc/nova/nova.conf
    2. Press i to enter the insert mode and modify the configuration file as follows:
      [DEFAULT] 
      reserved_huge_pages=node:0,size:1GB,count:4 
      reserved_huge_pages=node:1,size:1GB,count:4 
      reserved_huge_pages=node:2,size:1GB,count:4 
      reserved_huge_pages=node:3,size:1GB,count:4
    3. Press Esc to exit the insert mode. Type :wq! and press Enter to save the file and exit.
    4. Restart the openstack-nova-compute service on the compute node.
      systemctl restart openstack-nova-compute
      • Run the cat /sys/devices/system/node/node*/meminfo|grep HugePages command to check the number of NUMA nodes, the total number of huge pages (HugePages_Total) on each NUMA node, and the number of available huge pages (HugePages_Free) on each NUMA node. Enter the HugePages_Total-HugePages_Free value next to count.
      • Generally, the DPDK occupies 16 x 1 GB huge pages.
  3. Modify the neutron-openvswitch-agent configuration file.
    1. Open the configuration file.
      vim /etc/neutron/plugins/ml2/openvswitch_agent.ini
    2. Press i to enter the insert mode and modify the configuration file as follows:
      [ovs]
      datapath_type = netdev
      vhostuser_socket_dir = /var/run/openvswitch
    3. Press Esc to exit the insert mode. Type :wq! and press Enter to save the file and exit.
    4. Restart the neutron-openvswitch-agent service.
      systemctl restart neutron-openvswitch-agent
  4. Create a vhost_user flavor.
    openstack flavor create dpdk-cca-flavor --vcpus 4 --ram 8192 --disk 50 \
    --property hw:mem_page_size=1GB \
    --property trait:HW_CPU_AARCH64_HISI_VIRTCCA=required \
    --property hw:mem_secure=true \
    --property sw:qemu_cmdline="tmm-guest,id=tmm0,num-pmu-counters=1"
  5. Create a vhost_user cVM.
    openstack server create --image openEuler-image --flavor dpdk-cca-flavor --network public-network dpdk-vm
  6. Verify that vhost_user has been enabled for a cVM on OpenStack.

    After the network configuration is added for the NIC, the VM can communicate with another server whose IP address is in the same network segment, and the NIC becomes available.