# Waiting for cloud-init to generate $NFVBENCH_CONF, retry 60 seconds
NFVBENCH_CONF=/etc/nfvbenchvm.conf
-OPENRC=/etc/nfvbench/openrc
retry=30
until [ $retry -eq 0 ]; do
if [ -f $NFVBENCH_CONF ]; then break; fi
eval $(cat $NFVBENCH_CONF)
touch /nfvbench_configured.flag
-if [ -f $OPENRC ]; then
- source $OPENRC
-fi
-
# Add DNS entry
if [ $DNS_SERVERS ]; then
IFS="," read -a dns <<< $DNS_SERVERS
if [ $INTF_MGMT_CIDR ] && [ $INTF_MGMT_IP_GW ]; then
if [ $INTF_MAC_MGMT ]; then
ETH_PORT=$(get_eth_port $INTF_MAC_MGMT)
- elif [ -f $OPENRC ] && [ "$PORT_MGMT_NAME" ]; then
- $INTF_MAC_MGMT=$(openstack port list | grep $PORT_MGMT_NAME | grep -o -Ei '([a-fA-F0-9:]{17}|[a-fA-F0-9]{12}$)' | head -1)
+ elif [ "$CLOUD_DETAIL" ] && [ "$PORT_MGMT_NAME" ]; then
+ $INTF_MAC_MGMT=$(openstack --os-cloud $CLOUD_DETAIL port list | grep $PORT_MGMT_NAME | grep -o -Ei '([a-fA-F0-9:]{17}|[a-fA-F0-9]{12}$)' | head -1)
ETH_PORT=$(get_eth_port $INTF_MAC_MGMT)
else
ETH_PORT=""
logger "NFVBENCHVM ERROR: Cannot find eth port for management port"
return 1
fi
+
+ # By default, configure the MTU of the management interface to the
+ # conservative value of 1500: this will reduce the risk to get an
+ # unmanageable VM in some setups.
+ #
+ # To set the MTU to a different value, configure the INTF_MGMT_MTU variable
+ # in /etc/nfvbenchvm.conf. If INTF_MGMT_MTU is set to the special value
+ # "auto", the MTU will not be configured and it will keep the value set by
+ # the hypervisor ("legacy" nfvbenchvm behavior). If INTF_MGMT_MTU is unset,
+ # the MTU will be set to 1500. In other cases, the MTU will be set to the
+ # value of INTF_MGMT_MTU.
+ #
+ if [[ -z "$INTF_MGMT_MTU" ]]; then
+ ip link set $ETH_PORT mtu 1500
+ elif [[ "$INTF_MGMT_MTU" != "auto" ]]; then
+ ip link set $ETH_PORT mtu $INTF_MGMT_MTU
+ fi
+
ip addr add $INTF_MGMT_CIDR dev $ETH_PORT
ip link set $ETH_PORT up
ip route add default via $INTF_MGMT_IP_GW dev $ETH_PORT
/nfvbench/start-nfvbench.sh
fi
-exit 0
\ No newline at end of file
+exit 0