Clone a XenApp 6.5 server on VmWare


We are setting up a new XenApp 6.5 farm. The farm is already setup, we added a second server to the farm for use as a template. Everything is running on Vmware.

First we prep the Xenapp server for imaging using the xenapp server role manager.
We then shut down the VM and convert it to a template.
The last step is to deploy a VM from the just created template using the customization wizard.
We fill in a new host name, ip address, join to the domain, ...

Problem now is that when we look at the farm there are 2 new servers added. One with a custom hostname (created by sysprep) and one with the name we specified.

Is there anyway we can work arround this problem? I also tried performing the sysprep in the OS itself but then i can't use the customization wizard. I just deployed the vm from my template without customization which results that the server is automatically joined to the farm with a bad hostname. At this moment the server is also still not joined to the domain.

Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Mino DCCommented:
if the OS load the sysprep works, you can use it from the customization wizard, typing this command in the screen where it asks you what commands to run at startup (in RunOnce):

 sysprep.exe / generalize / oobe
Carl WebsterCitrix Technology Professional - FellowCommented:
Mino DCCommented:

sysprep.exe /generalize /oobe
The 7 Worst Nightmares of a Sysadmin

Fear not! To defend your business’ IT systems we’re going to shine a light on the seven most sinister terrors that haunt sysadmins. That way you can be sure there’s nothing in your stack waiting to go bump in the night.

FlipTripAuthor Commented:
Yep. Its approach 3 we want.


Problem is that when the image is prepped and we deploy a VM from the image 2 processes will run when the VM is started:
1 Sysprep and 2 XenApp will join the server back to the farm. Problem is that the server should be joined to the farm when sysprep is finished, the server has the correct hostname and is joined to the domain.
We want all these steps to be automated so that litte user interaction is needed.
Carl WebsterCitrix Technology Professional - FellowCommented:
Just a thought here since I don't use sysprep, I use PVS.

1.  Create a batch file that sets all the Citrix services that are currently set to Automatic to disabled
2.  Run that batch file right before you run sysprep
3.  Create a batch file that resets those services back to automatic
4.  Put that batch file in a separate GPO in a computer startup script
5.  After sysprep runs, joins the server to the domain and restarts, the script will run and set the services to automatic
6.  IMA will now start and the server should join the farm with the newly created server name

On every server restart after that, the services will already be set to automatic and the batch file will do nothing.  In the Citrix 2008 R2 optimization guide, they suggest setting the startup time for services to 10 minutes.  That should give the Citrix services plenty of time to start.  In XenApp 5, I have seen MFCOM and IMA take almost 10 minutes to do their thing.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Mino DCCommented:
Can you try to insert a .bat file (in C for example) with this content:

net stop (citrix service)
net stop (citrix service)
net stop (citrix service)
sysprep /generalize /oobe

and insert c:\name.bat in the screen where it asks you what commands to run at startup.

Or you can select VMware sysprep, and add net stop command in the screen where it asks you what commands to run at startup.
FlipTripAuthor Commented:
That's it.
1. I prepared the XenApp server for imaging with the Xenapp Server role manager.
2. Disabled IMAService, CitrixHealthMon, CtxHttp and CitrixXTEServer services.
3. Shutdown my Xenapp server
4. Convert the VM to template
5. Deploy a VM from the template with customization (generate new sid, new hostname, join domain, ...)
6. Created a GPO with a script to set the service back to auto and start them.

Thx for the help!
can you please give an example of the runOnce Script. I disabled IMA Service.
Now i am not sure where to create the RunOnce Script or what to put in the script

We have Server 2008 R2 (i.e x64)
where to create the RunOnce key??


Or what GPO settings
FlipTripAuthor Commented:
You can also use the preferences in gpo to re-enable the services instead of a script. Also, create your computer account in advance and put it in the right OU.

It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.