I am currently working on a project base on the Mobile Line of Business Accelerator. Essentially you can take the LOB Accelerator and modify it for your own needs. One thing I don't have while I am on the road is Rob Tiffany's mobile data center. However that is not a problem as long as I don't want to handle 7 million rows an hour.
I decide to build out a similar environment using virtual machines and Virtual PC 2007. My first attempt was a good start but ended in
Were did I go wrong. I called in the calvary in the form of infrastructure guru David Bottomley. Within 1 minute of asking for help he had sent back an email telling me exactly where I had gone wrong.
One of the nice things about VMs if you can have multiple machines at least simulated. They can also take up huge amount of spaces since they use files to simulate disks. In order to cut down on this you can create difference disks. These are basically files containing deltas between the newest state and the original state. So I had used this concept to build a base OS image. Once I had a base W2k3 R2 I then created new VMs using the base image as the parent disk for a difference disk. So far so good. The problem cropped up when I added the computers to a domain. It turns out that every computer gets something called a Security identifier or SID. All of my VMs had the same SID which AD rightfully thought was a security violation. David Bottomley shared his wisdom and I started over.
Step 1 - Build the Base Image
So the first thing was you do is build a base image in this case I used Windows 2003 Standard R2. From the Virtual PC console hit New which launches the New Virtual Machine Wizard.
Clicking next takes you to selecting the options for guiding you through the wizard.
I used the first option this time. The other VMs will use the second option as the first option builds a empty disk file.
Notice that I have specified a drive. One thing I do is put my VMs on USB drives. This save storage space and gives the computer another disk spindle. When running several VMs having the separate drive helps with performance.
The next step is used to tell it what OS you are going to install on the VM. The wizard then sets up some starting values.
256mb for memory is enough for setting up the base image so I kept the default value.
The next step is what disk file to use an existing one or a new one. I chose a new one.
The simulated disk only needs to be 24gbs.
The last step before the VM is created is to show what it would create. Clicking Finish created the settings and disk file. From the console I started the VM and clicked on the CD menu item. This allows you to let the VM either use an ISO image or the physical drive. I set the CD to the MSDN ISO image for Windows 2003 R2 Standard and installed it. Next I went to windows update to install all the latest patches. Remember to keep visiting the update site until there are no more updates.
In addition to the base OS image I also installed IIS. A lot of the other servers will require IIS so it might as well be in the base image. If a VM doesn't need it simply remove it from that VM.
The last two things on David's advice was to get backinfo and newsid. I setup Backinfo to run on startup so it can create a new background image. This image contains the name of the computer, IP address and even domain or workgroup. It is part of the Windows Server System Reference Architecture Virtual Environments for Development and Test Deployment Kit and once you have installed WSSRA-VE it is in the \bld\utils directory.Very darn useful to know at a glance what VM you are working with. It is in the Newsid does exactly what its name implies creates a new SID. I put Newsid in a temp directory so once I am done with it in a new VM it can be deleted.
Finally I was ready to handle to last items. I activated my MSDN copy of W2k3 R2 before shutting down the base image VM. The very last thing once the VM was shutdown was to make the VHD file as ReadOnly. Bad things happen if the parent file changes once difference disk files have been created. When setting the read only flag you can see the file is almost 3gigs. Imaging have several VMs and your drive would fill-up fast without using difference disks.
Step 2 - Build AD Server
Now it was time to build my first VM based on the base image from step 1, an AD server. I launched the wizard again only this time I selected option 2. In this case you are only prompted for a VM name (ADServer) and location for the settings file. When you click finish by default it displays the settings window.
From here by selecting the Virtual Disk Wizard you can create a difference disk. So the first step is to select Hard Disk 1 and click the Virtual Disk Wizard.
The first step is to tell the wizard you want to create a new virtual drive. You can also edit a virtual drive.
Then comes telling the wizard you want to create a hard drive. You can also build a floppy drive file.
The next step is to tell it the name of the virtual disk file and its location. I again selected putting it on the same USB drive as my base image.
This next step is where you tell it you want to have the disk be a Differencing disk. This will basically have the wizard create a file filled with deltas of changes between the differencing file and the base image created in step 1.
Finally you specify the base image as the parent disk file before finishing with the wizard.
The last step before starting the ADServer VM is in the settings file to point Hard Drive 1 to the differencing disk file the wizard created. You can now start the VM and log in.
Once logged in run the newsid program which launches the New SID wizard. The first step is to accept or decline the license.
Once past the license screen the wizard is actually started.
The next step is to select how you want to change the SID. You can have the system generate a random SID, clone the SID from an existing W2K3 computer, or type out a SID. Since we want a new SID just leave it on Random. When you click Next a SID is generated.
Next comes a time saving feature, the ability to rename the computer at the same time as changing the SID. So check rename and type the new name, ADServer.
The last step just shows the old SID, new SID and new name before committing to the changes by clicking finish.
At this point you have a good VM after rebooting. After logging in you need to do a couple of more things
- Setup fixed IP address for the server
- Then use the Manage Server to remove the Application Server role and add the Domain Controller role
At this point you should now have a functioning AD VM. If you look at the space used it is around 4gig saving about 2gigs by using a differencing disk.
Step 3 - Build SQL Server
Now you build a SQL Server using the same steps from step 2 but use different names for the disk and machine for example SQL Server. You will then add the machine to your domain and install SQL Server.
Step 4 - Publisher
At this point depending on the amount of memory and processor you have you can either create a publishing server or just install the replication client on your SQL Server VM.
If everything is correct you should be able to use the VMs to sync between SQL Server and SQL Server CE on a Windows Mobile device.
Comments