This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
|
opennebula_sr-iov_vmm_driver [2013/05/15 14:30] dmacleod [Prerequisites and Limitations] |
opennebula_sr-iov_vmm_driver [2021/12/09 16:42] (current) |
||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | ====== OpenNebula KVM-SRIOV Driver ====== | + | ====== OpenNebula KVM SR-IOV Driver ====== |
| Mellanox has recently released a driver which supports SR-IOV on their ConnectX-3 HCA family. This means it is now possible to use Infiniband verbs from inside a VM. To support these Infiniband HCAs, and any other SR-IOV network device, in OpenNebula I developed an SR-IOV VMM driver. | Mellanox has recently released a driver which supports SR-IOV on their ConnectX-3 HCA family. This means it is now possible to use Infiniband verbs from inside a VM. To support these Infiniband HCAs, and any other SR-IOV network device, in OpenNebula I developed an SR-IOV VMM driver. | ||
| Line 13: | Line 13: | ||
| - A virtual bridge is required. The VM will attach interfaces to this bridge but the OS will not use them. They are only required to pass IP address information into the VM. The bridge does not require any external connectivity, | - A virtual bridge is required. The VM will attach interfaces to this bridge but the OS will not use them. They are only required to pass IP address information into the VM. The bridge does not require any external connectivity, | ||
| - VF usage tracking is implemented in the ///tmp// file system. During a fatal host error the VF usage tracking might become out of sync with actual VF usage. You will have to manually recover. ([[opennebula_sr-iov_vmm_driver# | - VF usage tracking is implemented in the ///tmp// file system. During a fatal host error the VF usage tracking might become out of sync with actual VF usage. You will have to manually recover. ([[opennebula_sr-iov_vmm_driver# | ||
| - | - A modified context script is required to decode the SR-IOV interface information inside the VM. Examples are given for Infiniband | + | - A modified context script is required to decode the SR-IOV interface information inside the VM. Examples are given for Infiniband. |
| - IPv6 has not been tested. | - IPv6 has not been tested. | ||
| ===== Testing Environment ===== | ===== Testing Environment ===== | ||
| Line 26: | Line 26: | ||
| - | 1. Extract kvm-srivo.tar.gz to /// | + | 1. Extract |
| 2. Edit /// | 2. Edit /// | ||
| Line 40: | Line 40: | ||
| https:// | https:// | ||
| - | 4. In the /// | + | 4. In the /// |
| Example, four virtual functions: | Example, four virtual functions: | ||
| Line 69: | Line 69: | ||
| - | The “save” command saves the state of the VM's memory to the host's disk. This operation fails when a VM contains an SR-IOV device because it is passed through the hypervisor and not defined by it. As a resut the devices memory state cannot be read, cause the save operation to fail. | + | The “save” command saves the state of the VM's memory to the host's disk. This operation fails when a VM contains an SR-IOV device because it is passed through the hypervisor and not defined by it. As a resut the devices memory state cannot be read, causing |
| ==== Hot attaching SR-IOV Network Interfaces ==== | ==== Hot attaching SR-IOV Network Interfaces ==== | ||
| Line 79: | Line 79: | ||
| - | Libvirt does provide a built-in method for tracking VF usage but it does not support the Mellanox OFED 2 drivers. As a result I had to create my own usage tracking mechanism. If you are using this driver with an SR-IOV card witch support | + | Libvirt does provide a built-in method for tracking VF usage but it does not support the Mellanox OFED 2 drivers. As a result I had to create my own usage tracking mechanism. If you are using this driver with an SR-IOV card which supports |
| http:// | http:// | ||
| - | In the hosts ///tmp// directory | + | In the host' |
| /// | /// | ||
| Line 88: | Line 88: | ||
| 2 | 2 | ||
| 3 | 3 | ||
| + | |||
| + | ===== Driver ===== | ||
| + | |||
| + | * {{: | ||
| + | |||
| + | ==== Context Script Modification ==== | ||
| + | |||
| + | |||
| + | Edit the // | ||
| + | |||
| + | gen_iface_conf() { | ||
| + | cat <<EOT | ||
| + | DEVICE=$DEV | ||
| + | BOOTPROTO=none | ||
| + | ONBOOT=yes | ||
| + | #################### | ||
| + | # Update this # | ||
| + | #################### | ||
| + | TYPE=$TYPE | ||
| + | # | ||
| + | NETMASK=$MASK | ||
| + | IPADDR=$IP | ||
| + | EOT | ||
| + | if [ -n " | ||
| + | echo " | ||
| + | fi | ||
| + | echo "" | ||
| + | } | ||
| + | |||
| + | gen_network_configuration() | ||
| + | { | ||
| + | IFACES=`get_interfaces` | ||
| + | for i in $IFACES; do | ||
| + | MAC=`get_mac $i` | ||
| + | ################################### | ||
| + | # Update this # | ||
| + | ################################### | ||
| + | ib_vf=$(echo " | ||
| + | ib_pos=$(echo " | ||
| + | if [ " | ||
| + | DEV=" | ||
| + | UPCASE_DEV=`upcase $DEV` | ||
| + | TYPE=" | ||
| + | else | ||
| + | DEV=`get_dev $i` | ||
| + | UPCASE_DEV=`upcase $DEV` | ||
| + | TYPE=" | ||
| + | fi | ||
| + | # | ||
| + | IP=$(get_ip) | ||
| + | NETWORK=$(get_network) | ||
| + | MASK=$(get_mask) | ||
| + | GATEWAY=$(get_gateway) | ||
| + | #################################### | ||
| + | # Update this # | ||
| + | #################################### | ||
| + | if [ " | ||
| + | gen_iface_conf > / | ||
| + | else | ||
| + | gen_iface_conf > / | ||
| + | fi | ||
| + | # | ||
| + | done | ||
| + | } | ||
| + | | ||
| + | Take note of: | ||
| + | - " | ||
| + | - gen_iface_conf > / | ||