Automating Server Installation and Upgrade |
Disk duplication is a good choice if you need to install an identical configuration on multiple computers. On a master computer, you install Windows 2000 and any applications that you want installed on all of the target computers. Then you run Sysprep and a third-party disk imaging utility. Sysprep prepares the hard disk on the master computer so that the disk imaging utility can transfer an image of the hard disk to the other computers. This method decreases deployment time dramatically compared to standard or scripted installations.
To use Sysprep, your master and target computers must have identical HALs, Advanced Configuration and Power Interface (ACPI) support, and mass storage device controllers. Windows 2000 automatically detects Plug and Play devices, and Sysprep redetects and re-enumerates the devices on the system when the computer is turned on after Sysprep has run. This means that Plug and Play devices, such as network adapters, modems, video adapters, and sound cards, do not have to be the same on the master and target computers. The major advantage of Sysprep installation is speed. The image can be packaged and compressed and only the files required for the specific configuration are created as part of the image. Additional Plug and Play drivers that you might need on other systems are also created. The image can also be copied to a CD and distributed to remote sites that have slow links.
Note
Because the master and target computers are required to have identical HALs, ACPI support, and mass storage device controllers, you might need to maintain multiple images for your environment.
Sysprep allows you to configure a master image containing the necessary components for a member server, then later configure the server and optionally promote it to a domain controller. This can be done manually or by running the commands in the [GuiRunOnce] section of Sysprep.inf. For more information about Sysprep.inf, see "Using Sysprep to Duplicate Disks" later in this chapter.
Important
When performing disk duplication, check with your software vendor to make certain you are not violating the licensing agreement for installation of the software you want to duplicate.
This section describes the process of building a source computer to use for disk duplication.
Important
Components that depend on Active Directory cannot be duplicated.
To use Sysprep, run Sysprep.exe manually or configure Setup to run Sysprep.exe automatically by using the [GuiRunOnce] section of the answer file. To run Sysprep, the files Sysprep.exe and Setupcl.exe must be located in a Sysprep folder at the root of the system drive (
These files prepare the operating system for duplication and start the Mini-Setup Wizard. You can also include an optional answer file, Sysprep.inf, in the Sysprep folder. Sysprep.inf contains default parameters that you can use to provide consistent responses where they are appropriate. This limits the requirement for user input, thereby reducing potential user errors. You can also place the Sysprep.inf file on a floppy disk to be placed in the floppy disk drive after the Windows startup screen appears, in order to allow further customization at the target computer's location. The floppy disk drive is read when the "Please Wait" Mini-Setup Wizard screen appears. When the Mini-Setup Wizard has successfully completed its tasks, the system restarts one last time, the Sysprep folder and all of its contents are deleted, and the system is ready for the user to log on.
Sysprep.exe has three optional parameters:
Sysprep.inf is an answer file that is used to automate the Mini-Setup process. It uses the same .ini file syntax and key names (for supported keys) as the Setup answer file. You need to place the Sysprep.inf file in the
Note
If you provided a Sysprep.inf file on the master computer and you want to change the Sysprep.inf on a per-computer basis, you can use the floppy disk method previously discussed.
Following is a sample of a Sysprep.inf file:
[Unattended]
;Prompt the user to accept the EULA.
OemSkipEula=No
;Use Sysprep's default and regenerate the page file for the system
;to accommodate potential differences in available RAM.
KeepPageFile=0
;Provide the location for additional language support files that
;might be needed in a global organization.
InstallFilesPath=
[GuiUnattended]
;Specify a non-null administrator password.
;Any password supplied here will only take effect if the original source
;for the image (master computer) specified a non-null password.
;Otherwise, the password used on the master computer will be
;the password used on this computer. This can only be changed by
;logging on as Local Administrator and manually changing the password.
AdminPassword=""
;Set the time zone
TimeZone=20
;Skip the Welcome screen when the system boots.
OemSkipWelcome=1
;Do not skip the regional options dialog box so that the user can
;indicate which regional options apply to them.
OemSkipRegional=0
[UserData]
;Prepopulate user information for the system.
FullName="Authorized User"
OrgName="Organization Name"
ComputerName=XYZ_Computer1
[GUIRunOnce]
;Promote this computer to a Domain Controller on reboot.
DCPromo/answer:<location of dc promo answer file>
[Identification]
;Join the computer to the domain ITDOMAIN
JoinDomain=ITDOMAIN
[Networking]
;Bind the default protocols and services to the network card(s) used
;in this computer.
InstallDefaultComponents=Yes
Note
You can change the administrative password using Sysprep.inf only if the existing administrative password is null. This is also true if you want to change the administrator password through the Sysprep GUI.
For more information about the answer file sections and commands used with Sysprep.inf, see the Appendix "Sample Answer Files for Unattended Setup" in this book.
Setupcl.exe does the following:
The Mini-Setup Wizard starts the first time that a computer starts from a disk that has been duplicated by the Sysprep method. The wizard gathers any information that is needed to further customize the target computer. If you do not use Sysprep.inf, or if you leave some sections of the file blank, the Mini-Setup Wizard displays screens for which no answer was provided in Sysprep.inf. The possible screens include:
If you want to bypass these screens, you can specify certain parameters within Sysprep.inf. These parameters are listed in Table 13.6.
Note
Because Setup detects optimal settings for display devices, you will no longer see the "Display Settings" screen when Setup or the Mini-Setup Wizard is running. You can specify [Display] settings either in the answer file used for your master computer or in the Sysprep.inf file used for your target computer. If [Display] settings are in the answer file that is used for your master computer, Sysprep will retain those settings unless Sysprep.inf contains different settings, or unless a video adapter or monitor requiring settings different from those of the master computer is detected.
Table 13.6 Parameters in Sysprep.inf for Bypassing the Mini-Setup Wizard
Parameter | Value |
---|---|
Regional options | [RegionalSettings] section
[GuiUnattended] OemSkipRegional=1 |
User name and company | [UserData]
FullName="User Name" OrgName="Organization Name" |
Computer name and administrator password | [UserData]
ComputerName=W2B32054 [GuiUnattended] AdminPassword="" |
Network settings | [Networking]
InstallDefaultComponents=Yes |
TAPI settings | [TapiLocation]
AreaCode=425 |
Time zone selection | [GuiUnattended]
TimeZone=<desired time zone index> |
Finish/Restart | NA |
After you install Windows 2000 Server, you can use Sysprep to prepare the system for transfer to other similarly configured computers. To run Sysprep manually, you must first install Windows 2000 Server, configure the system, and install the applications. Then run Sysprep without the –reboot command-line switch. After the system shuts down, duplicate the image of the drive to the similarly configured computers.
When users start up their duplicated computers for the first time, Sysprep Mini-Setup will run, allowing the users to customize their systems. You can also preassign all or part of the Sysprep configuration parameters by using Sysprep.inf. The Sysprep folder (which contains Sysprep.exe and Setupcl.exe) is automatically deleted after Sysprep Mini-Setup completes.
To prepare a Windows 2000 Server installation for duplication
cmd
md sysprep
If you are using Sysprep.inf, also copy this file to the Sysprep folder. Note that Sysprep.exe, Setupcl.exe, and Sysprep.inf must exist in the same folder so that Sysprep can function properly.
cd sysprep
Sysprep
Sysprep –reboot
Sysprep /<optional parameter>
Sysprep /<optional parameter> -reboot
Sysprep /<optional parameter 1>.../<optional parameter X>
Sysprep /<optional parameter 1>.../<optional parameter X> -reboot
When a message appears telling you to shut down the computer, on the Start menu, click Shut Down. You are now ready to use a third-party disk-imaging utility to create an image of the installation.
Note
You can add a Cmdlines.txt file to the Sysprep folder, to be processed by Setup. This file will run post-Setup commands, including those required for application installation.
The [GuiRunOnce] section of the answer file contains commands to be executed after Setup completes. You can use the [GuiRunOnce] section to create an installation that completes Setup, automatically logs on to the computer, runs Sysprep in –quiet mode, and then shuts down the computer. For this to occur, you need to do the following:
Windows 2000 GUI Setup and Mini-Setup can be used to extend NTFS partitions through answer files. This new functionality does the following:
To determine the best way to integrate this functionality in your environment, you need to review the steps that follow and choose the method that will work best for you based on the tools that you are using to image the operating system.
Caution
If your imaging tools allow you to edit the image, you can delete the Pagefile.sys, Setupapi.log, and the Hyberfil.sys (if applicable) because these files will be recreated when the Mini-Setup Wizard runs on the target computer. You must not delete these files on an active system because this can cause the system to function improperly. These files should only be deleted, if desired, from the image.
To extend a hard disk partition when using a third-party imaging product or a hardware imaging device that supports NTFS used by Windows 2000
Note
ConvertNTFS does not work in Sysprep.inf because this is a text mode–only function and Sysprep does not go through text mode.
ExtendOemPartition = 1
(or additional size, in megabytes, to extend the partition)
The Mini-Setup Wizard starts and the partition is extended almost instantaneously.
To extend a hard disk partition when using an imaging product that does not support NTFS used by Windows 2000
[GuiRunOnce]
<Command1> = "<command line>"
<Command2> = "<command line>"
...
<Commandn-1> = "Convert c:\ /fs:ntfs"
<Commandn> = "
where:
Note
You cannot include ExtendOemPartition in the master answer file for this step because the partition on which the image is generated is not NTFS. You also might want to keep the image as small as possible.
ExtendOemPartition = 1
(or additional size, in megabytes, to extend the partition)
Important
Do not restart the computer.
The computer will initially begin in conversion mode to convert the system partition on the target computer to NTFS.
The computer will automatically restart.
The Mini-Setup Wizard begins, and the partition is extended almost instantaneously.