Está en la página 1de 67

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 dont 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 - Its 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, its 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, its 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, Ill discuss the hardware you need for this desktop pc

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. Its 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.

Lets 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 wont have HyperThreading as thats 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 thats 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
Im not following ADM brands but basically the same things apply. At least 4 cores, and AMDV/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 doesnt fit in that small socket - Make sure you have at least 4 memory banks. - Onboard Video is nice if you dont play games. Thats 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 dont really need that much storage but then again, the more the better isnt it? 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 Ill focus on that one. On the next post, we will look at the Installation of VMware Workstation and its configuration.

Building the Ultimate vSphere Lab Part 3: VMware Workstation 8


Once we have our desktop installed with Windows 7 x64, its time to install VMware Workstation 8. Download the latest binaries from VMware website and start the setup:

Pick a Typical installation.

The default installation location is fine as it is. I recommend to check for product updates on each startup.

If youre in a generous mood and willing to help VMware, tick the check box

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

Click Help Enter License Key to unlock VMware Workstation. Lets start by Configuring VMware Workstation by opening Edit Preferences

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).

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.

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).

Click OK to save the preferences. Now its time to set up our Virtual Networking environment. Open the Virtual Network Editor.

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.

The default VMnet0 network will be used temporary to set up the first VMs so well need that. Next, well create a new Internal network for our LAN communication (vSphere hosts, vCenter, SQL, ). Hit the Add Network button to create one:

Pick VMnet2

The network must be Host-Only. Deselect 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.

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).

Click OK to save these settings. Thats 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 its time to start building our Virtual Infrastructure services. This will consist of a bunch of VMs hosting Active Directory, SQL Server, vCenter, So were 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, well 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 lets 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 wont 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 its 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 lets 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 its 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, its time to clean it up. When looking at the VMDK file size, we have grown to 17 GB already! Yikes!

Well 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.

Itll take some time

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

9 GB! Thats more like it! Now the VM is ready to be used as a Template. Run c:\windows\system32\sysprep\sysprep.exe 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 ).

Thats 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 dont delete it or power it on. Select the Windows2008R2_Base VM and click Edit virtual machine settings.

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

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!

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

Thats 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.

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

Create a Linked Clone.

Store it on the SSD drive and name it DC.

Power On the DC! It will boot and will run through the Mini Setup.

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 youre set.

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 arent any for now). Fill in the IP4 Settings like in the screen below (mind the subnet! Its a /24!).

Next, Rename the VM to DC and reboot.

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.

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

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

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!

Open the DNS Console and create a Forward Lookup Zone with the following settings: Type Zone name Create a new file Primary zone labo.local labo.local.dns

Allow both unsecure and secure dynamic updates Then, create a Reverse Lookup Zone with the following settings: Primary zone IPv4 Reverse Lookup Zone 10 10.in-addr.arpa.dns 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. Type IP Network ID Create a new file Dynamic Updates

Dynamic Updates

Now its 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.

Set the Forest functional level to Windows Server 2008 R2.

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 wont bother with that.

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

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

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".

If you want, you can change the Forward and Reverse Lookup zone in DNS to AD Integrated, but its not really necessary for our lab. Thats 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.

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

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

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.

Log on with this account to the SQL VM. Before starting the installation of SQL Server, well add an additional HD to the VM first. Well throw all SQL binaries on that disk. Right-click the SQL VM and select Settings. Click the Add button and pick Hard Disk.

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

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

Get back into the VM and format the disk.

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.

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

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

Some Setup Support Files will be installed.

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.

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

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

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

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

Finish setup. Thats 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 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

Now, hop on to the SQL VM and open SQL Management Studio. Click Security Logins New Login.

The login name must be LABO\VCAdmin.

Right click Databases and select New Database. Name it vCenter, set the owner to LABO\VCAdmin and size the MDF file to 100 MB.

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

Get back into Security Logins 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).

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.

Name it vCenter and point to the SQL server.

Click Next on the following screen and uh oh

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.

Go back to the VC and try again it should proceed now. Change the default database to vCenter.

Finish the wizard. Now that we have the SQL stuff covered, its time to install vCenter! Start autorun from the vCenter binaries. Select vCenter Server (duh!)

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.

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

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!

Accept the default installation paths. Create a standalone VMware vCenter Server instance. Set the JVM Inventory Size to Small.

Finally, click Install to start the installation.

To finalize, install vSphere Client.

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

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

Thats it for now! Next up, well start installing our ESXi hosts.

Building the Ultimate vSphere Lab Part 9: ESXi


Now that we have our vCenter running, its 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.

Hardware Compatibility is Workstation 8.0.

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

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.

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.

Give the ESXi host 4GB of memory.

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

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.

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:

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.

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.

Now, Power On you ESXi1 host. The ESXi Installer will boot. Follow the wizard and install ESXi on your 40GB local disk.

Use the same root password as you always do. The installer will wipe your hard disk Let him do so by clicking F11.

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

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

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

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!

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

Thats 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!

You DNS should like like this:

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

Open up vSphere Client. First, create a new Datacenter and below it, create a new Cluster. Turn on HA & DRS.

Leave all other settings to default and complete the wizard. Now, add the two ESXi hosts to the cluster:

That will give this cluster layout in vSphere:

Both hosts will have errors (HA related, but its no big deal as well solve them later on). If you ESXi hosts disconnect continually, check Administration vCenter Server Settings Runtime Settings and fill in the IP of vCenter.

Building the Ultimate vSphere Lab Part 10: Storage


We now have a cluster, but still not a usable because we dont have Shared Storage yet. So let us add some 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 dont realize is that Microsoft has its own free iSCSI Target. I has all the basic functionality you need (CHAP, Snapshots, ). No replication or other advanced stuff is supported, but we dont really need that for now. Lets 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.

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

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.

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

On the vCenter, rename the connection to iSCSI.

Give it IP 10.0.1.3/24.

Go to the Microsoft iSCSI Software Target folder and start x64\iscsitarget_public.msi. The installation is a matter of Next, Next, Finish.

Now, open the Microsoft iSCSI Software Target console.

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).

Right-click Devices and select Create Virtual Disk.

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

Set it to 200GB (200000 MB) or something in that neighborhood. Pay attention as the input fields are in MB (Megabytes). We wont assign any targets yet. Create a second Virtual Disk called Datastore2 in the same folder. Make the size different, so its easier to differentiate the two datastores.

Now that we have our storage ready, lets 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:

Click Add Networking to add a new vSwitch. Select VMkernel as the type. Use the newly added vmnic2 & vmnic3.

Name the Portgroup iSCSI_1 and dont select any other options.

Use IP 10.0.1.10 for ESXi1 and 10.0.1.20 for ESXi2.

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.

The Network Layout looks like this now:

Now get into Configuration Storage Adapters and click Add.

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

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

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

Fill in the hostname as the iSCSI target name:

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

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

Select both disks.

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

Add both iSCSI_1 and iSCSI_2 to it.

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

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).

Repeat the same procedure for ESXi2. After that go to Configuration Storage and create 2 new datastores on these LUNs.

Open the Properties of your Cluster and enable vSphere HA.

It should be enabled without errors (you will receive warnings if you dont have Shared Storage, thats why we enable it now and not during Cluster creation). Thats 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. Lets take a look at vSwitch0 first:

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

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

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

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

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

Repeat this procedure for ESXi2.

Thats it for vMotion. Not really rocket science Now its time to activate Fault Tolerance. Thats 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.

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

Power On the hosts and get into Configuration Networking. Click Add Networking to add a new vSwitch. Select VMkernel and use vmnic4 and vmnic5.

Name it Fault Tolerance and enable it!

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

This gives you the following Networking Layout.

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

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. Lets 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.

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

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

Create a new Virtual Machine portgroup/vSwitch on vmnic6 & vmnic7 and youre set:

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 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!

También podría gustarte