Cloning a XenApp Server with XenAppPrep

One of my side projects these past couple of months has been XenAppPrep – a tool that will help our customers clone their XenApp servers. It’s basically the equivalent of sysprep for Windows, except we’re doing it for XenApp. Before taking an image of a XenApp server, a handful of steps must be done to generalize the XenApp installation, which will remove the machine-specific information from your XenApp install.

In the past, our customers either had to perform this manually or use a set of scripts Matt Bator and Pete Downing, my fellow coworkers from the Provisioning Server Team, had created. The XenAppPrep tool does this all for you and will be released as a small MSI, which was written in WiX. It contains a command-line tool and Windows service that were both created in C#, so you’ll need the .NET Framework 2.0 installed. With XenAppPrep, you can easily clone your XenApp server via the following steps:

  1. Setup the XenApp server that will be cloned with all of the apps and settings that you’d like in your image.
  2. Install XenAppPrep.
  3. Run the XenAppPrep command-line tool. This tool removes all of the machine-specific information from the XenApp install. If you plan on rolling out this image via Provisioning Server, you can use the /pvs switch.
  4. Run any other generalization tools you would normally run (e.g. sysprep).
  5. Capture an image of the server.
  6. Push out the image to all servers that will be part of your farm.

When your clones come online, the XenAppPrep service will kick in, reset all of your machine-specific information, and kick off the XenApp services such as IMA. This all gets done pretty quickly too. After that, your clone will work just like a freshly installed XenApp server. If you ran the tool with the /pvs switch, the XenAppPrep service will always run when the machine starts. Otherwise, the service will only run on the first bootup and disable itself after.

Here’s a screenshot of the command-line tool running against Delaware (aka XenApp 5.0):

This tool will work on both physical and virtual machines, so you could easily setup your farm on physical machines (e.g. with Provisioning Server or Altiris) or virtual machines with XenServer. Even better, you could deploy your XenApp servers with Provisioning Server to virtual machines! With this type of infrastructure, you can easily bring up new XenApp servers on the fly. Imagine having some automation that detects when the farm is overloaded, brings a new XenApp server online, and everything goes back to normal… maybe Workflow Studio could help us out here. Wow, that sounds pretty geeky!

We plan on releasing this initial version as a web download in the near future with support for XenApp 4.0 to 5.0. I’ll post a link to the web download here once we go live, so if you’d like to be notified go ahead and subscribe to my blog. We’d like to include this on the XenApp media and possibly see how it can integrate with the XenApp installer (so you have an option to clone the server at the end of install), but this wont be happening in Delaware and is more of a long-term item.

Much thanks to Matt Bator for his help with testing this tool in addition to Pete Downing and Ashish Gujarathi for collecting the requirements and feedback from the field. Well, it is 2 AM here in Fort Lauderdale so I better get going. Feel free to drop me a comment if you’d like, I’d love to hear any and all feedback.

50 Responses to Cloning a XenApp Server with XenAppPrep

  1. Dear Shannon,

    We had the same idea :) Actually I’ve worked a lot with PVS 4.5 and found some missing things in the vbs that could lead to WMI errors when the servers will go into production. This is also the case when using this script to do for example a VM Template. I’ve found solutions and am writting a service and a GUI App to help with it but as you started building something I think this could be very useful to exchange about it.

    Best Regards,

    Pierre

  2. Andy says:

    The manual way works (http://support.citrix.com/article/CTX107406) but does take some time. Looking forward to your automated solution!

  3. Pingback: XenAppPrep! Coming Soon! « Henny Louwers

  4. Faisal Iqbal says:

    Sounds Awesome! I have a customer who would love this! please let me know when it becomes available!

  5. Janson Ragon says:

    Hi,

    This sounds like a really great tool, and one I have been looking for, for some time. Does this tool work on both X86 and X64 platforms?

    We are currenlty nearling the completion of our builds for a Presentation Server 4.5 Rollout, this tool could be very timely? Are you any nearer to release or is it possible to help test a pre-release version?

    Great work!

    Cheers

    Janason

  6. shannonma says:

    Thanks for the feedback Janson. This tool does work on 32-bit and 64-bit platforms. We’re tentatively scheduled to release it as a download on 28-July. I’ll post a link here once it goes live.

  7. Sorry to be so dense, but your posting says that to be notified when the new cloning tool is ready, subscribe to this blog….but I find no plave that looks lie I can subscribe.

    -RM

  8. shannonma says:

    You can subscribe via http://shannonma.wordpress.com/feed/. When you visit sites that have RSS feeds, IE 7.0 and Firefox will enable the RSS icon (in their menu bars) that directs you to the feed. I’ve also added this to the links menu on the right, thanks for the comment!

  9. Joe Shonk says:

    This looks pretty cool. Are you still planning on a release for next Monday?

    Joe

  10. JR says:

    Quick clarification – when the new server comes up, will it automatically be inserted into existing published applications as a viable server in the workload (same as the one that it was cloned from?)
    You mentioned the server-on-demand possibility which a great – but definitely need the published app piece automated to work for that.

    Thanks – and great job!

  11. Joe Shonk says:

    I would think adding published applications for servers-on-demand would be something you would do with Workflow Manager.

    Joe

  12. shannonma says:

    Thanks for the feedback Joe. I have received some feedback from internal beta testers that I’d like to address before releasing the tool. Some additional time will be needed to take care of this, but you should see it on the web by the end of August.

  13. shannonma says:

    JR, when the new clone comes online it will be detected by IMA as a new server that joined the farm… as if you just installed XenApp on this machine. You’re right about needing some automation to publish the apps, this is where Workflow Studio would come into play.

  14. Dan Willis says:

    A great idea – something I could have done with here in my current role. I’ll be watching this!

  15. Pingback: Choosing an Automated Deployment Strategy for XenApp (Part 4/4) « Shannon Ma Virtualized

  16. Janson Ragon says:

    Hi

    Just popping back to see if this great sounding tool had been released, and understand further testing is required? Are you accepting external testing, and if so feel free to contact on my email address.

    Many thanks

    Janson

  17. shannonma says:

    I’m working on addressing the feedback I received from an internal beta test of the tool. Some additional time will be needed to take care of this, but the tool should be available as a download by the end of August. I’ll post a blog here once it goes live, so if you’d like to be notified you can subscribe to the RSS feed.

  18. Janson Ragon says:

    Thanks for the feedback, look forward to testing out the tool when its available.

    Cheers

  19. Cristian Diaz says:

    I’m having an issue with the tool and I would like to understand it. The XenAppPrep service is not starting and the Citrix SMA service as well.

  20. Cristian Diaz says:

    Shannon,

    When are you releasing the version? I have a customer that is using the beta version I believe. I’m helping them out with “down sessions” issue we are having…

  21. shannonma says:

    I’ve been working with the Product Management Team at Citrix to ensure the tool will be supported via our support channels before its released. We’re wrapping up the final bits and pieces of this. The new tentative release date for the tool is 10-Sep-08, the same day XenApp 5.0 will be released for general availability. I’d like to collect some additional info on the problem you’re seeing with the XenAppPrep and SMA services, could you contact me via the Contact page and let me know the details of your environment (e.g. OS, XenApp version, etc.) in addition to the steps you took to run the tool? If you see errors in the Event Log from any Citrix service, please attach them as well. Thanks!

    • Mike says:

      This tool is an Citrix admin’s dream. It worked great on redeploying one of our farms.
      I do have a questions about using XenAppPrep and Sysprep for a PS server with remapped drives. Is there a way to use Sysprep in this situation? I have read about using NewSID, but it seems much more complicated. With XenAppPrep and Sysprep I can deploy servers in minutes and I would like to keep it that way. Thanks!

      • shannonma says:

        Thanks for the feedback Mike. XenAppPrep doesn’t address the remapped drives issue. How are you cloning your XenApp servers? I haven’t experienced this issue myself, however it sounds like it may be particular to some drive cloning apps (namely Ghost, Acronis is supposed to work fine). There’s a thread that was posted on the Citrix Forum a while ago that talks about this and lists a workaround (http://forums.citrix.com/message.jspa?messageID=157815). If you’re using Ghost, you should be able to use the workaround and XenAppPrep to do something like this:

        Create your sysprep answer file and within it have a run once action that will rename the HKLM\System\Mounted Devices\DosDevices\C: value to your remapped drive letter. Also, set HKLM\Software\Microsoft\Windows NT\CurrentVersion\WinLogon\Userinit to begin with your remapped drive letter.
        Run XenAppPrep.
        Go to “HKLM\System\Mounted Devices”. Delete the drive letter entries and thier associated GUIDs for all volumes.
        Go to “HKLM\Software\Microsoft\Windows NT\CurrentVersion\WinLogon\Userinit”. Change the path to Userinit.exe to begin with C:\ instead of your remapped drive letter.
        Run sysprep and Ghost as you normally do.

        Hope this helps.

    • Mike says:

      I am imaging using ShadowProtect from StorageCraft. I attempted to use a RunOnce command in the sysprep.inf file using the following syntax:
      REG DELETE HKLM\SYSTEM\MountedDevices
      REG IMPORT %systemdrive%\Sysprep\MD.reg
      REG ADD HKLM\SYSTEM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon /v Userinit /t REG_SZ /d M:\WINDOWS\system32\userinit.exe, /f
      It was not successful. After the minisetup I was again presented with message saying that the systems could not find userinit.exe.
      Interestingly I did find a related article that has a good solution to correct the issue.
      http://www.acronis.com/support/kb/articles/778/index.html

  22. Steve says:

    Hi Shannon,

    Is the tool going to be realeased soon … I am hoping to give it a try on some servers I have here waiting to be setup.

    Thanks,
    Steve

  23. Carl Webster says:

    Any update on the release of your XenAppPrep tool?

  24. Hi Shannon, I’m eagerly awaiting xenappprep. Has it been released?

  25. Alex Goerg says:

    Dear Shannon,

    where can I find the final version, if the tool has been released? I already used the beta version in a pvs 5 – xa 4.5 environment with fantastic results…

  26. Janson Ragon says:

    Hi Sahnnon, I’m guessing the date slipped a bit since the 10th Sept? Any news on when we might be able to get our hands on the tool!!

    Cheers

    Janson

  27. Pingback: XenAppPrep Soon To Be Released « Shannon Ma Virtualized

  28. Pingback: XenAppPrep Soon To Be Released « Sbcfreak’s Weblog

  29. C Stewart says:

    Looking forward to the release of this. One of our 3rd party partners (will remain nameless) cloned one of our production servers for DR purposes then connected it to the network. Would appear they did nothing to strip out the machine specifics, our edgesight server now reports the data of the production server as the DR server. Think this kind of applicaiton will help greatly simplify and de-risk what is the simplest form of scaling out a XenApp farm.

    Keep up the good blogging, have added a link to your blog from my own blog site

    http://www.virtualpro.co.uk

  30. Pingback: XenAppPrep - soon to be released - VirtualPro

  31. Pingback: XenAppPrep is here! « Shannon Ma Virtualized

  32. MaxB says:

    Is the xenappprep tool integrate the ctxsma/ctxcpsvc re-creation tool ?

  33. WayneB says:

    Hi Shannon,
    Does XenAppPrep tool makes adjustments for SSL relay with private certs? or do I have to remove the certs from the master image and install them subsequently on the individual servers in the Farm?

  34. edwinhouben says:

    Can I use the XenAppPrep tool for CAE 2.0 ?

  35. robin says:

    DO you run xenappprep 1st then syspre on a xenapp box before cloning it…..if so what are the switches for sysprep on widows 2008 that will be used before cloning

    Thanx

  36. Sean says:

    Hi Shannon,

    Thanks for a great tool. It works a treat!
    I just have a few queries that I’m hoping you can assist with. Firstly we are deploying our XenApp servers with PVS using standard image mode with cache on the client’s HDD.
    We wanted to move the LHC to the client drive (D:) to allow the IMA service to start should the Data Store be unavailable. My question regarding this is does XenAppPrep clear the LHC at boot-up? because if it does there is no benefit in moving the LHC.
    The other query I have is more of a feature request than anything else. When a XenApp server communicates with the license server it creates a license cache file that gives it 30 days grace, however on with PVS in standard mode this license file is lost at reboot, which means that if a XenApp server comes up and the license server is not available users cannot log in. Is it possible to modify XenAppPrep to copy the cache file to a local client drive and copy it back to the boot drive if required?
    Again: thanks for the tool, it is really useful.

    Regards,
    Sean

    • shannonma says:

      Hi Sean,

      XenAppPrep clears the LHC when its run from command-line. I no longer work for Citrix, however if you’d like to get these filed as feature requests I’d recommend contacting Citrix support. They can get your request routed to the right team. Sorry I couldn’t be of more help.

      Shannon

  37. Pingback: Cloning a XenApp Server with XenAppPrep « My Work Blog

  38. Pingback: Cloning a XenApp Server with XenAppPrep | Digipulse.nl @ | Citrix

  39. Andy Gawronski says:

    After running XenAppPrep/Sysprep and creating the new clone I am having problems with streaming any applications with the offline plug-in (5.2). I am trying to stream the applications to my XenApp server. I keep getting the error “failed to get sandbox ID” and the app never launches.

    I noticed in the RadeOffline.dsn file that it clears the “WSID=[ServerName]” line but leaves the “WSID=” without a server name. Not sure if that matters or not. Didn’t seem to make a difference with me playing with that line.

    If I uninstall/reinstall the Offline plug-in on the clone everything seems to work again.

  40. Andy Gawronski says:

    In addition to above.

    I found the problem to be with the registry settings located in HKLM\SOFTWARE\Citrix\Rade\signature. When I reinstalled the offline plug-in it recreated all the values in that key. If I manually change the values back to the way they were, I get the same error “failed to get sandbox ID”. I do not know how these values are being assigned but, at least I know what the problem is. This will definitely need to be added to the XenAppPrep methods!

  41. shannonma says:

    Thanks for reporting that problem Andy. Unfortunately, I’m no longer with Citrix. The best way to get that issue fixed would be to contact Citrix technical support and have them open a case. Hope this helps!

  42. Peter says:

    Hello Shannon, we originally had 3 PS 4 servers and then one failed. I want to make a clone of one of the remaining PS 4 servers by cloning it using your tool. Both servers are members of a domain. Before running your tool and cloning the server, should I disjoin it from the domain? Will this action affect its current presence/status in the farm?

    Thanks very much.

  43. shannonma says:

    Hi Peter,

    I can answer your question, however I do have to say that I’m no longer with Citrix and recommend contacting their technical support team for assistance with XenAppPrep.

    With that said, all you need to do is run XenAppPrep immediately followed by sysprep. Sysprep will take care of all the Windows stuff for you.

  44. Pingback: Cloning ma | Sellwaste

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 )

Connecting to %s

Follow

Get every new post delivered to your Inbox.