This is a bit of an obscure one admittedly, after all, not everyone runs Citrix under ESX virtual machine. Indeed, the very idea is a quite hotly contended issue on the forum. Leaving that aside, if you do decide to create a template (either in ESX or vCenter) there are issues with Citrix remap drive's utility and the use of Microsoft Sysprep.
The remap drive feature in Citrix changes the servers drive letters from C: D: E: to (by default) M: N: O: (although this is configurable). The reason for doing so is to allow clients to connect to Citrix and see their “client” drives as C: D: E:
As it is impossible to have two C: drives (one on the server and one on the client at the same time) we generally remap drives within Citrix to allow this to happen. Their C: drive appears in the Citrix session and on their workstation using the same drive letter of C:
Cloning a server with remapped drives is not recommend by Citrix, either with ghost or by using the file copy process which we use within a Virtualized environment. Most drive-cloning software is not sophisticated enough to retain the logical letters assigned within Windows. Microsoft’s Sysprep does whizzy things with registry. Such that both methods used together commonly reset the drive letters from M: N: O: to C: D: E:
The initial result of this is quite catastrophic. You cannot login. Citrix cannot find its login file ctxgina.dll on the M: drive, because it is now located on the C: drive. It’s
However, using a “VM Helper” (as you would in P2V) you can hack into the registry and correct the error in HKEY_LOCAL_MACHINE\System\MountedDevices. This procedure is outlined in my P2V Guide, as the first time I experienced it was with P2V software such as VMware's and LeoStream's.
However, in my experience the results of this registry “hacking” have not always been entirely successful. I’ve had bizarre and often unexplainable/unresolvable results.
Well, that was a long preamble to the problem. The good news is I found a method of preparing a template that preserves the drive letter mappings in Citrix MetaFrame/Presentation Server. The “trick” is to not use Microsoft Sysprep and use a 3rd Party SID changer – I used WinInternals/SysInternals NEWSID – but perhaps the same would work with Symantec Ghost “GhostWalker” feature.
Here’s an overview of how it's done, the instructions here do assume that you are Citrix savvy¦ if you are not, pass this on to an admin who is:
- Build Citrix Template
- Stop IMAservice and set to manual
- Remove Resource Manager database files
- Remove clone from farm
- Remove clone from Domain and put into a Workgroup
- Copy System Internal’s NEW-SID to the M: Drive
- Export to Template Repository (either ESX/vmimages or vCenter)
- Import Virtual Disk
- Reset IP/Name
- Run NewSID and Reboot
- Add to Domain
- Start IMAservice and Set to be Automatic in the Services Applet
- Push out software updates/upgrades to the new Citrix Server using Installation Manager/Package Group/Server Groups as required
- Note: Confirm with queryhr (a utility on the Citrix Server CD\Support\debug\ folder) that the Host ID (Citrix equivalent of the SID) is unique.
This was first published in June 2005