Minor fixes in SRIOV configuration.
This commit is contained in:
Родитель
67de80b1fc
Коммит
89280653bd
|
@ -400,7 +400,7 @@ function EnableSRIOVInAllVMs($allVMData)
|
|||
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
|
||||
$sriovOutput = RunLinuxCmd -ip $vmData.PublicIP -port $vmData.SSHPort -username $user -password $password -command "/home/$user/$scriptName" -runAsSudo
|
||||
$sriovDetectedCount += 1
|
||||
}
|
||||
else
|
||||
|
@ -412,8 +412,15 @@ function EnableSRIOVInAllVMs($allVMData)
|
|||
|
||||
if ($sriovDetectedCount -gt 0)
|
||||
{
|
||||
LogMsg "Now restarting VMs..."
|
||||
$restartStatus = RestartAllDeployments -allVMData $allVMData
|
||||
if ($sriovOutput -imatch "SYSTEM_RESTART_REQUIRED")
|
||||
{
|
||||
LogMsg "Updated SRIOV configuration. Now restarting VMs..."
|
||||
$restartStatus = RestartAllDeployments -allVMData $allVMData
|
||||
}
|
||||
if ($sriovOutput -imatch "DATAPATH_SWITCHED_TO_VF")
|
||||
{
|
||||
$restartStatus="True"
|
||||
}
|
||||
}
|
||||
$vmCount = 0
|
||||
$bondSuccess = 0
|
||||
|
@ -423,17 +430,35 @@ function EnableSRIOVInAllVMs($allVMData)
|
|||
foreach ( $vmData in $allVMData )
|
||||
{
|
||||
$vmCount += 1
|
||||
$AfterIfConfigStatus = $null
|
||||
$AfterIfConfigStatus = RunLinuxCmd -ip $vmData.PublicIP -port $vmData.SSHPort -username $user -password $password -command "/sbin/ifconfig -a" -runAsSudo
|
||||
if ($AfterIfConfigStatus -imatch "bond")
|
||||
if ($sriovOutput -imatch "DATAPATH_SWITCHED_TO_VF")
|
||||
{
|
||||
LogMsg "New bond detected in $($vmData.RoleName)"
|
||||
$bondSuccess += 1
|
||||
$AfterIfConfigStatus = $null
|
||||
$AfterIfConfigStatus = RunLinuxCmd -ip $vmData.PublicIP -port $vmData.SSHPort -username $user -password $password -command "dmesg" -runAsSudo
|
||||
if ($AfterIfConfigStatus -imatch "Data path switched to VF")
|
||||
{
|
||||
LogMsg "Data path already switched to VF in $($vmData.RoleName)"
|
||||
$bondSuccess += 1
|
||||
}
|
||||
else
|
||||
{
|
||||
LogErr "Data path not switched to VF in $($vmData.RoleName)"
|
||||
$bondError += 1
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
LogErr "New bond not detected in $($vmData.RoleName)"
|
||||
$bondError += 1
|
||||
$AfterIfConfigStatus = $null
|
||||
$AfterIfConfigStatus = RunLinuxCmd -ip $vmData.PublicIP -port $vmData.SSHPort -username $user -password $password -command "/sbin/ifconfig -a" -runAsSudo
|
||||
if ($AfterIfConfigStatus -imatch "bond")
|
||||
{
|
||||
LogMsg "New bond detected in $($vmData.RoleName)"
|
||||
$bondSuccess += 1
|
||||
}
|
||||
else
|
||||
{
|
||||
LogErr "New bond not detected in $($vmData.RoleName)"
|
||||
$bondError += 1
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,7 +4,7 @@ DISTRO=`grep -ihs "buntu\|Suse\|Fedora\|Debian\|CentOS\|Red Hat Enterprise Linux
|
|||
bootLogs=`dmesg`
|
||||
if [[ $bootLogs =~ "Data path switched to VF" ]];
|
||||
then
|
||||
echo "Data path switched to VF. No configuration required."
|
||||
echo "DATAPATH_SWITCHED_TO_VF"
|
||||
else
|
||||
if [[ $DISTRO =~ "Ubuntu" ]];
|
||||
then
|
||||
|
|
|
@ -4,12 +4,13 @@
|
|||
bootLogs=`dmesg`
|
||||
if [[ $bootLogs =~ "Data path switched to VF" ]];
|
||||
then
|
||||
echo "Data path switched to VF. No configuration required."
|
||||
echo "DATAPATH_SWITCHED_TO_VF"
|
||||
else
|
||||
wget https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/plain/tools/hv/bondvf.sh
|
||||
chmod +x ./bondvf.sh
|
||||
./bondvf.sh
|
||||
cp bondvf.sh /etc/init.d
|
||||
update-rc.d bondvf.sh defaults
|
||||
echo "SYSTEM_RESTART_REQUIRED"
|
||||
fi
|
||||
exit 0
|
Загрузка…
Ссылка в новой задаче