Building the Ultimate vSphere Lab: Part 4 – Base Template
Now it’s time to start building our Virtual Infrastructure services. This will consist of a bunch of VMs hosting Active Directory, SQL Server, vCenter, … So we’re talking about 3 to 5 VMs here.
We will use Windows 2008 R2 as the base OS for these VMs. We will be using Linked Clones technology of VMware Workstation to put those VMs in the smallest space possible.
To make it a short story, we’ll install one ‘Base VM’ with Windows 2008 R2 including all the patches/service packs. Then, we will create a linked clone for each of our VMs. This linked clone contains only the differences between the Base VM and the linked clone. In most cases, this is less than 5 GB per VM.
So let’s start for the Base VM. Click Create a New Virtual Machine to create your first VM.
Pick Custom (advanced).
The Hardware Compatibility must be Workstation 8.0 (default).
Select I will install the operation system later.
Pick Windows Server 2008 R2 x64 as the OS Type.
Name it Windows2008R2_Base and store it under the VM folder on your SSD drive. DO NOT STORE IT ON YOUR HDD!!! This Base VM will get A LOT of Read IO. If you put it on your HDD, smoke will probably arise from it
Since my SSD is the C: drive, I store it under C:\VM
One CPU/Core will be sufficient.
Memory size of 1024 MB.
Set the Network Type to Do not use a network connection.
LSI Logic SAS Controller.
Create a new virtual disk.
Type is SCSI.
Select Store virtual disk as a single file. These days everybody uses NTFS on Windows 7 so there are no issues with big files.
40 GB disk size is fine. They are thin provisioned (since we do not select the Allocate all disk space now) so only used space will be allocated.
Accept the default Disk File.
Click Finish to create the VM.
It will appear in your VMware Workstation console now.
Edit the virtual machine settings.
First, remove the Floppy, USB Controller, Sound Card & Printer devices. We won’t need them and they only consume unnecessary resources.
Next, click the Add button and add a Network Adapter.
Select Custom – VMnet0 as the network connection. This will give the VM internet access.
Click the CD-DVD (IDE) drive and attach the Windows 2008 R2 ISO file to it. This ISO file is best stored on the HDD as you need it only once.
Click Power on this virtual machine.
If you get a warning about your Memory Configuration, just tick Do not show this message again and continue.
The VM will boot from DVD and the installation of Windows begins. Pick the correct regional settings and install it.
Every Full Installation edition of Windows besides Web Server will do. Since i will run a trial edition, i use the Datacenter edition… Not that we will be using any of those features, but it just shows up nice
Pick a Custom Installation and install it on the 40 GB drive. Now is a good time to look at the files in the VM directory on your desktop. The VMDK file which actually contains all the data will grow now as data is been copied from the ISO to the VM.
After installation, about 7 GB will be consumed. Nice.
Back to the VM, change the password to something strong (capital letters + small letters + number). We will reuse this password for all accounts. After all it’s only a lab so no sensitive information will be found, but we need to have a password since blanks are not accepted.
Your mousepointer will be choppy, so let’s solve that first.
First, we start by installing VMware Tools on it (VM – Install VMware Tools…).
An AutoPlay popup will appear in the VM. Click Run setup64.exe and perform a Typical Installation. Reboot the VM.
Performance of the VM is okay now, as well as the graphics performance.
Before updating the VM, we will install .NET Framework first. Open Server Manager and click the Features item. Click the Add Features link.
Select the .NET Framework 3.5.1 Features item.
Some additional roles need to be installed. Do so by clicking Add Required Role Services.
Click Next, Next, … Install to install it.
Next, we will turn on Windows Update to bring the VM up-to-date. You can go ahead and install all the updates, but it’s easier to apply the latest service pack first. Download it from the Microsoft website and then apply all Windows Updates patches afterwards.
TIP: Disable IE ESC in Server Manager. Makes surfing a bit easier on the VM.
Now that our system is up-to-date, it’s time to clean it up. When looking at the VMDK file size, we have grown to 17 GB already! Yikes!
We’ll start by removing the SP1 installation files. In a command prompt, run dism /online /cleanup-image /spsuperseded.
After that, we are going to remove all Windows Update backup files. Stop the Windows Update service and delete the C:\Windows\SoftwareDistribution folder.
After deletion, Start the Windows Update service.
Next up the hibernation file: open a command prompt as Administrator. Type powercfg.exe /hibernate off
After all these step, the VM is consuming less than 10 GB.
Open up VMware Tools, go to the Shrink tab. Click the Prepare to shrink button.
It’ll take some time…
After it has completed, look at the VMDK file size:
9 GB! That’s more like it!
Now the VM is ready to be used as a Template. Run c:\windows\system32\sysprep in the VM.
Select the OOBE option and check Generalize. Select Shutdown and click OK.
The VM will shutdown automatically and is ready to be templatized (i just invented a new word
).
That’s it for now! On the next episode we will start deploying our first VM which will be the Domain Controller.
Building the Ultimate vSphere Lab – Part 1: The Story
Building the Ultimate vSphere Lab – Part 2: The Hardware
Building the Ultimate vSphere Lab – Part 3: VMware Workstation 8
Building the Ultimate vSphere Lab – Part 4: Base Template
Building the Ultimate vSphere Lab – Part 5: Prepare the Template
Building the Ultimate vSphere Lab – Part 6: Domain Controller
Building the Ultimate vSphere Lab – Part 7: SQL Server
Building the Ultimate vSphere Lab – Part 8: vCenter
Building the Ultimate vSphere Lab – Part 9: ESXi
Building the Ultimate vSphere Lab – Part 10: Storage
Building the Ultimate vSphere Lab – Part 11: vMotion & Fault Tolerance
Building the Ultimate vSphere Lab – Part 12: Finalizing the Lab
at what point would it make sense to switch it EFI BIOS type?
Officially (and recommended), do it before you install your virtual ESXi hosts.
But as i described in my blogpost regarding EFI (http://boerlowie.wordpress.com/2011/12/22/install-vsphere-in-vmware-workstation-using-efi-instead-of-a-bios/) it works as well if you change it afterwards.
So bottomline: it doesn’t matter
Hi Sammy,
Great article! I just have one comment to add, the Intel i5 does have a true quad core model (non-ht) and is a lower cost option than the i7. I myself have an AMD FX 8 core CPU and is perfect for my home lab, only problem is finding 8gb dimms although these are becoming more affordable now.
Thanks again for the great post!
cheers,
Ben
Wow, really great article!!!
Only one suggestion: when you Power On for the first time the VM instead just Power On the VM, Power On To Bios and in the Main screen set “Legacy Diskette A” Disabled and in the Advanced–>I/O Device Configuration set all voices to Disabled.
This is what I do everytime I create a new VM, in this way I have all the unused hardware disabled.
Again, really great guide!!!!!
Thanks for the suggestion! I’ll try to update the post ASAP with this valuable info!
A great effort indeed, that doesn’t need my testimony
However i have a comment to add that other may found helpful; we have to enable the VMCI option ( VM setting >> under the option tab >> guest isolation >> check the VMCI which is the VM communication interfce ), cause i was trying to install windows 2008 by booting from the CD, but the VM never detect the CD drive and then try to PXE boot, which drive me crazy until i enable this feature when i was clicking around
,
Again thanks a lot Sir,
Great tutorial Sammy! It was exactly what I was looking for.