Getting a Citrix MetaFrame server tweaked, primed, and ready for production can be both frustrating and time-consuming. Think about the process: Install the base OS, update the base OS, install MetaFrame, install MetaFrame Service Packs and hot fixes, tweak Citrix with registry and scripts, and so on. As bad as that sounds, imagine if you had 50 servers to build for one project. You’d have to repeat this procedure nearly to the point of repetitive insanity.

Cloning or imaging a Citrix MetaFrame XP server can remedy that problem. By using cloning, all you have to do is configure one server and then let the image deploy to the rest of the servers. Here’s how to properly clone a Citrix MetaFrame XP server and get your environment up and running in half the time it would have taken you if you had imaged each server individually.

Doesn’t MetaFrame XP already do cloning?
The first thing you’re probably asking yourself is, “I thought Citrix MetaFrame XP now supported cloning; why do I need this article?” Well, Citrix claims it supports cloning with the new version of MetaFrame, but if you look closely at the steps that Citrix recommends you follow in order to clone a MetaFrame XP server, you’ll quickly notice that they are only supporting the cloning of the base OS without MetaFrame or the applications installed on it. This is basically useless, since you can’t do any tweaking or any application installs until after MetaFrame XP is properly installed.

What to do first
The first thing you need to know before cloning a MetaFrame XP server is what kind of a database server you’ll use for your farm. If you’ll be using Microsoft Access as the data store database server, then be sure not to clone the first server in the farm. The server that holds the Microsoft Access Data Store database should never be cloned. In this case, you’ll have to configure the second server in the farm and tweak that server to get it ready for cloning. If you’ll be using Microsoft SQL Server or Oracle as your data store database server, you should be fine cloning the first server in the farm.

Prime the server up
The first step is to configure the RAID controller in your server if one exists and then create your logical drive. The next step is to install the operating system and join the server to the domain. After installation, I like to bring the server to the latest Service Pack level and install all necessary security and application updates and hot fixes.

Next, move on to tweaking the Windows operating system. Some of the key tweaks you should make include:

  • Increasing the registry size.
  • Setting the server to Background services.
  • Moving the pagefile to another partition.
  • Removing Outlook Express and Internet Connection Wizard.
  • Stopping unnecessary services.

Now comes the Citrix MetaFrame XP installation. Follow the same procedure as with the operating system—after the base installation, upgrade to the latest Feature Release level for MetaFrame and add any hot fixes. Tweaking MetaFrame XP is the natural next step. Those tweaks should include:

  • Installing any necessary registry hacks.
  • Configuring any necessary script files.
  • Tweaking the ICA protocol settings.

The server is now ready to accept the installation of applications, which may need to be updated.

Before you can safely say the server is now ready to be cloned, test the server’s performance and reliability, and make sure everything is working the way it should. Be sure to check Event Viewer for any errors you may have overlooked.

It’s cloning time
Once you have determined the server is ready to be cloned, clean out the temp directories and run Delprof.exe to properly delete the locally cached user profiles on the server. In order to remove the MetaFrame XP server from the server farm, you’ll need to stop the Independent Management Architecture service. To do that, you must open Services by right-clicking on My Computer and going to Manage and then Services. Set the IMA service to Manual start and then stop the service.

Now that you’ve stopped communications between the Citrix server and the server farm, open the Citrix Management Console from another computer. Right-click on the server you’re about to clone, and click on Remove From Farm.

You now need to open the ODBC file that stores data on how to connect to the IMA data store. Remove the line in that file that identifies this server.

To do so, drop to a command line and browse to %SYSTEMROOT%\Program Files\Citrix\Independent Management Architecture. Using Notepad, open the file MetaFrame20.dsn and remove the line that reads WSID=Name of server. Then save the file.

You’ve reached the point where you need to disjoin the server from the domain. Rename the server to a generic name that will not conflict with anything else on the network. When renaming the server, try to keep the name length exactly the same. For example, if your server name is going to be ENKCTX01, you should rename it to exactly eight characters. This strategy helps when you are using Ghost to clone the servers. GhostWalker, Symantec Ghost’s SID changing utility, will not rename the server if its name doesn’t match exactly in terms of character length. Reconfigure the server to support DHCP for TCP/IP addresses instead of using static IP Address.

Before you can start cloning, you need a location to dump the image to; therefore, you’ll need network access from a DOS command prompt in order for Ghost to see the network drive and save the image to it. The solution is to use a network boot disk. If you aren’t familiar with how to create one, see “Tips for creating the perfect Windows boot disk.” Use your network boot disk to boot the server and map a drive to the network share where the image will be dumped. Next, start your imaging software. Create an image of your server, saving it to your network share. The image will start dumping and, in a little while, you’ll have an image of your server, which you can burn to CDs.

This Daily Feature explains ways for you to make changes to your server’s registry. Make sure you have complete backups of your server before performing any technique in this article. If you make a mistake when making changes to your server’s registry, you may cause your server to be unbootable, requiring a reinstallation of Windows. Proceed with extreme caution.

Deploying the image
Now that you have a good image of your server, you can deploy it to your new servers. In most cases, servers have a RAID controller, so the first step should be to configure the RAID controller and create your logical drive.

After creating the logical drive, reboot your machine using your network boot disk. Once you’re able to see your network from a DOS command prompt, map a network drive to the remote location where you saved or dumped your image.

At this point, you can run your imaging software and restore your image to this server. Once the image has been successfully deployed, you’ll need to run a SID changer utility, such as GhostWalker, to change all the instances of the SID in the registry. Some SID changers even offer you the ability to rename your server and then change the SID, a strategy I typically use.

You’re now ready to restart the server and let it boot into the operating system. As the first step, I recommend opening a command prompt and typing chkdsk /f. This will check your volume for errors the next time the server is rebooted. Make sure you select YES when prompted,

Before the server can join the farm again, and before you can even start the Independent Management Architecture service without its failing, you will need to open the registry editing tool. Modify the HKLM\Software\Citrix\IMA\Runtime\PSrequired key’s value from 0 to 1. 

Now you can start the IMA service and restore communication between this server and the farm. Open Services by right-clicking My Computer and clicking on Manage. Change the Independent Management Architecture’s Startup Type to Automatic. Don’t start the service now—most likely it will fail. If you haven’t done so already, now would be a good time to join your machine back to the domain and restart the server.

Once the server is back up, verify that the IMA service started successfully. All that’s left is to set the Feature Release Level of that server back to the correct one. This is necessary because after imaging a MetaFrame XP server, its Feature Release Level is reset to None. To accomplish this, open the CMC and set the Feature Release Level by expanding the Servers tab, right-clicking on the server, and clicking Set Feature Release Level.

Other uses for cloning
In addition to its many benefits in rapid deployment of identical servers, cloning has other great uses as well. You can use it as a backup mechanism whereby you create an image of your server every time a significant change is made to your environment. If a server should crash for any reason, reimaging that server should not be a problem. Instead of spending a few days rebuilding the server, however, you can have it back online in two hours.