Friday 2 October 2015

How to Clone the First Xenapp 6.5 Server in a Farm

Recently I was tasked to build a new Xenapp 6.5 Farm to replace the old, unsupported Metaframe 5 servers. Since I have managed several migrations to 6.5 over the last few months I had no hesitation taking this on. After all, it only involved building 4 new Xenapp servers - easy peasy.

 This particular project was a bit of a rush job because the IT manager wanted everything wrapped up within two weeks, however I had vacation booked for one of them. He had vacation booked for the two weeks after I was to come back. That leaves only 1 week to accomplish the build and configuration of a new Xenapp Farm.

From the beginning the idea was to build one server, install and test the corporate application then clone it and provision the rest of the servers from the clone. Since I was the technical lead and point of reference it was up to me to approve, plan and deploy the new farm. 

The short turn-around time almost came back to bite me in the arse though.  The client had a server with the application installed and tested by an end user - that was good. The server did not have and Remote Desktop Services installed and I was not sure that the user did not have elevated privileges. However, my contact assured me that it was working properly and ready for production in a new Citrix farm. His plan was to build install RDS and Xenapp on this server and create a new farm in the process. 

So I got to work, added the RDS Session Host role, created a database on a dedicated SQL server and installed Xenapp. After building a new Citrix License server everything was complete and working so it was time to hand it back to the client for cloning.  We were making good time and it looked like the project could be completed in the few days we had.

Then I remembered something! Something about how cloning the first server in a farm is a bad idea. This created a little panic. I went to Google to research this more, looking for a way to clone this 'first' server however after reading several threads I found nothing, just more techies saying that it is an incorrect approach. 

Two options remained, as far as I could see. Build a second server to be cloned, or remove Xenapp from the first one, delete the database and then clone the server before installing Xenapp. The second choice would take the least amount of time so it was decided to follow that path.

The Third Option
As I was looking at the options in the Xenapp Server Role Manager, I came across an option to Remove This Server From the Current Farm. That looked intriguing! 
Since I nothing to lose at this point, I decided to remove the server from the farm, reboot and add it back. Well, guess what.... I chose 'Join an Existing Farm' and it connected to the database, opened App Center and all of the farm settings were intact - Except that the server was removed from the application that was published. The Application was still published, but no servers were listed. No problem, I just added the server to the app again and Voila.

By now you are probably wanting me to talk less and shut-up more, so I will do that while you look at the screen shots.

1. Build your First Xenapp server to completion, Install all of the applications that you want in the clone. You may want to include all printer drivers that are necessary. Test ICA connectivity to the server and perform any other tests you deem necessary.

Choose 'Edit Configuration'
2. Prepare to Clone: Open Xenapp Server Role Manager and click on 'Edit Configuration' then click 'Remove the server from the current farm.

User-added image
Choose 'Remove this server from the current farm'
3. When the action completes, change the IMA service to Disabled and shutdown the server. 4. You can clone this Xenapp 6.5 server at this point. Use your favourite SysPrep tools to prepare the clones for production.5. Restart the first server, open Xenapp Server Role Manager again, choose 'Configure'. You will be prompted for the usual information.  Choose 'Join an Existing Farm'.  Make sure you select 'Enable Controller and Session Host Modes'.User-added image 6. Change the IMA service back to Automatic and start the service. Open App Center, you should be able to connect to the datastore. Remember, if you published any applications to this server, you will need to add the server back into the Servers list.Now that your farm is ready, and in record time, you can relax and listen to some music. I suggest  finding an artist you haven't heard before... such as Shoot the Moon. Check out 'It's Alright'  https://www.youtube.com/watch?v=hIQG9HN6c9c