To be able to provide Provisioning Server (PVS) High Availability (HA), there are a few options. One option stands out, direct server return (DSR). With DSR, NetScaler provides the initial load balancing to an appropriate TFTP server, and then the TFTP and the client talk directly freeing up bandwidth on the NetScaler. The process of the request is as follows:
- A DHCP request is sent by a client, at which the DHCP server responds with an IP address and 2 DHCP options, 66 and 67. Option 66 holds the TFTP server IP, and option 67 holds the boot file name.
- The preboot execution environment (PXE) on the client then makes a request to the TFTP IP.
- NetScaler now makes a load balancing decision. NetScaler uses the MAC address and forwards the request while not changing the destination IP. The frame arrives at the TFTP server with the same destination IP as the VIP configured on NetScaler. The TFTP is able to process this frame because of a loopback adapter with the same IP assigned.
- After the TFTP server receives the request, it forwards the request to the loopback adapter. It then sends to the client the initial segment of its boot file.
The advantages of DSR for TFTP load balancing is that it provides robust scalability and availability. The disadvantages of using DSR is that it requires a bit more effort in configuration and also requires a loopback interface on the TFTP servers.
Now on to the fun stuff. Below you will find instructions on how to configure TFTP load balancing using NetScaler DSR. In this scenario there are 2 PVSs with the TFTP service installed on each. The PVSs have initially 2 network adapters. The first network adapter is used to connect to the server VLAN. The second adapter is to connect to the PVS VLAN for streaming images. We are using 1 NetScaler (or you could use 2 in a HA pair) using subnet IP (SNIP) instead of mapped IP (MIP). There are 3 VLANS connected to the NetScaler. First, the management interface which is where the NetScaler IP (NSIP) is allocated. Second, the server VLAN. Finally, the PVS VLAN So it logically looks like:
Now for the configuration:
- Open the NetScaler GUI and login.
- Navigate to "System" | "Settings"
- Click on "Configure modes".
- Select "Use Source IP".
- Select "MAC Based Forwarding".
- Create the SNIP for the PVS VLAN if not already created.
- Create load balancing servers in NetScaler:
- Navigate to "Load Balancing" | "Servers" and click "Add".
- Enter a name and IP address, the click "Create".
- Repeat this for each TFTP server.
- Create a new service group:
- Navigate to "Load Balancing" | "Service Groups" and click "Add".
- Select "ANY" for Protocol.
- Select "Server based".
- Select the TFTP servers created earlier.
- Enter * for the port.
- Add a ping monitor, or create your own TFTP monitor.
- Navigate to the "Advanced" tab.
- Select "Use Source IP".
- Select "Client Keep-Alive".
- Select "TCP Buffering".
- De-select "Surge Protection".
- Click "Create".
- Create a new virtual server:
- Navigate to "Load Balancing" | "Virtual Servers".
- Type in a name and IP. This is the IP that needs to be used in DHCP option 66. This is also the IP address to be used for the loopback adapters.
- Set the protocol to "Any".
- Set the port to *.
- Navigate to the "Services Group" tab.
- Select the service group created earlier.
- Navigate to the "Method and Persistence" tab.
- Select "SOURCEIP" for persistence.
- Navigate to the "Advanced" tab.
- Set redirection mode to "MAC Based".
- Add the loopback adapter to the TFTP servers:
- Navigate to the device manager.
- Right-click the TFTP server name in the middle pane and choose "Add legacy hardware".
- Click "Next".
- Select "Install the hardware that I manually select from a list (Advanced)".
- Click "Next".
- Select "Network adapters".
- Click "Next".
- Select "Microsoft" for the manufacturer.
- Select "Microsoft Loopback Adapter" for the network adapter.
- Click "Next".
- Click "Finish".
- Navigate to the properties of the new loopback adapter and uncheck IPv6.
- Go to the properties of IPv4 and type in the IP address and subnet mask. This is the same IP address when you created the virtual server earlier. Do not enter a gateway or DNS servers.
- Disable DNS registration on this adapter.
- Disable NetBIOS on this adapter.
- Open a command prompt as an administrator.
- Enter the following commans for the loopback adapter and PVS VLAN adapter:
- netsh interface ipv4 set interface "[name of adapter]" weakhostreceive=enabled
- Enter the following command for just the loopback adapter:
- netsh interface ipv4 set interface "[name of adapter]" weakhostsend=enabled
- Set the TFTP service to listen on the new loopback adapter:
- Navigate to C:\Program Files\Citrix\Provisioning Services.
- Open tftpcpl.cpl as an administrator.
- Click on the "TFTP Network" tab.
- Select the loopback adapter created earlier and de-select any other adapters.
- Restart the Citrix TFTP service.
- Test TFTP load balancing with NetScaler DSR:
- Install the TFTP client feature on a server that is on the PVS VLAN but is not a TFTP server.
- Open a command prompt and enter the following:
- tftp [IP of TFTP virtual server created earlier] GET ardbp32.bin ardbp32.bin
Let me know if you have any comments, questions, or suggestions.

Hello Chris,
ReplyDeletePerhaps you can give me a small direction.
If I understand the server should reply with the VIP / Loopback IP, right?
I followed the instructions but the TFTP servers return to the clients with their real IP and not the VIP / Loopback IP and then the clients refuse to answer (Error 5: "Sorry, wasnt talking to you!")
Any ideas for things I could have missed?
Kind regards,
Ron
ronk@isoft.co.il
Some details -
1. I am using SolarWinds TFTP.
2. Netscaler has a SNIP on the TFTP server's VLAN.
3. Clients are on a different VLAN.
Here is how a wireshark capture is looking on the client -
1 TFTP 65 Read Request, File: ARDBP32.bin, Transfer type: netascii
2 UDP 558 Source port: 62636 Destination port: 56852
3 UDP 76 Source port: 56852 Destination port: 62636 (With the ASCII in the packet's data: "Sorry, wasn't talking to you!"
Hi Ron,
ReplyDeleteThe TFTP will respond to the client with its real IP as you stated and not the VIP address. The following blog post explains this a bit better (http://blogs.citrix.com/2010/11/11/redundancy-and-scalability-for-tftp-using-netscaler-direct-server-return/). For PVS, I usually recommend putting the all the TFTP traffic on the same VLAN as there has been some issues with crossing VLANS in the past (meaning even the VDs or XenApp servers that use PVS have 2 NICS, 1 for production, the other for TFTP). Step # 17 has tripped a couple people up, make sure and make the said change on both adapters mentioned. Also, make sure the bootstrap is configured with the PVS servers IPs on the TFTP VLAN (not VIP). Make sure that the TFTP service on the TFTP servers are set to listen on the VIP. Let me know if any of this helps.
-Chris Keim
Hi Chris,
ReplyDeleteWould the how would one go about this using PVS Boot Device Manager?
Thanks,
Steve
Hi Chris,
ReplyDeleteHow would one go about setting this up using PVS Boot Device Manager?
Thanks,
Steve.
PVS Boot Device Manager is using an ISO image to boot the VM from, which then connects to PVS to grab the image. You specify your PVS servers when you are building your ISO image. Since the VM boots via an ISO, there is no load balancing in the sense that I have described above.
ReplyDeleteOn step 11 where you set the TFTP service to listen on the new loopback adapter, it keeps reverting back to the PVS production interface. I have tried stopping the service and then making the change but it always reverts back. Any ideas?
ReplyDeleteMake sure you are opening that file as an administrator...right-click and then choose "Run as administrator". Whenever I forget to do the previous, I always get the same symptoms as you describe.
ReplyDeleteThat did the trick, didn't realize you could run it as Administrator. Thanks.
ReplyDeleteHi,
ReplyDeletebut how can we monitor the TFTP service listens on the Loopback Adapter ?
http://forums.citrix.com/thread.jspa?threadID=338666&tstart=0
Thx.....
Simplest method
ReplyDeletehttp://blogs.citrix.com/2013/09/02/delivering-the-pvs-bootstrap-via-http/
I successfully test Load Balance PVS TFTP using NetScaler.
Here the steps:
1. enable Web server in PVS
2. copy ARDBP32.bin into C:\inetpub\wwwroot
3. change DHCP option 67 to http://pvs.domain.local/ARDBP32.bin
4. add pvs.domain.local into dns
5. configure NetScaler
create server pvs
create monitor pvs http
create service pvs
create vserver pvs
Hi nbctcp,
ReplyDeleteIndeed the simplest and (when it works) the best method.
BUT - not every implementation of PXE supports HTTP.
On which platform have you tested?
XENSERVER 6.2
DeletePVS 7.1
XD 7.1
NetScaler MPX7500
Starting with NetScaler 10.1, you don't need to use DSR to load balance TFTP, you can set it up with a simple load balance. Another plus is there is a monitor for TFTP, not just ping anymore. I went through the updated procedure here http://www.christopherkeim.com/2014/03/updated-provisioning-services-tftp-load.html.
Delete