1 2 Previous Next 19 Replies Latest reply on Oct 5, 2009 7:43 AM by Rajeev S

    VDI: Free Connection Broker

    nick.couchman Champion

      This solution covers creating a VDI connection broker for a set of Windows XP VM's with tools provided in most standard Linux installations.

       

      Here's are a list of assumptions and requirements:

      1) Linux server, stock kernel with LVS/IPVS enabled.

      2) IPVSADM installed on Linux server (check your package manager).

      3) VM's set up on one or more servers in bridged mode.

       

      How-To:

      1) Create your VM's, set up in bridged mode, and assign them IP addresses.

      2) Go to the server you're going to make the connnection broker, and use the IPVS admin tool to create a new virtual server service with a virtual IP and port number.  If the virtual IP is different from this servers real IP address, the virtual IP will have to be added to the network card as an IP alias.  For this document, we'll say that your connection broker and your virtual IP address are both going to be 192.168.10.10.

      ipvsadm -A -t 192.168.10.10:3389

      /code

      This will create a new virtual service on port 3389 (the MS Terminal Services port) listening on the IP address associated with the connection broker.

      3) In each of your XP VM's, go to the "Add Hardware" wizard, add a new device, and don't let XP search for the device (say that you'll specify the device).  Select "Network Adapters" and then locate and select the "Microsoft Loopback Adapter."  Once you've added this piece of hardware, go to the TCP/IP properties for the new network interface and assign a static IP address.  The static IP should be the IP of your virtual service - in this case, 192.168.10.10.

      4) On your connection broker machine, add each of the XP VM's to the IPVS table as real servers for this virtual service.  In our case, we'll assume that the XP VM's have IP's 192.168.10.20 through 192.168.10.29.  The commands would go something like this:

      \# ipvsadm -a -t 192.168.10.10:3389 -r 192.168.10.20:3389 -x 1

      \# ipvsadm -a -t 192.168.10.10:3389 -r 192.168.10.21:3389 -x 1

      \# ipvsadm -a -t 192.168.10.10:3389 -r 192.168.10.22:3389 -x 1

      \# ipvsadm -a -t 192.168.10.10:3389 -r 192.168.10.23:3389 -x 1

      \# ipvsadm -a -t 192.168.10.10:3389 -r 192.168.10.24:3389 -x 1

      \# ipvsadm -a -t 192.168.10.10:3389 -r 192.168.10.25:3389 -x 1

      \# ipvsadm -a -t 192.168.10.10:3389 -r 192.168.10.26:3389 -x 1

      \# ipvsadm -a -t 192.168.10.10:3389 -r 192.168.10.27:3389 -x 1

      \# ipvsadm -a -t 192.168.10.10:3389 -r 192.168.10.28:3389 -x 1

      \# ipvsadm -a -t 192.168.10.10:3389 -r 192.168.10.29:3389 -x 1

      /code

      Notice the "-x 1" on the end of each command.  This option sets the "upper threshold" (maximum number of connections to the service) to "1" so that each of your XP VM's only gets 1 connection.  Additional users that attempt to connect after all of the servers have 1 connection will be denied a connection.

      5) All done - you should be able to open an RDP connection to 192.168.10.10 (insert your virtual IP address here) and get connected to one of the XP VM's.  Use the "ipvsadm -l" command to see which of your real servers has a connection to it.  Open multiple connections to see that you get placed on a different VM each time!

       

      -Notes-

      *) If you're familiar with other high-availability/load-balancing projects, like keepalived, you can use these programs to dynamically add and remove XP VM's from the list of available VM's as the VM's are brought online or taken offline.  Also, many of these programs feature the ability to have multiple "connection brokers" that can back each other up in case one of them goes down (a good idea in a production environment).

      *) This little how-to assumes a lot about knowledge of Linux and administration tasks of Linux.  More detailed information on LVS/IPVS can be found at http://www.linuxvirtualserver.org.  Information on keepalived can be found at http://www.keepalived.org.  For Linux administration information of all kinds, see http://www.tldp.org.

        1 2 Previous Next