This was a persuasion piece I wrote for work on how to quicker deployments and restores in the training lab. It seems we had employees several times a week who had hours of their time taken up by reloading PCs in the training rooms or in the testing labs. I wrote up this piece which is unfortunately light on detail (if you have questions post them here I’ll answer them) for management to look at what we could do to script this solution out. Because of work security requirements, I did make some modifications to the information listed here, I kept the changes to a minimum though. I actually will be doing a follow-up to this article which will contain the reload scripts and technical nitty gritty. My idea has been at least going so far as to be tested (I have a VMware workstation on my work PC now).
Introduction
There are many good reasons for virtualizing your environment. The two major reasons for this undertaking for this are to save money on cost or to save time on deployment operations. Since most training labs will still require a computer for each student to learn on, our focus in moving to a virtualized architecture would be to save time for each setup and deployment.
Configuring the Images
The IT department will supply images for their current supported loads to the training environment. This virtual image will be created by VMware Workstation. Since each machine has to be unique to the machine it is running and joined to the domain, the image will have to go through a one-time Sysprep for the machine it is to be loaded on. From the standpoint of any technician maintaining this environment, the initial setup of the virtual machine would be the same as setting up any other machine in the environment.
- Each virtual machine though built from a standard base image must be unique to the machine it is installed on
- Each virtual machine’s computer name will be the ComputerName+v+OS version so the name would be ComputernameVXP for a standard XP domain image. The tag number for the vista machine would be ComputernameVVIS for Vista. A similar naming convention will be used on each machine and for each operating system installed as a virtual machine.
This deployment is starting with Windows-based operating systems but can be expanded to support any operating system that is able to be virtualized.
Preparing the Host PC
The computer the virtual machine is installed on is considered the host machine. This terminology is used to reflect that it is hosting the virtual machine. This machine will be loaded with the standard supported operating system in the environment (Windows XP at the time of this writing) that is locked down. Via computer and group policy the only options the students should be able to perform within the host’s local PC environment is the ability to log off the host computer and click the desktop icon to run the virtual machine.
In the root directory we will create a new directory called c:\images underneath here there will be two directories, c:\images\run, and c:\images\archive. In the run directory will be the current live image on the system, and the backup and “clean” image will be stored in the archive directory. On each machine, the c:\images directory will be shared allowing only access to domain administrators, the helpdesk, and the teacher’s computer.
When these steps have been accomplished a technician will copy an image from the reference share created on the network and copy it to the c:\images\archive directory. The image MUST be set to be read-only. The technician will install VMware Player on the host machine. After VMware Player is installed associate the .vmdk image file in the reference directory with VMware player. Load up the image you want to adjust (the one you pulled down from the reference share and start it in VMware player.
The image will load up ready for patches and the overlay script. Deploying it unique to each machine in this state will ensure it will have the latest overlay and settings that are required at the time this is being deployed on the host machine. Follow the naming conventions for virtual machines and join the virtual machine to the domain.
When new virtual machines are being deployed inform the architecture team so they can be joined into the appropriate domain group for training computers. This goes for the host as well as the virtual machines. Since there need to be special policies applied to the host, this step is very important.
When this step has been completed configuration of the host machine should be complete. There will be no need to monitor normal day-to-day activity or reload the machine since this will all be handled through the virtual machine.
Setting up the Teachers/Management Station
The teacher’s computer will have a VMware player installed with the same images as the users. The host operating system however will not be locked down as far as the student’s host machines. On the teaching station, the installation technician will create a c:\scripts directory which will include the maintenance scripts for the local training environment. While there will be reference scripts available on the same share from the reference image can be pulled from, these scripts will have to be modified to include all the student machines in the local training area. For the scripts to complete successfully all the student computers that are going to be in use must be turned on.
The first script will copy the image the teacher wants to train in the environment from the c:\images\archive directory to the run directory. This is designed for easy maintenance and clean-ups of the machines. Since the students will only be working on images in the run directory we can still have a backup that is “clean”. This script will also copy a shortcut to launch the machine onto the student’s computer local desktop. Optionally the script could copy this shortcut into the student’s “start-up” folder so the virtual machine is auto-loaded when the student logs into their host computer.
The second script created will be the cleanup script. This script will go out to each client computer that was used and delete the image in the run directory and copy the new default image from the archive directory and place it in the run directory. This is to make sure that if the teacher doesn’t run the first script the client PCs have the default image available to them at startup. This script will not change the shortcuts on the user’s desktop.
If the trainer uses software that is outside of the scope of a normal load, images that utilize different software configurations can be saved. For the trainer to do this they can contact local IT support to have this completed. To create new images activate the script that puts a new machine in the run directory of the client computer. At this point the following steps must be taken:
- Open up the image that is located on each client-run directory
- Install the software that is special to this configuration
- Shut down the image and exit it out of VMware Player
- Rename the image so it denotes what is special about it
- Copy the image to the archive directory
- Contact IT support to modify the maintenance scripts
The original base image for the student host machine has been set to read-only this should help prevent the original base image from being accidentally overwritten.
Maintenance
On the last Friday of the month, the base image of each machine must be refreshed. This is to limit the amount of time it takes to patch the image each time it is run after being reset. Here is what that entails:
- Set the attribute of the base image so it’s no longer read-only
- Open up the base image and let it startup
- Log in to the virtual machine
- Open up the run option from the start menu and type “wuauclt /detectnow”
- Wait a few minutes to make sure all the windows update patches are pulled down – it is recommended you start the next virtual machine before moving to the next step
- At this point allow the virtual machine to reboot
- Wait for the machine to reboot to make sure it starts up without any errors.
- Log in to the virtual and makes sure it loads correctly
- Shut down the virtual machine.
- Reset the base image to be read-only