Update: A temporary workaround for SRIOV on Ubuntu.

This commit is contained in:
Shital Savekar 2017-06-07 13:54:30 +00:00
Родитель bae51a19ca
Коммит 2fc17f530a
2 изменённых файлов: 30 добавлений и 1 удалений

Просмотреть файл

@ -366,6 +366,7 @@ function EnableSRIOVInAllVMs($allVMData)
$packageInstallJobs = @()
$sriovDetectedCount = 0
$vmCount = 0
foreach ( $vmData in $allVMData )
{
$vmCount += 1
@ -375,7 +376,22 @@ function EnableSRIOVInAllVMs($allVMData)
$pciDevices = RunLinuxCmd -ip $vmData.PublicIP -port $vmData.SSHPort -username $user -password $password -command "lspci" -runAsSudo
if ( $pciDevices -imatch "Mellanox")
{
LogMsg "Mellanox Adapter detected in $($vmData.RoleName). Now executing $scriptName ..."
LogMsg "Mellanox Adapter detected in $($vmData.RoleName)."
#SRIOV-Workaround for Ubuntu.
RemoteCopy -uploadTo $vmData.PublicIP -port $vmData.SSHPort -files ".\remote-scripts\ConfigureSRIOV-workaround.sh" -username $user -password $password -upload
$out = RunLinuxCmd -ip $vmData.PublicIP -port $vmData.SSHPort -username $user -password $password -command "chmod +x ConfigureSRIOV-workaround.sh" -runAsSudo
$isRestartNeeded=""
$isRestartNeeded= RunLinuxCmd -ip $vmData.PublicIP -port $vmData.SSHPort -username $user -password $password -command "./ConfigureSRIOV-workaround.sh" -runAsSudo
if ($isRestartNeeded -imatch "SYSTEM_RESTART_REQUIRED")
{
LogMsg "SRIOV workaround applied for $($vmData.RoleName). Restart required."
$restartStatus = RestartAllDeployments -allVMData $vmData
}
else
{
LogMsg "SRIOV workaround is not needed."
}
LogMsg "Now executing $scriptName ..."
$jobID = RunLinuxCmd -ip $vmData.PublicIP -port $vmData.SSHPort -username $user -password $password -command "/home/$user/$scriptName" -runAsSudo
$sriovDetectedCount += 1
}

Просмотреть файл

@ -0,0 +1,13 @@
#!/bin/bash
DISTRO=`grep -ihs "buntu\|Suse\|Fedora\|Debian\|CentOS\|Red Hat Enterprise Linux" /etc/{issue,*release,*version}`
if [[ $DISTRO =~ "Ubuntu" ]];
then
#A temporary workaround for SRIOV issue.
macAddr=`cat /sys/class/net/eth0/address`
echo "SUBSYSTEM==\"net\", ACTION==\"add\", DRIVERS==\"hv_netvsc\", ATTR{address}==\"${macAddr}\", NAME=\"eth0\"" > /etc/udev/rules.d/70-persistent-net.rules
echo "SUBSYSTEM==\"net\", ACTION==\"add\", DRIVERS==\"mlx4_core\", ATTR{address}==\"${macAddr}\", NAME=\"vf0\"" >> /etc/udev/rules.d/70-persistent-net.rules
#sed -i '/rename*/c\vf0' /etc/network/interfaces
echo "SYSTEM_RESTART_REQUIRED"
fi
exit 0