Fix IB and VFs order issues
Change provider of DHCP service and set a default value to iSER interface for servers without VFs, before adding intel_iommu to kernel parameters and reboot. Change-Id: Idf3eddcf9cb2226998b186febb7cc720cda39e70
This commit is contained in:
parent
650ee39193
commit
2518848783
@ -26,5 +26,17 @@ if [ $DISTRO == 'ubuntu' ] && [ $DRIVER == 'eth_ipoib' ]; then
|
|||||||
cat /etc/network/interfaces.d/ifcfg-ib* >> /etc/network/interfaces
|
cat /etc/network/interfaces.d/ifcfg-ib* >> /etc/network/interfaces
|
||||||
\rm -f /etc/network/interfaces.d/ifcfg-ib0*
|
\rm -f /etc/network/interfaces.d/ifcfg-ib0*
|
||||||
fi
|
fi
|
||||||
service openibd restart && service openvswitch-switch restart
|
|
||||||
|
# Kill tgt daemons if exists
|
||||||
|
tgt_locks=`find /var/run/ -name tgtd* | wc -l`
|
||||||
|
if [ $tgt_locks -ne 0 ];then
|
||||||
|
\rm -f /var/run/tgtd* && killall -9 tgtd
|
||||||
|
service tgt stop
|
||||||
|
fi
|
||||||
|
|
||||||
|
service openibd restart && service openvswitch-switch restart
|
||||||
|
|
||||||
|
if [ $tgt_locks -ne 0 ];then
|
||||||
|
service tgt start
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
@ -24,6 +24,7 @@ class mellanox_openstack::controller_ib_pv (
|
|||||||
service { $dhcp_agent :
|
service { $dhcp_agent :
|
||||||
ensure => running,
|
ensure => running,
|
||||||
enable => true,
|
enable => true,
|
||||||
|
provider => pacemaker,
|
||||||
subscribe => [File[$mlnx_dnsmasq_pv_config_file],
|
subscribe => [File[$mlnx_dnsmasq_pv_config_file],
|
||||||
Neutron_dhcp_agent_config['DEFAULT/dnsmasq_config_file']]
|
Neutron_dhcp_agent_config['DEFAULT/dnsmasq_config_file']]
|
||||||
}
|
}
|
||||||
|
@ -37,6 +37,7 @@ class mellanox_openstack::controller_sriov (
|
|||||||
service { $dhcp_agent :
|
service { $dhcp_agent :
|
||||||
ensure => running,
|
ensure => running,
|
||||||
enable => true,
|
enable => true,
|
||||||
|
provider => pacemaker,
|
||||||
subscribe => Neutron_dhcp_agent_config['DEFAULT/dhcp_driver'],
|
subscribe => Neutron_dhcp_agent_config['DEFAULT/dhcp_driver'],
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -30,21 +30,23 @@ function logger_print () {
|
|||||||
logger -t $SCOPE "$priority: $msg"
|
logger -t $SCOPE "$priority: $msg"
|
||||||
}
|
}
|
||||||
|
|
||||||
# Check that a first probe VF exists
|
|
||||||
if [ ! -d $PARENT_FIRST_VF ]; then
|
|
||||||
logger_print error "Did not find probed ports of ${STORAGE_PORT}, skipping rename."
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
DEVICES='/sys/class/net/*/device'
|
DEVICES='/sys/class/net/*/device'
|
||||||
SON_BUS=`basename $(readlink /sys/class/net/$STORAGE_PORT/device/virtfn0)`
|
if [ -e $PARENT_FIRST_VF ];then
|
||||||
|
CHILD_BUS=`basename $(readlink /sys/class/net/$STORAGE_PORT/device/virtfn0)`
|
||||||
|
logger_print info "Found first probed port of ${STORAGE_PORT} with bus ID: ${CHILD_BUS}."
|
||||||
|
else
|
||||||
|
PARENT_BUS=`cat /sys/class/net/$STORAGE_PORT/device/uevent | grep -i pci_slot | cut -d = -f 2`
|
||||||
|
CHILD_BUS=`echo $PARENT_BUS | sed -e s/0$/1/g`
|
||||||
|
PROBED_PORT_NAME="eth_iser_guess"
|
||||||
|
logger_print info "Did not find probed ports of ${STORAGE_PORT}, guessing its bus is: ${CHILD_BUS}."
|
||||||
|
fi
|
||||||
STORAGE_PORT_NUMBER=`cat /sys/class/net/$STORAGE_PORT/dev_id`
|
STORAGE_PORT_NUMBER=`cat /sys/class/net/$STORAGE_PORT/dev_id`
|
||||||
|
|
||||||
# Find the probe VF port that fits the storage ports number and BUS
|
# Find the probe VF port that fits the storage ports number and BUS
|
||||||
for dev in $DEVICES; do
|
for dev in $DEVICES; do
|
||||||
# Check for correct bus
|
# Check for correct bus
|
||||||
CANDIDATE_BUS=`readlink -nq $dev`;
|
CANDIDATE_BUS=`readlink -nq $dev`;
|
||||||
if [[ $CANDIDATE_BUS != *$SON_BUS* ]]; then
|
if [[ $CANDIDATE_BUS != *$CHILD_BUS* ]]; then
|
||||||
continue;
|
continue;
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -73,7 +75,7 @@ fi
|
|||||||
if [ $PROBED_PORT_NAME != $ISER_NAME ]; then
|
if [ $PROBED_PORT_NAME != $ISER_NAME ]; then
|
||||||
# Prepare line for udev
|
# Prepare line for udev
|
||||||
UDEV_LINE="SUBSYSTEM==\"net\", ACTION==\"add\", "
|
UDEV_LINE="SUBSYSTEM==\"net\", ACTION==\"add\", "
|
||||||
UDEV_LINE+="ATTR{dev_id}==\"$STORAGE_PORT_NUMBER\", KERNELS==\"$SON_BUS\", "
|
UDEV_LINE+="ATTR{dev_id}==\"$STORAGE_PORT_NUMBER\", KERNELS==\"$CHILD_BUS\", "
|
||||||
UDEV_LINE+="ATTR{type}==\"1\", KERNEL==\"eth*\", NAME=\"$ISER_NAME\""
|
UDEV_LINE+="ATTR{type}==\"1\", KERNEL==\"eth*\", NAME=\"$ISER_NAME\""
|
||||||
|
|
||||||
# Change/add line in udev file
|
# Change/add line in udev file
|
||||||
@ -82,7 +84,13 @@ if [ $PROBED_PORT_NAME != $ISER_NAME ]; then
|
|||||||
OLD_LINE_NUMBER=`grep -n $PROBED_PORT_NAME $UDEV_FILE | cut -d : -f 1`
|
OLD_LINE_NUMBER=`grep -n $PROBED_PORT_NAME $UDEV_FILE | cut -d : -f 1`
|
||||||
eval "sed '"$OLD_LINE_NUMBER"d' -i $UDEV_FILE"
|
eval "sed '"$OLD_LINE_NUMBER"d' -i $UDEV_FILE"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Insert new name config if not exists
|
||||||
|
grep $ISER_NAME $UDEV_FILE > /dev/null 2>&1
|
||||||
|
if [ $? -ne 0 ]; then
|
||||||
|
echo >> $UDEV_FILE
|
||||||
echo $UDEV_LINE >> $UDEV_FILE
|
echo $UDEV_LINE >> $UDEV_FILE
|
||||||
|
fi
|
||||||
|
|
||||||
# restart OFED modules for udev changes to take effect
|
# restart OFED modules for udev changes to take effect
|
||||||
modprobe -r mlx4_en && modprobe mlx4_en
|
modprobe -r mlx4_en && modprobe mlx4_en
|
||||||
|
@ -17,7 +17,7 @@
|
|||||||
readonly SCRIPT_DIR=$(dirname "$0")
|
readonly SCRIPT_DIR=$(dirname "$0")
|
||||||
source $SCRIPT_DIR/common
|
source $SCRIPT_DIR/common
|
||||||
readonly SCRIPT_MODE=$1
|
readonly SCRIPT_MODE=$1
|
||||||
readonly FALLBACK_NUM_VFS=16
|
readonly FALLBACK_NUM_VFS=8
|
||||||
readonly SRIOV_ENABLED_FLAG=1
|
readonly SRIOV_ENABLED_FLAG=1
|
||||||
readonly NEW_KERNEL_PARAM="intel_iommu=on"
|
readonly NEW_KERNEL_PARAM="intel_iommu=on"
|
||||||
readonly GRUB_FILE_CENTOS="/boot/grub/grub.conf"
|
readonly GRUB_FILE_CENTOS="/boot/grub/grub.conf"
|
||||||
@ -122,7 +122,7 @@ function burn_vfs_in_fw () {
|
|||||||
else
|
else
|
||||||
logger_print debug "Detected SR-IOV is disabled"
|
logger_print debug "Detected SR-IOV is disabled"
|
||||||
fi
|
fi
|
||||||
if [ "$total_vfs" -ne "$current_num_of_vfs" ] 2>/dev/null; then
|
if [[ ! "$total_vfs" == "$current_num_of_vfs" ]] 2>/dev/null; then
|
||||||
logger_print debug "Current allowed number of VFs is ${current_num_of_vfs}, required number is ${total_vfs}"
|
logger_print debug "Current allowed number of VFs is ${current_num_of_vfs}, required number is ${total_vfs}"
|
||||||
mlxconfig -y -d $dev s SRIOV_EN=1 NUM_OF_VFS=$total_vfs 2>&1 >/dev/null
|
mlxconfig -y -d $dev s SRIOV_EN=1 NUM_OF_VFS=$total_vfs 2>&1 >/dev/null
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
|
@ -5,7 +5,7 @@ name: mellanox-plugin
|
|||||||
title: Mellanox Openstack features
|
title: Mellanox Openstack features
|
||||||
|
|
||||||
# Plugin version
|
# Plugin version
|
||||||
version: 0.2.5
|
version: 0.2.12
|
||||||
|
|
||||||
# Description
|
# Description
|
||||||
description: Enable features over Mellanox hardware
|
description: Enable features over Mellanox hardware
|
||||||
|
Loading…
Reference in New Issue
Block a user