[devstack] Allow setting TFTP max blocksize

Configuring the block size correctly for TFTPd prevents fragmentation of
the TFTP UDP packets, which can significantly slow down or even prevent
servers from booting correctly with PXE.

Change-Id: Ic00bbcfb3137edb58479c019edb3fcdc4ef55d69
This commit is contained in:
Sam Betts 2017-12-18 15:13:48 +00:00
parent 7e47264ece
commit 55ac08ab85
3 changed files with 14 additions and 1 deletions

View File

@ -128,6 +128,7 @@ IRONIC_TEMPLATES_DIR=${IRONIC_TEMPLATES_DIR:-$IRONIC_DEVSTACK_DIR/tools/ironic/t
IRONIC_BAREMETAL_BASIC_OPS=$(trueorfalse False IRONIC_BAREMETAL_BASIC_OPS) IRONIC_BAREMETAL_BASIC_OPS=$(trueorfalse False IRONIC_BAREMETAL_BASIC_OPS)
IRONIC_TFTPBOOT_DIR=${IRONIC_TFTPBOOT_DIR:-$IRONIC_DATA_DIR/tftpboot} IRONIC_TFTPBOOT_DIR=${IRONIC_TFTPBOOT_DIR:-$IRONIC_DATA_DIR/tftpboot}
IRONIC_TFTPSERVER_IP=${IRONIC_TFTPSERVER_IP:-$HOST_IP} IRONIC_TFTPSERVER_IP=${IRONIC_TFTPSERVER_IP:-$HOST_IP}
IRONIC_TFTP_BLOCKSIZE=${IRONIC_TFTP_BLOCKSIZE:-$((PUBLIC_BRIDGE_MTU-50))}
IRONIC_VM_COUNT=${IRONIC_VM_COUNT:-1} IRONIC_VM_COUNT=${IRONIC_VM_COUNT:-1}
IRONIC_VM_SPECS_CPU=${IRONIC_VM_SPECS_CPU:-1} IRONIC_VM_SPECS_CPU=${IRONIC_VM_SPECS_CPU:-1}
IRONIC_VM_SPECS_RAM=${IRONIC_VM_SPECS_RAM:-1280} IRONIC_VM_SPECS_RAM=${IRONIC_VM_SPECS_RAM:-1280}
@ -2143,6 +2144,7 @@ function configure_tftpd {
[ -f /etc/init/tftpd-hpa.conf ] && echo "manual" | sudo tee /etc/init/tftpd-hpa.override [ -f /etc/init/tftpd-hpa.conf ] && echo "manual" | sudo tee /etc/init/tftpd-hpa.override
sudo cp $IRONIC_TEMPLATES_DIR/tftpd-xinetd.template /etc/xinetd.d/tftp sudo cp $IRONIC_TEMPLATES_DIR/tftpd-xinetd.template /etc/xinetd.d/tftp
sudo sed -e "s|%TFTPBOOT_DIR%|$IRONIC_TFTPBOOT_DIR|g" -i /etc/xinetd.d/tftp sudo sed -e "s|%TFTPBOOT_DIR%|$IRONIC_TFTPBOOT_DIR|g" -i /etc/xinetd.d/tftp
sudo sed -e "s|%MAX_BLOCKSIZE%|$IRONIC_TFTP_BLOCKSIZE|g" -i /etc/xinetd.d/tftp
# setup tftp file mapping to satisfy requests at the root (booting) and # setup tftp file mapping to satisfy requests at the root (booting) and
# /tftpboot/ sub-dir (as per deploy-ironic elements) # /tftpboot/ sub-dir (as per deploy-ironic elements)

View File

@ -6,7 +6,7 @@ service tftp
wait = yes wait = yes
user = root user = root
server = /usr/sbin/in.tftpd server = /usr/sbin/in.tftpd
server_args = -v -v -v -v -v --map-file %TFTPBOOT_DIR%/map-file %TFTPBOOT_DIR% server_args = -v -v -v -v -v --blocksize %MAX_BLOCKSIZE% --map-file %TFTPBOOT_DIR%/map-file %TFTPBOOT_DIR%
disable = no disable = no
# This is a workaround for Fedora, where TFTP will listen only on # This is a workaround for Fedora, where TFTP will listen only on
# IPv6 endpoint, if IPv4 flag is not used. # IPv6 endpoint, if IPv4 flag is not used.

View File

@ -63,6 +63,17 @@ node(s) where ``ironic-conductor`` is running.
sudo systemctl restart xinetd sudo systemctl restart xinetd
.. note::
In certain environments the network's MTU may cause TFTP UDP packets to get
fragmented. Certain PXE firmwares struggle to reconstruct the fragmented
packets which can cause significant slow down or even prevent the server from
PXE booting. In order to avoid this, TFTPd provides an option to limit the
packet size so that it they do not get fragmented. To set this additional
option in the server_args above::
--blocksize <MAX MTU minus 32>
#. Copy the PXE image to ``/tftpboot``. The PXE image might be found at [1]_: #. Copy the PXE image to ``/tftpboot``. The PXE image might be found at [1]_:
Ubuntu (Up to and including 14.04):: Ubuntu (Up to and including 14.04)::