Building the Ultimate vSphere Lab – Part 1: The Story

In my search of the ‘ultimate affordable’ Lab setup for VMware VCAP/VCP/… exams, i went through a lot of possible set ups.

In the end, i started to build a powerful desktop pc in which i intend to virtualize my vSphere environment.  The reasons that made me chose a desktop PC running Windows 7 with VMware Workstation 8 to do this:

– Everybody has a pc.  So why not buy a lightning fast pc which makes your daily application work at light speed (email/surfing/office tasks) and gives you a perfect lab!

– While i enjoy playing around with servers, i don’t like them at home…  they are loud, they generate heat similar to a woodstove, they consume electricity like hell and they are always in the way of things…  Plus you have to interconnect them using 5000 miles of cable.  Bottom line: me not like!

– Every VMware Admin knows the benefits of virtualization… So why not virtualize your lab?  It makes it very flexible (play with # NICs, snapshots, clones, …).

– Since quite some people are already VCP, you can finally put some good use to that VMware Workstation license you got clip_image001

– It’s very easy to suspend all your work (suspend all the VMs aka your whole vSphere environment), shutdown your pc, go to sleep/work/kids/fun and continue the day after.  No electricity wasted, no annoying noises, …

– Since a lot of vSphere features originally were introduced in VMware Workstation, it’s always nice to play around with it.

– With the coming of VMware Workstation 8, you can finally expose VT-x to the VMs, making it possible to run x86 & x64 VMs on your virtual vSphere environment.  This includes VDR, vShield, …

– Finally, it’s cheaper that a hardware setup (maybe not as powerful in terms of performance but it will only host a Lab environment so no big deal for me).

So that are my reasons to go for a virtual Lab setup.  On the next post, I’ll discuss the hardware you need for this desktop pc…

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

Building the Ultimate vSphere Lab – Part 2: The Hardware

Several factors are important to make a powerful desktop pc able to host all the VMs we will need:

CPU

You need a CPU with at least 4 cores.  It’s nice to have Hyperthreading as it will give you more logical CPUs and more vCPUs to hand out to the VMs.

Secondly, you need Virtualization Technology features enabled on the CPU.

Let’s start by looking at Intel.

Intel

Intel Core i3 systems are no use since they only have 2 cores and no VT-x support.  Update: as someone pointed out in the comments section: recent Core i3 do have VT-x support!  So if you can live with the 2 cores limit, Core i3 is a valid option!

Intel Core i5 is good if you are on a budget.  Pick a CPU with 4 cores (some i5 CPUs only have 2 cores).  You won’t have HyperThreading as that’s only available on the i7.

The Core i7 CPU systems are best suitable for our setup.  Make sure you have 4 cores(some editions only have 2).  Hyperthreading is enabled by default on Core i7 so that’s a good thing.  You need to have Intel VT-x features as well but to my knowledge, all Core i7 CPUs come with those features.

AMD

I’m not following ADM brands but basically the same things apply.  At least 4 cores, and AMD-V/RVI support.  To my knowledge, all Athlon 2, Phenom 2 and FX CPUs have those.  The newest FX series are nice looking and affordable.

Motherboard

A stable and decent motherboard is what counts here.  If you want all kinds of fancy features and bling bling, you can easily spend 500 $ on a motherboard.  As there are tons of brands and models, let me list the most important things:

– Pick a CPU Socket that matches your CPU (i know, it sound silly but it would be a shame if your expensive cpu doesn’t fit in that small socket clip_image001[1])

– Make sure you have at least 4 memory banks.

– Onboard Video is nice if you don’t play games.

That’s it besides the usual stuff (SATA, USB, ATX format, …)

Memory

You will need 16 GB at minimum!  Using 4 GB DIMMs (affordable, 8 GB DIMMs are too expensive) you will need 4 memory banks in your Motherboard.  If you have 6 banks, you can go for 24 GB easily.

Memory speed matters, but look at the price.  Amount of memory is more important than speed.  Better go for 24 GB ‘slower’ memory than 16 GB of faster memory.

Hard Disk

You need at minimum one decent SSD of 40 GB minimum.  I have an Intel X-25 SSD, but any fast SSD will do.  Buy one of the latest generations since the evolve pretty fast when it boils down to performance.  Personally, i prefer Intel.  The bigger the SSD, the more VMs you can store on SSD and the faster they will respond.  120 GB is affordable these days.

We will use VMware Workstation technologies (Linked Clones) to put multiple VMs on only 10 to 20 GB of SSD storage, so you don’t really need that much storage… but then again, the more the better isn’t it? clip_image001[2]

You will also need a big ‘traditional’ Hard Disk for other storage (ISO files, less used VMs, …).  Any SATA 3.5” HDD will do.  Look for 500 GB or more.

Others

The other components (Case, DVD, …) are not that important.  Pick whatever suits you best.

Install the system with Windows 7 64-bit (because of the high amount of memory, you will need 64-bit OS).  Linux should do as well, but i use Windows at home so I’ll focus on that one.

On the next post, we will look at the Installation of VMware Workstation and it’s configuration.

Building the Ultimate vSphere Lab – Part 3: VMware Workstation 8

Once we have our desktop installed with Windows 7 x64, it’s time to install VMware Workstation 8.

Download the latest binaries from VMware website and start the setup:

clip_image002

Pick a Typical installation.

clip_image003

The default installation location is fine as it is.

I recommend to check for product updates on each startup.

clip_image004

If you’re in a generous mood and willing to help VMware, tick the check box clip_image001[3]

clip_image005

Continue the installation finish it.

When the installation is finished, start VMware Workstation with Administrative Privileges (Right-click and select Run as administrator).

clip_image006

Click HelpEnter License Key… to unlock VMware Workstation.

Let’s start by Configuring VMware Workstation by opening EditPreferences…

clip_image007

The first option we will change is the Default location for Virtual Machines.

Create a Folder “VM” on your SSD drive and on the HDD drive.  The default location will point to the HDD drive.  This way, all VMs are placed on HDD (where we have plenty of space) and only our ‘precious’ VMs will be placed on SSD manually.

My HDD is E: and my SSD is C: (I only have 1 80GB SSD which has my OS installed as well.  This leaves me about 25 GB free for VMs on the SSD).

clip_image008

Next click the Updates item in the inventory window and click the Download All Components Now button.  This will download all VMware Tools versions.  This can be skipped but VMware Workstation will prompt you to download this on the first OS installation of each type.  As i find that quite annoying, I prefer to download them all at once in advance.

clip_image009

Next, click the Memory item.  Change the memory slider until you have a little bit more that 2 GB left for the OS. (my Windows 7 with the default things running like AV consumes 2.04 GB).  If your OS has not enough RAM available, it will start swapping and performance degrades. (putting you SWAP file on the SSD will partially boost performance but still, not an ideal solution).

clip_image010

Click OK to save the preferences.

Now it’s time to set up our Virtual Networking environment.  Open the Virtual Network Editor.

clip_image011

Basically, you have three options for a network:

– Bridged: The VM will get an IP analog to your desktop PC.  Required if the VM need internet access or access to other devices in your home network (NAS, …)

– NAT: VMware Workstation will act as a router.  Not really needed for our setup.

– Host-only: Compare this to an Internal switch on vSphere.  VMs can communicate with each other, but not to the outside world.

Some networks are created by default.

clip_image012

The default VMnet0 network will be used temporary to set up the first VMs so we’ll need that.

Next, we’ll create a new Internal network for our LAN communication (vSphere hosts, vCenter, SQL, …).  Hit the Add Network… button to create one:

clip_image013

Pick VMnet2

clip_image014

The network must be Host-OnlyDeselect the options Connect a host virtual adapter to this network and Use local DHCP service to distribute IP address to VMs.

Change the Subnet IP to 10.0.0.0 with a subnet mask of 255.0.0.0.  This will give us quite some IPs to play with.

clip_image015

We will create additional iSCSI/NFS network later on, but this will do for now.

So this will give us two Virtual Networks to use: VMnet0 (with Internet connectivity) and VMnet2 (Internal network only).

clip_image016

Click OK to save these settings.

That’s it for this post!  Next, we will start creating our Infrastructure VMs (DC, SQL, vCenter, …)

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.

clip_image017

Pick Custom (advanced).

clip_image018

The Hardware Compatibility must be Workstation 8.0 (default).

clip_image019

Select I will install the operation system later.

clip_image020

Pick Windows Server 2008 R2 x64 as the OS Type.

clip_image021

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 clip_image001[4]

Since my SSD is the C: drive, I store it under C:\VM

clip_image022

One CPU/Core will be sufficient.

clip_image023

Memory size of 1024 MB.

clip_image024

Set the Network Type to Do not use a network connection.

clip_image025

LSI Logic SAS Controller.

clip_image026

Create a new virtual disk.

clip_image027

Type is SCSI.

clip_image028

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.

clip_image029

Accept the default Disk File.

clip_image030

Click Finish to create the VM.

It will appear in your VMware Workstation console now.

clip_image031

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.

clip_image032

Next, click the Add button and add a Network Adapter.

clip_image033

Select Custom – VMnet0 as the network connection.  This will give the VM internet access.

clip_image034

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.

clip_image035

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 clip_image001[5]

clip_image036

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.

clip_image037

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.

clip_image038

Your mousepointer will be choppy, so let’s solve that first.

First, we start by installing VMware Tools on it (VM – Install VMware Tools…).

clip_image039

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.

clip_image040

Select the .NET Framework 3.5.1 Features item.

clip_image041

Some additional roles need to be installed.  Do so by clicking Add Required Role Services.

clip_image042

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.

clip_image043

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!

clip_image044

We’ll start by removing the SP1 installation files.  In a command prompt, run dism /online /cleanup-image /spsuperseded.

clip_image045

After that, we are going to remove all Windows Update backup files.  Stop the Windows Update service and delete the C:\Windows\SoftwareDistribution folder.

clip_image046

After deletion, Start the Windows Update service.

Next up the hibernation file: open a command prompt as Administrator.  Type powercfg.exe /hibernate off

clip_image047

After all these step, the VM is consuming less than 10 GB.

clip_image048

Open up VMware Tools, go to the Shrink tab.  Click the Prepare to shrink button.

clip_image049

It’ll take some time…

clip_image050

clip_image051

After it has completed, look at the VMDK file size:

clip_image052

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.

clip_image053

Select the OOBE option and check Generalize.  Select Shutdown and click OK.

clip_image054

The VM will shutdown automatically and is ready to be templatized (i just invented a new word clip_image001[6]).

clip_image055

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 5 – Prepare the Template

First, we will need to ‘protect’ our parent VM and make it a template.  This ensure we don’t delete it or power it on.  Select the Windows2008R2_Base VM and click Edit virtual machine settings.

clip_image056

Select the Options tab, go to the Advanced item and check the Enable Template mode checkbox.

clip_image057

Next up, we need to snapshot the Base VM.  All our linked clones will be based on this snapshot.

Right-click the VM and Snapshot it!

clip_image058

Give it a name like Version 1.0 and provide a good description of it.

clip_image059

That’s it!  Now we are ready to start deploying the first VMs!

Building the Ultimate vSphere Lab – Part 6: Domain Controller

The first VM we will deploy is our Domain Controller.

Right-click the Windows2008R2_Base VM and select Manage – Clone.

clip_image060

Base the clone on an Existing Snapshot named Version 1.0 (or whatever you called it before).

clip_image061

Create a Linked Clone.

clip_image062

Store it on the SSD drive and name it DC.

clip_image063

Power On the DC!

It will boot and will run through the Mini Setup.

clip_image064

Windows will ask you for Regional Settings and a Password.  It will boot afterwards.

You may notice that display performance is a bit sluggish.  Just Reinstall VMware Tools and Repair it and you’re set.

clip_image065

Okay, the first thing we will do is to put the network of this DC to the Internal we created earlier.

Edit the settings of the VM and change Network Adapter to VMnet2.  The DC is now isolated from your home network.  It can only communicate with other VMs on VMnet2 (but there aren’t any for now).

Fill in the IP4 Settings like in the screen below (mind the subnet!  It’s a /24!).

clip_image066

Next, Rename the VM to DC and reboot.

clip_image067

After the reboot, get back into the Computer Rename dialog box and press the More… button.

Fill in a valid DNS Suffix for your new domain we will create.  Mine will be named labo.local.  This means my DC will be DC.labo.local.  Reboot afterwards.

clip_image068

Next up, open Server Manager and click the Add Roles link.  Select DHCP Server & DNS Server.

clip_image069

Click Next a couple of times until you reach the IPv4 DNS Settings.  Fill in labo.local in the Parent domain field.

clip_image070

Continue clicking Next until the DHCP Scopes screen.  Click Add and add a scope ranging from 10.0.0.100 until 10.0.0.200.

Click Next until the DHCPv6 Stateless Mode and disable it.

Install the goodies!

clip_image071

Open the DNS Console and create a Forward Lookup Zone with the following settings:

Type

Primary zone

Zone name

labo.local

Create a new file …

labo.local.dns

Dynamic Updates

Allow both unsecure and secure dynamic updates

Then, create a Reverse Lookup Zone with the following settings:

Type

Primary zone

IP

IPv4 Reverse Lookup Zone

Network ID

10…

Create a new file…

10.in-addr.arpa.dns

Dynamic Updates

Allow both unsecure and secure dynamic updates

Now perform an ipconfig /registerdns (or reboot your server) and ensure it is listed in the Forward and Reverse lookup zone.

clip_image072

Now it’s time to perform a DC Promotion.  Enter the dcpromo command.  The AD binaries will be installed.  Create a new domain in a new forest.

Fill in labo.local (or your own domain name) as the forest name.

clip_image073

Set the Forest functional level to Windows Server 2008 R2.

clip_image074

On the DNS Delegation, selection the option to no create the DNS delegation.

Accept the default file locations for AD binaries.  You could change them (as a best practice) to seperate disks, but since this is only a small LAB AD, i won’t bother with that.

clip_image075

Fill in a valid Directory Services Restore Mode password and click Next a couple of times to install AD.

clip_image076

You will get a warning about the DNS Zone.  Just skip it.

clip_image077

After the reboot, open Server Manager and go to Roles – DHCP Server.  Right-click your DHCP server and select Authorize.  This will make both IPv4 and IPv6 “green".

clip_image078

If you want, you can change the Forward and Reverse Lookup zone in DNS to AD Integrated, but it’s not really necessary for our lab.

That’s it for our Domain Controller!

Next up will be the SQL Server!

Building the Ultimate vSphere Lab – Part 7: SQL Server

Create a new linked clone based on the Windows2008R2_Base template just like you did with the Domain Controller.  Name the machine SQL.

Again, store it on SSD storage.  Run through the OS Setup like you did with the Domain Controller.

Change the Network Adapter to VMnet2 to it can reach the DC.

If all goes well, you should get a DHCP address.

clip_image079

Give it a valid IP address and point the DNS Server to the DC.

clip_image080

Rename the Guest OS and make it a member of the labo.local domain.

clip_image081

Create a useraccount SQLAdmin in Active Directory (set the password to never expire).  Add this account to the Local Administrators group on the SQL VM.

clip_image082

Log on with this account to the SQL VM.

Before starting the installation of SQL Server, we’ll add an additional HD to the VM first.  We’ll throw all SQL binaries on that disk.

Right-click the SQL VM and select Settings.  Click the Add… button and pick Hard Disk.

clip_image083

Create a new virtual hard disk of 40 GBStore the virtual disk as a single file.

clip_image084

Rename the VMDK to something like SQL_Data.vmdk.  This makes it easier to locate the correct vmdk if ever needed.

clip_image085

Get back into the VM and format the disk.

clip_image086

In order to reach the SQL binaries (which are stored on the Windows 7 desktop VM), i use the Shared Folders feature of VMware Workstation.  This allows you to share a single folder between the hosts and the guest VMs.

clip_image087

clip_image088

Start the Setup of SQL Server 2008 R2.  Select Installation and pick New installation or add features to an existing installation.

clip_image089

I will run SQL in Evaluation mode, but if you have valid licenses, feel free to add them here clip_image001[7]

clip_image090

Some Setup Support Files will be installed.

clip_image091

You will get two warnings: one because you cannot access the Internet and a second because the Windows Firewall is enabled.

Select a SQL Server Feature Installation.

clip_image092

Install the Database Engine Services and the Management Tools – Basic.  Change the directories to you SQL Data drive (in my case E:)

clip_image093

Install a Default Instance but again, change the drive to the SQL Data drive.

clip_image094

Set the useraccounts for the services to LABO\SQLAdmin and change all services to Automatic.

clip_image095

Set the authentication to Windows and add the Current User to the SQL Administrators.

clip_image096

Finish setup.

That’s the basic setup for SQL Server.

Building the Ultimate vSphere Lab – Part 8: vCenter

And now finally we come to the point where we are going to install a VMware product clip_image001[8]

Create yet another linked clone based upon the Windows2008R2_Base VM and name it VC.  This must be stored on SSD as well.

The Virtual Network must be VMnet2.  Add it to the domain labo.local.

Create a user VCAdmin in AD and make this a member of the Local Administrators group on the VC.  Log on with that user.

First we need to install SQL Native Client.  This is located on the SQL ISO (the one you installed SQL Server on @ SQL VM).  It can be found in folder 1033_enu_lp\x64\setup\x64 and is called sqlncli.msi.

The installation is just a matter of Next, Next, Next, Finish clip_image001[9]

clip_image097

Now, hop on to the SQL VM and open SQL Management Studio.

Click SecurityLoginsNew Login.

clip_image098

The login name must be LABO\VCAdmin.

clip_image099

Right click Databases and select New Database.

Name it vCenter, set the owner to LABO\VCAdmin and size the MDF file to 100 MB.

clip_image100

On the Options tab, change the Recovery Model to Simple.

clip_image101

Get back into SecurityLogins and open the properties of your LABO\VCAdmin account.  Go to the User Mapping tab.  Give the account do_owner permissions on both the msdb and the vCenter database! (the vCenter database should already be okay normally).

clip_image102

Okay, now head back to the VC VM.

Open up Administrative Tools and select Data Sources (ODBC).  Create a new System DSN.  Select SQL Server Native Client.

clip_image103

Name it vCenter and point to the SQL server.

clip_image104

Click Next on the following screen and…  uh oh

clip_image105

Go back to the SQL Server and open SQL Server Configuration Manager and Enable TCP/IP.  Restart the SQL Server Service.

After that, open Windows Firewall and select Allow a program or feature through Windows Firewall.  Click Allow another program.  Browse for it and go to E:\Program Files\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQL\Binn\sqlservr.exe.

clip_image106

Go back to the VC and try again… it should proceed now.

Change the default database to vCenter.

clip_image107

Finish the wizard.

Now that we have the SQL stuff covered, it’s time to install vCenter!  Start autorun from the vCenter binaries.

Select vCenter Server (duh!)

clip_image108

Setup will complain that IIS is installed (got installed with the .NET installation routine).  Therefore, disable the World Wide Web Publishing service on the VC server.

clip_image109

clip_image110

The following screens are quite easy to understand.  Select use an existing supported database and select the vCenter ODBC source you created above.

clip_image111

It will detect that Windows Authentication will be used.  Fill in the password for the vCenter service (VCAdmin, the account we gave dbo permissions on the databases).  This will also mean that the vCenter service will be started with this VCAdmin account!

clip_image112

Accept the default installation paths.  Create a standalone VMware vCenter Server instance.

Set the JVM Inventory Size to Small.

clip_image113

Finally, click Install to start the installation.

clip_image114

To finalize, install vSphere Client.

clip_image115

Start vSphere Client, install the certificate and you should connect flawlessly to our brand new vCenter environment!

clip_image116

And in case you were wondering, all our 3 VMs together consume about 20 GB.  Not bad clip_image001[10]

That’s it for now!  Next up, we’ll start installing our ESXi hosts.

Building the Ultimate vSphere Lab – Part 9: ESXi

Now that we have our vCenter running, it’s time to deploy our ESXi hosts.

Depending on the amount of memory you have, you can deploy as many ESXi hosts as you want.  Personally (I have 16 GB), i will install 2 of them.

Start by creating a new Virtual Machine.  Take Custom for the type of configuration.

clip_image117

Hardware Compatibility is Workstation 8.0.

Attach the ISO of VMware ESXi 5.0.  The wizard will detect ESXi automatically for you!

clip_image118

Call it ESXi1 and place it on HDD storage.  There is no use on putting it on SSD storage since ESXi has no real important data to store which is important from a performance point of view.

clip_image119

You can play around with the CPUs/Cores, but i give it a Dual Dual-Core (so cores in total).  Gives you some more cores to play with if you want to dive into the CPU scheduler details.

clip_image120

Give the ESXi host 4GB of memory.

clip_image121

Select Do not use a network connection as we will add it later on.

clip_image122

Accept the standard LSI Logic SCSI controller.

Create a new virtual disk and pick SCSI as the type.

Use a 40GB disk and store it in a Single File.

clip_image123

Complete the wizard and click Finish.

Edit the settings of you newly created VM.  Remove the Floppy and USB Controller.

Click Add and add a Network Adapter.  Attach it to the VMnet2 network.

Repeat the procedure and add a second Network Adapter to the VMnet2 network.  This will give you a screen like this:

clip_image124

Select the Processor item, and select Virtualizae Intel VT-x/EPT or AMD-V/RVI.  This allows you to run x64 guests on these ESXi hosts.

clip_image125

Now before starting and installing ESXi, take a Full Clone of this VM and name it ESXi2.  You can create a fresh VM as well, but cloning it will go faster.

clip_image126

Now, Power On you ESXi1 host.

The ESXi Installer will boot.

Follow the wizard and install ESXi on your 40GB local disk.

clip_image127

Use the same root password as you always do.

The installer will wipe your hard disk…  Let him do so by clicking F11.

clip_image128

After the installation, the host will reboot.  Press F2 to customize it.  You will need to login with root.

clip_image129

Select Configure Management Network.  First, go into Network Adapters and add vmnic1 to the list.

clip_image130

Give it IP 10.0.0.10/24 and set the default gateway to 10.0.0.1 (DC).

clip_image131

Get into DNS Configuration and set the DNS server (should already be set through DHCP but verify) and change the hostname to esxi1.labo.local.  Do not use capital letters here!

clip_image132

Exit the screens and enter Y to restart the Management Network.

clip_image133

That’s it for the basic ESXi installation… Quite easy eh?

Now repeat this part for ESXi2 (IP = 10.0.0.20).

After the two ESXi hosts have been installed, log on to the DC and open Server Manager – Roles – DNS Server – DNS – DC – Forward Lookup Zones – labo.local.  Create a A Record for both ESXi hosts.

Create a PTR Record as well!

clip_image134

You DNS should like like this:

clip_image135

Move over to the vCenter server.  You must be able to ping both machines using their FQDN now!

clip_image136

Open up vSphere Client.

First, create a new Datacenter and below it, create a new Cluster.

Turn on HA & DRS.

clip_image137

Leave all other settings to default and complete the wizard.

Now, add the two ESXi hosts to the cluster:

clip_image138

That will give this cluster layout in vSphere:

clip_image139

Both hosts will have errors (HA related, but it’s no big deal as we’ll solve them later on).

If you ESXi hosts disconnect continually, check Administration – vCenter Server Settings – Runtime Settings and fill in the IP of vCenter.

clip_image140

Building the Ultimate vSphere Lab – Part 10: Storage

We now have a cluster, but still not a usable because we don’t have Shared Storage yet.  So let us add some clip_image001[11]

We will go for an iSCSI solution.  This makes perfect sense since this can be virtualized perfectly.  Many iSCSI appliances exist on the market today.  Lefthand, UberVSA, OpenFiler, …  I will however go with the easiest solution: installing a Software iSCSI Target on Windows Server.

Again, various flavors exist, but what most people don’t realize is that Microsoft has it’s own free iSCSI Target.  I has all the basic functionality you need (CHAP, Snapshots, …).  No replication or other advanced stuff is supported, but we don’t really need that for now.

Let’s start by downloading the goodies: http://www.microsoft.com/download/en/details.aspx?id=19867

Extract it and put it on the Shared Folder to the VMs can access it.

Now, before we install the iSCSI Software, we need to change our VM to support it.  We will use our vCenter Server for Storage.  If you have the resources on your PC, a dedicated VM would be better (but then, i would go for a dedicated iSCSI appliance like Lefthand, OpenFiler, …).

Give your vCenter VM a second Hard Disk of 500GB and put it on HDD storage.

clip_image141

Initialize it in Windows.  That will become our E: drive on the vCenter:

clip_image142

Now, we want our iSCSI to be a seperate network.  So open the Virtual Network Editor in VMware Workstation.

Create VMnet3 for IP range 10.0.1.0/24.

clip_image143

Give the vCenter VM a Second Network Adapter connected to this newly created network.

clip_image144

On the vCenter, rename the connection to iSCSI.

clip_image145

Give it IP 10.0.1.3/24.

clip_image146

Go to the Microsoft iSCSI Software Target folder and start x64\iscsitarget_public.msi.

The installation is a matter of Next, Next, Finish.

clip_image147

Now, open the Microsoft iSCSI Software Target console.

clip_image148

On the root item, click Properties.  Enable only IP 10.0.1.3 to listen for iSCSI sessions.  This ensures we only use the dedicated iSCSI network (VMnet3).

clip_image149

Right-click Devices and select Create Virtual Disk.

Point it to E:\iSCSI\Datastore1.vhd.

clip_image150

Set it to 200GB (200000 MB) or something in that neighborhood.  Pay attention as the input fields are in MB (Megabytes).  We won’t assign any targets yet.

Create a second Virtual Disk called Datastore2 in the same folder.  Make the size different, so it’s easier to differentiate the two datastores.

clip_image151

Now that we have our storage ready, let’s prep the ESXi hosts for it.

Remeber that we put the iSCSI traffic on a seperate VMnet3 network.  Our ESXi hosts currently have 2 NICs in the VMnet2 network, so no iSCSI traffic will be possible.

Shutdown the ESXi hosts, go into Settings and Add 2 Network Adapters both connected to VMnet3.

Power On the ESXi hosts.  Select a host and go into Configuration – Networking.  Your current config will look like this:

clip_image152

Click Add Networking… to add a new vSwitch.

Select VMkernel as the type.  Use the newly added vmnic2 & vmnic3.

clip_image153

Name the Portgroup iSCSI_1 and don’t select any other options.

clip_image154

Use IP 10.0.1.10 for ESXi1 and 10.0.1.20 for ESXi2.

clip_image155

Open the Properties of vSwitch1 and select Add… to add another VMkernel interface.  This will become iSCSI2 with IP 10.0.1.11 for ESXi1 and IP 10.0.1.21 for ESXi2.

Change the NIC Teaming Failover order of both iSCSI_1 & iSCSI_2.  Set vmnic2 active for iSCSI_1 where vmnic3 becomes unused.  Change it the other way around for iSCSI_2.

clip_image156

The Network Layout looks like this now:

clip_image157

Now get into Configuration – Storage Adapters and click Add….

clip_image158

Select the newly added iSCSI HBA (vmhba33) and click Properties….

clip_image159

Copy the iSCSI Name (you can change this name to something more readable if you want)

clip_image160

Get back into the Microsoft iSCSI Software Target console and select iSCSI TargetsCreate iSCSI Target.

clip_image161

Fill in the hostname as the iSCSI target name:

clip_image162

Paste the iSCSI Name from vCenter into the IQN Identifier field.

clip_image163

Now that the Target is created, let’s assign our two LUNs to it.  Right-Click it and select Add Existing Virtual Disk to iSCSI Target.

clip_image164

Select both disks.

clip_image165

Back in vCenter, open Network Configuration on the iSCSI Initiator Properties.

clip_image166

Add both iSCSI_1 and iSCSI_2 to it.

clip_image167

Move on to the Dynamic Discovery and add 10.0.1.3 as a new iSCSI Target.

clip_image168

Close the Window and Rescan the vmhba33 adapter.

Your 2 LUNs will become visible.  Note that we have 4 paths meaning 2 per LUN (= load balancing & failover possibilities).

clip_image169

Repeat the same procedure for ESXi2.

After that go to ConfigurationStorage and create 2 new datastores on these LUNs.

clip_image170

Open the Properties of your Cluster and enable vSphere HA.

clip_image171

It should be enabled without errors (you will receive warnings if you don’t have Shared Storage, that’s why we enable it now and not during Cluster creation).

That’s it for now!  Next, we will create our vMotion interface!

Building the Ultimate vSphere Lab – Part 11: vMotion & Fault Tolerance

Next up is the creation of our vMotion interface.

Let’s take a look at vSwitch0 first:

clip_image172

Open Properties… and remove the VM Network portgroup.  Then, open the properties of the vSwitch and put both vmnic adapters as active.

clip_image173

Now open the properties of the Management Network and set vmnic0 as active and vmnic1 as standby.

clip_image174

Now, add a new VMkernel interface on vSwitch0.  Name it vMotion and enable it for vMotion.

clip_image175

Use IP 10.0.0.11/24 for ESXi1 and 10.0.0.21/24 for ESXi2.

clip_image176

Finish the wizard, open the Properties of the vMotion Portgroup and set the NIC order so vmnic1 is active and vmnic0 is standby.

clip_image177

Repeat this procedure for ESXi2.

That’s it for vMotion.  Not really rocket science clip_image001[12]

Now it’s time to activate Fault Tolerance.  That’s right, Fault Tolerance running on vSphere in VMware Workstation!

Power Down your two ESXi hosts.

Open the Virtual Network Editor and create a VMnet4 network in the 10.0.2.0/24 range.

clip_image178

Give each ESXi host 2 new Network Adapters in this VMnet4 network.

clip_image179

Power On the hosts and get into ConfigurationNetworking.

Click Add Networking… to add a new vSwitch.  Select VMkernel and use vmnic4 and vmnic5.

clip_image180

Name it Fault Tolerance and enable it!

clip_image181

IP will be 10.0.2.10/24 for ESXi1 and 10.0.2.20/24 for ESXi2.

clip_image182

This gives you the following Networking Layout.

clip_image183

Now, before you enable FT on a VM, you need to set the following Advanced Configuration Parameters on EACH VM you want to protect with FT.

replay.allowBTOnly = true

replay.allowFT = true

replay.supported = true

clip_image184

Now you can run Fault Tolerance enabled VMs on your virtual vSphere 5 ESXi hosts!  How cool is that?  One exception though, the VM you enable for FT can be 32-bit only!

I personally like to play around with some DOS appliance which has some games installed.  It is small enough to run smoothly on these virtual environments.

Building the Ultimate vSphere Lab – Part 12: Finalizing the Lab

Our basic setup is almost ready.  We just need to give our VMs some networks to connect to.

Let’s create a new VMnet5 network in the Virtual Network Editor.  Use range 10.0.3.0/255.255.255.0 and enable the Use local DHCP service to distribute IP address to VM.

clip_image185

Change the DHCP Settings and fill in a valid start and end address.

clip_image186

Power Off the ESXi hosts and give them two extra vNICs attached to VMnet5.

clip_image187

Create a new Virtual Machine portgroup/vSwitch on vmnic6 & vmnic7 and you’re set:

clip_image188

Now you can start creating your VMs, vMotion them around, play with Fault Tolerance, create dvSwitches, install VDR, experiment with vShield Zones, …  you get the picture clip_image001[13]

With this we can finalize this series.  You now have a fully functional environment which is very flexible and you can start playing with all the features in vSphere 5!

Happy playing in your Virtual Lab Environment!

Source & Credits:  http://boerlowie.wordpress.com/

Advertisements