Sunday, November 29, 2009

"VMware Data Center in a Box" using VMWare Player

I need to study for my upcoming VCP exam and I have always liked the idea of a "Data Center in a Box".  By this I mean an ESX server, an ESXi server, and a vCenter server, all in virtual machines on my laptop.  It was possible with Workstation 6.5 but it appeared even easier with the release of VMware Player 3.  Combine the ease of setup with VMware Player's free download and this was a winner to me!  My goal was to create an environment to study for my VCP.  It isn't perfect, it isn't even complete.  But, it works!  I'll work on it more AFTER my VCP.  One thing at a time...

Before I begin, I wanted to say a big Thank You to Paul Braren at IBM for his presentation on this topic using VMware Workstation 6.5 at the IBM Technical Conference, Rich's post on ESXi in Player, and Duncan's post on conserving memory in virtual ESX and ESXi.  This article would not have been possible without their information.

Here's the environment: HP Elitebook 8530p w/ 4GB of RAM running XP 32 bit with PAE extensions (yeah, I know... more on that at the end), Virtualization enabled in the BIOS, VMware vSphere 4 and vCenter 4 GA code, and of course VMPlayer 3.0.


Step One - Design the Network Environment

The first thing I needed to do was figure out how to set static IP addresses to work in VMPlayer.  I decided to use the NAT network in Player.  When I set up a machine using DHCP on the NAT network with my older Workstation 6.5 I could see the following settings for the network.  The settings have remained the same for Player:


The NAT network is using the 192.168.116.0 subnet and the first DHCP address is .128.  You can set static IP's below the DHCP range and they will route fine in Player.  I am using the following IP's:
  • a DNS/SMTP server at 192.168.116.10 (optional, could be combined into the vCenter server)
  • vCenter at 192.168.116.30 named esx-vc.testlab.int
  • vSphere at 192.168.116.31 named esx4.testlab.int
  • ESX4i at 192.168.116.32 named esx4i.testlab.int
I also decided to use the Private Network for a second Service Console (not really needed, just messing around) and vMotion in anticipation of adding shared storage later on.  Using the method above I determined my private network uses the 192.168.27.0 network.  Based on that, I set IP's on the Private network as follows:
  • vSphere SC#2 at 192.168.27.31 and vMotion at 192.168.27.61
  • ESXi4 SC#2 at 192.168.27.32 and vMotion at 192.168.27.62
Step Two - Install vCenter and DNS

For my environment I already had DNS on another virtual server but it could easily be set up on the vCenter server.  I installed the DNS server and created a namespace called testlab.int.  I then created A records for both vSphere servers as well as reverse PTR lookup records for both vSphere hosts.

Since 2GB is the recommended minimum, I installed vCenter using this amount.  I accepted all the defaults.  After the installation was complete and the vCenter was running, I reduced the amount of memory from 2GB to 1GB.

Step Three - Install vSphere ESXi Server


Using Rich's Post, I installed ESXi using the "Easy" method.  This method set up the virtual machine hardware settings to work fine but it also uses DHCP for the network.  Once the machine booted up, I changed the IP information to my static information and changed the DNS server to my DNS server.

I added a second NIC to attach to my Private network for the second management port and the vMotion port.  Here is a screen shot of the final network configuration:


The last tweak I needed was an adjustment to the memory requirements.  Out of the box, ESXi requires 2GB and that is just too much in this tight environment.  Thanks to Duncan's post, I was able to reduce the amount of memory to 1.2GB.  At 1 GB the server PSOD'd on me.  Bumping it to 1.2 GB was the minimum amount I could set for it to boot.

Step Four - Install ESX vSphere Server

This step was a little rough.  I installed ESX using Rich's method but I couldn't do anything with the server.  For some reason it would reply to pings but I couldn't add it into vCenter and it wouldn't respond in a browser.  I performed a quick re-install but I got the same results.  As a last resort I tweaked the hardware settings slightly (removed the floppy drive, disabled the 3D graphics, hard set the processor types to Intel-VTx or AMD-V) and then I was able to add it into the cluster.  I doubt the changes made a difference but who knows.

I set the network settings the same as the ESXi server by adding the second NIC, etc.

Lastly, back to Duncan's post to tweak the memory consumption.  According to a comment at the bottom you can set the RequiredMemory value to 516096 and use 768 MB of memory.  I set this and it worked!  I was getting a warning that I am consuming over 90% of host memory but it was functional.

Step Five - Create vCenter Cluster and Tweak vCenter

Once the machines were added into vCenter, I created a cluster in vCenter.  The ESX server added fine but the ESXi machine wouldn't configure HA.  I checked DNS, pulled it out, added it back, disabled HA, etc.  Nothing.  Oh well, can't be perfect I guess.  I'll look at it later.

Lastly, the ESX server was in a warning state because over 90% of the memory was in use.  I bumped the alarm up to 95% to warn and 97% to alert and it went away.


For those of you out there who believe screen shot or it didn't happen, here ya go!

 

Next Steps

I still have some work to do.  I would like to scrap the 32 bit XP for a 64 bit OS.  I'm not sure if I'll go to Ubuntu or Windows7.  Ubuntu is attractive because it should only take about 400MB (according to the live CD when I booted it) while Windows7 takes about 1.2GB.  That 800MB difference is another virtual machine!  The problem with Ubuntu is my underlying OS won't run the applications that I need.  I've done that before and I'm not sure I wanna go back.

Lastly, I need some shared storage.  I already have the NetApp Simulator running in a virtual machine but I'm out of memory!  I have a nice 3 node configuration (2nodes in an HA cluster and another stand alone).  All three nodes consume about 1.5 GB.  I am thinking of slimming that down and just running one simulator at 384MB or 512MB.  That is a post for another day.

As always, more to follow...

4 comments:

Rich said...

Aaron,

Great post and write up on how to create a training environment.

Some ideas for a SAN.

Use FreeNas as a VM with either iSCSI or NFS. Low RAM required (<256Mb).

Use Starwinds installed directly on the XP host. I have not tried this myself, but have recently heard it can work from fellow vExperts.

Aaron Delp said...

Thanks for the comment Rich!

After my VCP, I'm probably going to make a project out of the "back end" to this. I'm a hacker/tweaker by nature so this is fun.

I'll check out FreeNas and Starwinds in addition to the NetApp simulator.

Thank you for the comment!

PiroNet said...

Great post Aaron. Furthermore, you can also tune up vCenter memory with some reg hacks. Read more at http://deinoscloud.wordpress.com/2009/11/30/tomcat-for-vcenter-memory-tuning/

Aaron Delp said...

Didier (PiroNet) - Thank you for your post. I will try that in the future. I'll also throw another link at everyone:

http://communities.vmware.com/thread/244941?tstart=0

This is a post I put up in the Workstation Forum and it has some great information to further increase your mileage on laptops.

Thank you!