Advertisements

Cloning XenApp 6.5 (Or any other version)

I been working with Citrix Provisioning for some time now and I think we are all in agreement that the best option for distributing XenApp servers is to use Citrix Provisioning Services (AKA PVS)

It allows you the ability to make one XenApp server build and bring that same server image up on multiple hosts, physical and/or virtual if you get savy with driver injections, you can read more info on how to inject drivers to your PVS image here).

The goal of PVS is to avoid the administrative overhead of managing multiple different server builds and trying to keep them all identical with respect to applications, registry changes etc… Sometimes you end up with a lot of different PVS images which is normally where mistakes can be made.

Now… I just started working at a new company where PVS is NOT up and running (yet).  I plan on deploying version 6.1 for both XenApp and XenDesktop (I really want to experience the personal vDisk feature!)

Below is the process I followed specifically for a new non PVS Farm running XenApp 6.5

Steps:

  • Install OS and Updates
  • Install & Configure XA65
  • Install XA65 hotfixes
  • Install applications
  • Windows Update
  • Citrix XenApp Cloning Tool – Standard cloning
  • Sysprep
  • Convert VM to Template

Cloning the Production Server:

There are multiple ways you can clone or duplicate the production server. The easiest method is most likely using the cloning feature in your virtual environment. Another method is to restore a recent backup of the production server to the virtual environment, assuming that you backup the entire virtual machine.

Preparing the new cloned VM for Production:

Once you have a clone or “copy” of the existing Production XenApp server that you wish to clone you can begin the process of preparing the server for Production use.

Every persons environment will undoubtedly be unique. Make the best decisions for your own environment when reading this article.

Isolating the cloned VM from Production (This is not 100% needed):

You will need to bring the cloned server up in an isolated network. You don’t want to bring up an exact copy of the existing Production server on the same network for obvious reasons. You can easily do this in VMware by creating a virtual network with no physical adapters tied to it.

The first thing you will want to do is prevent the server from being powered on in the Production environment. Edit the properties of your cloned servers virtual machine and change the network adapter from the production network to the test network. This will ensure that the cloned server is isolated from the Production network once it is powered on.

Note: Your cloned server will most likely already be part of a domain. Assuming that it is, you may want to bring up a copy of a domain controller in the same isolated network. It isn’t necessarily a requirement but it will depend on your environment and level of comfort. You can certainly remove the cloned server from the domain without a domain controller present as long as you know the local administrator account name and password.

Now that you have a copy of a domain controller and the cloned XenApp server added to the isolated network, you can power them on. You will obviously want to make sure the domain controller is up and running before you power on the XenApp server.

Logon to the cloned XenApp server and change the local administrator password. Disjoin the the server from the domain and reboot.

When the server comes back up from it’s reboot, logon using the local administrator account and the newly created password.

Using the XenApp Cloning Tool:

For the next part we will use a Third Party software utility. Cloning a XenApp server requires many changes to the registry, services, databases etc… Citrix has documented these manual steps here.

VirtuAll Solutions has made this process easier with a freely downloadable utility made specifically for cloning XenApp servers. This and many other useful Citrix related utilities and information can be found at the Citrix Tools website located at http://www.citrixtools.net/

The utility we will be using is the XenApp Cloning Tool located here.

Download this utility and upload it to your cloned XenApp server. I find an easy way of doing this is to create an ISO image containing the files and then upload it to the virtual host. Once it’s uploaded, change the virtual machine to use that ISO in it’s virtual CD-ROM drive.

When the ISO is mounted, install the XenApp Cloning Tool onto the cloned XenApp server.

Open the XenApp Cloning Tool. It will look something like this:

Note: The settings in the screenshot may not be the default settings and are not necessarily correct for use with this article.

Look over the information that the software has discovered. Make sure the versions and paths all look correct.

You can ignore the Provisioning Services pieces of the utility as it has nothing to do with our process. For our purposes, we will just be using the default settings. If you have a need and know what you’re doing you can make changes to the default settings.

Click on the “Standard Cloning” button.

The utility will begin shutting down services and changing their startup settings from “Automatic” to “Manual”. It will set its own service to “Automatic”.

Once the utility has completed its process it will present a popup window saying it was successful. At this point you are ready to sysprep the server.

Sysprep the new cloned VM:

Close the XenApp Cloning Tool and launch sysprep. If you do not have sysprep on the server you will need to obtain it from the Microsoft website and upload it to the cloned XenApp server using the same method described earlier.

How you sysprep the server is really up to you. I would choose “Shutdown” from the dropdown menu and then click on the “Reseal” button.

Power the server back on and complete the sysprep process. Choose your licesning options, give the server a new name, pick an administrator account password etc…

Once the server is fully booted with its new name and SID’s the XenApp Cloning Tool service will run and complete the remaining processes for cloning the XenApp server. This includes changes to the services, registry and database. When it completes, it should change its own service to disabled. This prevents it from trying to run the cloning changes again at the next reboot.

Shutdown the server.

Complete the XenApp Cloning Process:

Change the cloned XenApp server’s network adapter back to the Production network.

Power on the cloned XenApp server, logon and join it to the domain.

Reboot the server again, logon and check that all the Citrix services started properly. If they didn’t, you will need to troubleshoot your exact issue and work from there, possibly even running the cloning tool again, but that will be for you to decide based on the problem.

If all went as planned, your Citrix services should all be running and the cloning tool service should be disabled.

Check your Production Citrix Farm and you should see the recently cloned server show up in the list of XenApp servers and everything should look healthy.

Now you can add this server to existing Published Applications, Desktops, Gateway’s etc…

If nessasary, move the server to another virtual host etc…

Advertisements

About CyberRuiz
Highly motivated with over 12 years experience on Citrix/VMWare/Microsoft/technologies. Exceptional communication skills and team player. CCIA – Citrix Certified Integration Architect. CCEA – Citrix Certified Enterprise Administrator. VCP – VMWare Certified Professional in ESX 2.x, VI3, VI4 MCSE – Microsoft Certified Systems Engineer

29 Responses to Cloning XenApp 6.5 (Or any other version)

  1. Rajeev says:

    Thanks a lot. Worked great, saved lot of time 🙂 …

  2. Hartge says:

    Thanks, but there is one issue when using Sysprep on Windows 2008 R2, after sysprep has run and you will first start the server, you won’t be asked for a computername, it’s something like WIN-xxxxxxx. So I had to rename it to the desired name. In my case the Citrix Clone tool did not change the services back to automatic. I have done this myself and everthing seems to be working.

    What can I check to be sure everything is OK now ?
    Any ideas ?
    Thank you very much !

    • CyberRuiz says:

      Hartge,
      Check for the following… and yes good point re: Windows 2008 R2 sysprep.

      First make sure the new server name is in your Farm under the Citrix AppCenter (AKA Citrix Delivery Console, AKA CMC <- if you are old school)
      and of course if you can open Apps.

      If you are running the EdgeSight Agent in your XenApp Server:
      Make sure the EdgeSight.ini normally located under C:\Users\All Users\Citrix\System Monitoring\Data\ contains the new server info

      Make sure the FireBird Citrix System Monitoring Local Database normally located at : C:\ProgramData\Citrix\System Monitoring\Data\RSDATR.FDB was recreated

      Check to make sure the Localhost Cache and the RADE Cache was rebuilt properly under C:\Program Files (x86)\Citrix\Independent Management Architecture\
      MF20.dsn
      RadeOffline.dsn

      Make sure the CitrixTools Cloning Service is disabled

      Check the following services are set to auto and are started:
      Citrix System Monitoring Agent Service
      Citrix System Monitoring Agent Firebird service
      Citrix CPU Rebalancing Service
      Citrix CPU Rebalancing Service
      XenApp Health Monitoring Service
      XenApp XML Service
      XenApp MFCOM Service
      Citrix WMI Service
      Citrix Independent Management Architecture and dependent services
      Citrix Print Manager Service
      Print Spooler Service
      CitrixTools Cloning Service
      Citrix Profile Management Service

      Check your Citrix Profile Management Service Cache
      C:\Program Files x86\Citrix\User Profile Manager\

      That should do it…

  3. Hartge says:

    Hi Daniel, checked and everything seems to be fine. Thanks !

  4. Tippa Few says:

    At what point would you create a Template of the newly created clone? I assume just after shutting down the server once sysprep has run?

    • CyberRuiz says:

      Tippa Few – As you mentioned, do it after you run the “Standard Cloning” from the cloning tool and run newsid/sysprep.

      The only thing I would add is to make sure the “CitrixTools Cloning Service” is set to disable before you shut off the VM and do your clone. That way the next time you turn it on, you can rename the box (after newsid/sysprep runs), join the domain, and before you reboot the box, set the “CitrixTools Cloning Service to Auto”. This way the box will run the process when you log in as a Citrix Admin to the farm after it comes back up.

      After the “CitrixTools Cloning Service” is done, you will see that it will disable it self.

      Hope this helps,
      Daniel

  5. elleboef says:

    thanks, but do you have to pay for the tool? http://www.citrixtools.net
    and what option do the use for sysprep on windows server 2008 r2 x64? There are less settings?

    • CyberRuiz says:

      Elleboef, Sysprep is installed by default on Windows Server 2008. You can find it at:

      c:\Windows\System32\sysprep\sysprep.exe

      The experience is also streamlined considerably. Simply run sysprep.exe with the OOBE option and check the “Generalize” checkbox (regenerates system SID), change the Shutdown Options to “Shutdown”, and click OK. The system will go through the sysprep process and shut itself down. You can now create cloned servers to your heart’s content simply by creating linked servers and booting the clone as originally documented.

      *** Make sure to check the the Generalize checkbox, if you don’t you will not get a new SID ***

      • Kyle says:

        CyberRuiz – Whenever you select Generalize, the server will blue screen on next reboot, when you do not select it, it boots up as normal. Is there a way to get around this? Does this NEED to be done since the OOBE is done before joining the domain again?

      • CyberRuiz says:

        Kyle,
        The process of checking the “Generalize” checkbox is to create a new SID. You have to make sure you SID the box. What is the message you are getting on your BSOD?

        Take a look at this post and it should help you.
        http://social.technet.microsoft.com/Forums/en-US/winserversetup/thread/894dd306-6780-4741-9616-f00b002bfb3c/

        Daniel

      • Kyle says:

        The machine was cloned while it was on the domain and in a powered off state. But when I powered on the cloned VM, ran the Citrix tool with a sysprep, it was in workgroup. After you put it back on the domain, doesn’t it create a new SID from the domain?

      • CyberRuiz says:

        Kyle,
        When you run sysprep on a Windows 2008 server with the “Generalize” checkbox, it will generate a new system SID.
        After you join it back to the domain, AD will see it as a new host.

        Cheers,
        Daniel

  6. Oscar says:

    This procedure work if the server are Data Collector ???? thanks in advanced

    • CyberRuiz says:

      Oscar,
      Yes I’ve done it on the Data Collectors as well. However pay particular attention to the make sure the Localhost Cache and the RADE Cache was rebuilt properly after the clone which is usually located under C:\Program Files (x86)\Citrix\Independent Management Architecture\

      MF20.dsn
      RadeOffline.dsn

      Cheers
      Daniel

  7. Laurentor999 says:

    Hi,
    Is it possible to apply your procedure on the first server of the farm, which was used to create the newly farm etc … ?
    Because according to citrix edocs and their PVS methodology (http://support.citrix.com/proddocs/topic/xenapp65-install/ps-image-prep.html), they said that Cloning is not supported for the first server in the farm (where you created the farm during configuration), and should be used only for creating new member servers for an existing farm

    • CyberRuiz says:

      It is recommended that you do not clone the first member of the farm, since that is mainly your Data Collector.

      You can however clone it then change the role by starting the XenApp Server Role Manager and making sure it is set to Session Host only and not a Data Collector. I would advise agains it.
      There is a role to run a Data Collector and Session Host as the same role, but I don’t recommended as you should really leave the Data Collectors to only have that role and not host apps.

      Get another XenApp server up and join it to the farm while installing, and set it to host only mode. Once you do that, get your apps installed and all your fun roaming stuff, then you can clone that box. Make sense?

      Hope this helps
      Daniel

  8. Laurentor999 says:

    Relating to my last comment, the datastore is hosted on another server (SQL server ) , licence server too.

  9. Laurentor999 says:

    Hi CyberRuiz, This works a fine !! But my template is a little old as I must update this (new version of installed applicaitons and etc …). So Can I convert the vm template to a simple VM, start it without in an isolated network than the Xenapp farm, update my programs and reconvert the VM to a template ?

    Regards

    • CyberRuiz says:

      Laurentor999,
      You can certainly do that. You don’t need the isolated network.

      Just make sure you don’t use an IP you already have in place 😛

      Glad this helped

      Cheers,
      Daniel

  10. Laurentor999 says:

    Hi CyberRuiz, This works a fine !! But my template is a little old as I must update this (new version of installed applicaitons and etc …). So Can I convert the vm template to a simple VM, start it without in an isolated network than the Xenapp farm, update my programs and reconvert the VM to a template ?

    Regards

  11. Fred Neelen says:

    Hi All,

    I have just installed an configured XenApp 6.5 on HyperV, working just the way i need it. The server is not in production yet, would like to do that next week. I do however want to clone it.. If I create an offline copy of the server and run through will the steps above would it work properly? I have read 1000 articles sayng “dont use your 1st server in your farm to configure”. Please let me know if anyone has tried it. Thanks in advnace for any advise.

    Fred

    • CyberRuiz says:

      Fred,
      It is recommended that you DO NOT clone the first member of the farm, since that is mainly your Data Collector.

      You can however clone it then change the role by starting the XenApp Server Role Manager and making sure it is set to Session Host only and not a Data Collector. I would advise agains it.

      There is a role to run a Data Collector and Session Host as the same role, but I don’t recommended as you should really leave the Data Collectors to only have that role and not host apps.

      Get another XenApp server up and join it to the farm while installing, and set it to host only mode. Once you do that, get your apps installed and all your fun roaming stuff, then you can clone that box. Make sense?

      Hope this helps
      Daniel

      • Fred Neelen says:

        Absolutely does! I appreciate your reply and guidance. I have already started the process outlined above today as a matter of fact. Going forward I can use this machine for all cloning. When reading CItrix best practice it had mentioned i should have multiple data collectors in my farm. The farm will only have two maybe a max of three servers, should I make two of my three data collectors?

        Again thanks for your help Daniel.

      • CyberRuiz says:

        Glad it helped you. Always think redundancy.

        Implement at least 2 Data Collectors and 2 XenApp Hosted Appa servers.

        N+1 is what I always for for.

        Thanks
        Daniel

  12. JDG says:

    Out of the three officially supported methods by citrix.
    http://support.citrix.com/proddocs/topic/xenapp65-install/ps-image-prep.html

    Which one does this most closely match to?

  13. Marco says:

    Here the Service startup type stays “automatic” after reboot. How can I be sure that the this is the only step that did not run and all the other steps before (“…changes to the services, registry and database”) have completed sucessfully, or can’t I?

    tia

  14. Daniel says:

    Hey Daniel I ran into a problem that some of your readers might be interested in. Everything worked as advertised but the server I cloned in the VMware console had the admin password set to cannot be changed. When I ran sysprep and it blanked out the password and after reboot password was required to be changed I received and access denied. I downloaded Offline NT Password and Registry Editor and rebooted the cloned VM guest off of the ISO file and reset the password that way and I was able to get in and finish the process.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: