To set the script to run at startup use chkconfig –add scriptname.sh, for example: chkconfig –add starttftp.sh. Next set execute permissions on the script by running chmod +x scriptname.sh, for example: chmod +x starttftp.sh. Press escape to leave the editor and :wq to save the file and quit. If you wish to modify further see the following sources: Bash commands, Script Options, Startup, and for the iptables commands. I left the defaults in from the Image Builder Service as it made sense they started at the same time and had the same dependencies. The file must be in the above format to be compatible with chkconfig which runs the script at startup. # Required-Start: $local_fs $remote_fs $network
#! /bin/sh # TFTP Start/Stop the TFTP service and allow port 69 I used the following, which was copied from the Image Builder Service startup script, and modified for TFTP. Next change the directory by running cd /etc/init.d, and create a new script: vi scriptname.sh, for example: vi starttftp.sh. The following commands are all run in Bash on the vCenter Server Appliance, you can stay in the existing session we were using above.įirst make a copy of the existing iptables config by running iptables-save > /etc/les. The steps are outlined below and this worked for me, however as a reminder this is not supported by VMware, and if you are a Linux expert you’ll probably find a better way round it. Basically I am going to backup iptables and create a script to restore iptables and start the TFTP service when the appliance boots. There isn’t an official VMware way of doing this, and as it’s done in Linux there may be more than one way of achieving what we want. The TFTP server will now work, however we need to make a couple of additional changes to make the configuration persistent after the VCSA is rebooted. Validate traffic is being accepted over port 69 using iptables -nL | grep 69. To allow TFTP traffic through the firewall on port 69 we must run iptables -A port_filter -p udp -m udp –dport 69 -j ACCEPT. Check the service is started using service atftpd status. To start the TFTP service enter service atftpd start. First type shell and hit enter to launch Bash. SSH onto the vCenter Appliance, using a client such as Putty, and log in with the root account.
From the Access page enable SSH Login and Bash Shell. Enable SSH on the VCSA by browsing to the Appliance Management page: where VCSA is the IP or FQDN of your appliance. Now that Auto Deploy is enabled we can configure the TFTP server. You should now see the Auto Deploy icon on the home page. Log out of the web client and log back in. To start a service right click and select Start, then select Edit Startup Type and choose Automatic. The Auto Deploy, ImageBuilder Service, and VMware vSphere ESXi Dump Collector services should all be set to Automatic and Running. Select the vCenter Server and open the Related Objects tab. Open the vSphere web client and click System Configuration, Nodes.
This post assumes that you have a working vCenter Server Appliance, and may be of use if you have recently migrated from Windows vCenter to VCSA. For more information on Auto Deploy, and to see the process for creating ESXi images and deploy rules to boot hosts, see the VMware Auto Deploy 6.x Guide. This post covers the steps required to use the vCenter Server Appliance for Auto Deploy, with the built in TFTP server in vSphere 6.5.