Wednesday, April 24, 2013

Minimizing the vCenter memory footprint - Appliance

This blog has moved to its own domain: www.vaspects.com
Please update your bookmark.
http://www.vaspects.com/2013/04/24/minimizing-vcenter-memory-appliance/

In my previous post I described how to reduce the vCenter memory requirements on Windows. Basically the same is true for the vCenter appliance, but the files are a bit harder to find. Besides that all disclaimer apply - this is in no way supported by VMware.

Single Sign On:
- /usr/lib/vmware-sso/bin/setenv.sh
- Change "JVM_OPTS" (default: "-XX:MaxPermSize=256M -Xms2048m -Xmx2048m") to "-XX:MaxPermSize=128M -Xms128m -Xmx256m"

Inventory Service:
- /usr/lib/vmware-vpx/inventoryservice/wrapper/conf/wrapper.conf
- Set wrapper.java.maxmemory (default: "3072") to "384" (MB)

Tomcat:
- /etc/vmware-vpx/tomcat-java-opts.cfg
- Change the default "-Xmx1024m -XX:MaxPermSize=256m" to "-Xmx512m -XX:MaxPermSize=256m" (or MaxPermSize to half of the Xmx value chosen before)

Web Client:
- /usr/lib/vmware-vsphere-client/server/bin/dmk.sh
- Change "JVM_OPTS" (default: "-Xmx1024m -Xms512m -XX:PermSize=128m -XX:MaxPermSize=256m") to "-Xmx384m -Xms256m -XX:PermSize=128m -XX:MaxPermSize=256m"

Log Browser:
- /etc/init.d/vmware-logbrowser
- Set "HEAP_PROP" (default: "-Xms128m -Xmx512m") to "-Xms128m -Xmx256m"

Profile Driven Storage:
- /usr/lib/vmware-vpx/sps/wrapper/conf/wrapper.conf
- Set wrapper.java.initmemory (default: "256") to "128" (MB)
- Set wrapper.java.maxmemory (default: "1024") to “384” (MB)

After these adjustments the VM memory can safely be reduced to 4-5 GB. But beware that - sadly enough - the Tomcat JVM still tends to eat up memory over time. Therefore I prefer to stick to 5 GB RAM, and here's the result:

top - 11:58:23 up 5 days, 19:05,  1 user,  load average: 0.34, 0.57, 0.71
Tasks: 142 total,   1 running, 141 sleeping,   0 stopped,   0 zombie
Cpu(s):  0.8%us,  1.0%sy,  0.0%ni, 97.8%id,  0.3%wa,  0.0%hi,  0.0%si,  0.0%st
Mem:   5091868k total,  4928832k used,   163036k free,   402632k buffers
Swap: 15735804k total,    23892k used, 15711912k free,  1445808k cached

  PID USER      PR  NI  VIRT  RES  SHR S   %CPU %MEM    TIME+  COMMAND
 4758 root      20   0 1244m 870m  10m S      0 17.5  55:40.59 java
 5267 root      20   0  985m 620m  12m S      0 12.5  19:34.38 java
 3490 root      20   0  989m 475m  12m S      1  9.6  46:57.03 java
 3839 ssod      20   0  905m 333m  10m S      0  6.7  19:01.57 java
 4980 root      20   0  702m 238m  11m S      0  4.8  17:36.23 java
 4541 root      20   0  459m 227m  91m S      1  4.6  72:21.12 vpxd
 3193 root      20   0  558m 125m  10m S      0  2.5   9:21.73 java

Minimizing the vCenter memory footprint - Windows

This blog has moved to its own domain: www.vaspects.com
Please update your bookmark.
http://www.vaspects.com/2013/04/24/minimizing-vcenter-memory-windows/

With vSphere 5.1 the memory requirements of the vCenter server have dramatically increased. If all components reside on a single Windows server [VM], even the smallest inventory size will require 10 GB of memory, according to the VMware Installation and Setup guide. Although this document states a minimum of 4 GB memory for  the vCenter Appliance, it is in fact configured for 8 GB RAM after deployment. This will most likely exceed or significantly reduce the resources of small home labs or all-in-one setups with VMware Workstation.
Is this necessary? Nope. But due to the default JVM memory settings a simple reduction of the VMs’ RAM could lead to swapping and have a negative impact on the overall performance, obviously. The following adjustments to the application settings will allow to reduce the VM memory to 4-5 GB. This posting covers a Windows-based vCenter server, the following post will be related to the Appliance.

No need to mention that all of this is absolutely not supported by VMware, right?

Prerequisites:
The vCenter server is installed on a Windows 2008 R2 server VM with SQL Server 2008 R2 Express and no noteworthy additional software or roles. The SQL Server setting “Maximum server memory” has been configured for a low value – 256 MB should be fine.

After installation of the vCenter Server components edit the following files and change the settings:

Single Sign On:
- C:\Program Files\VMware\Infrastructure\SSOServer\conf\wrapper.conf
- Set wrapper.java.additional.9="-Xmx" (default: "1024M") to "256M"
- Set wrapper.java.additional.14="-XX:MaxPermSize=" (default: "512M") to “128M” (or half of the Xmx value chosen before)

Inventory Service:
- C:\Program Files\VMware\Infrastructure\Inventory Service\conf\wrapper.conf
- Set wrapper.java.maxmemory (default: "3072") to "384" (MB)

Tomcat:
- C:\Program Files\VMware\Infrastructure\tomcat\conf\wrapper.conf
- Set wrapper.java.additional.9="-Xmx" (default: "1024M") to "512M" - "768M"
- Set wrapper.java.additional.14="-XX:MaxPermSize" (default: "256M") to half of the Xmx value chosen before

Web Client:
- C:\Program Files\VMware\Infrastructure\vSphereWebClient\server\bin\service\conf\wrapper.conf
- Set wrapper.java.initmemory (default: "1024m") to “256m”
- Set wrapper.java.maxmemory (default: "1024m") to “384m”

Log Browser:
- C:\Program Files\VMware\Infrastructure\vSphereWebClient\logbrowser\conf\wrapper.conf
- Set wrapper.java.maxmemory (default: "512") to "256" (MB)

Profile Driven Storage:
- C:\Program Files\VMware\Infrastructure\Profile-Driven Storage\conf\wrapper.conf
- Set wrapper.java.initmemory (default: "256") to "128" (MB)
- Set wrapper.java.maxmemory (default: "1024") to “384” (MB)

Orchestrator:
- C:\Program Files\VMware\Infrastructure\Orchestrator\app-server\bin\wrapper.conf
- Set wrapper.java.additional.3=-Xmn (default: "768m") to "256m"
- Set wrapper.java.initmemory (default: "2048") to "384" (MB)
- Set wrapper.java.maxmemory (default: "2048") to "512" (MB)
The latter two values must be higher as the Xmn value chosen before.

This settings are the lowest value I have personally used without experiencing any problem in an environment of two ESXi hosts and about three dozen VMs with half of them up & running, the other powered off or  templates. To be perfectly honest I did not try to find out the absolutely lowest possible settings – the result of the first shot were satisfying enough, cutting the RAM requirements in half and thus roughly back to pre-5.1 times.

If you do run into problems, either regarding performance or even functionality, please post a comment and the parameter & value you changed to resolve it.

Monday, April 22, 2013

The home lab


This blog has moved to its own domain: www.vaspects.com
Please update your bookmark.
http://www.vaspects.com/2013/04/22/the-home-lab/

I suppose most of the virtualization blogs will include the description of the author’s test & lab gear, so I’ll start with that. :-)

I decided not to virtualize the lab itself, but to use real equipment. Yep, it’s possible to build an all-in-one setup with a standard PC and VMware Workstation. But you’re not able to try out the pros and cons of different network setups and configurations or reproduce problems of customer environments. A high performance PC with lots of RAM would even have been more expensive at that time - I built my home lab in early 2011, so please keep in mind that it is 2 year old stuff. So, here’s the list.

Two ESXi hosts:
AMD Phenom II X6 1055T E0 (6 x 2.8 GHz) on Asus M4A88T-M mainboard with 24 GB RAM DDR3-1333. One HP NC360T Intel-based dual port NIC, one Intel Gigabit CT Desktop NIC, together with the onboard Realtek a total of 4 NICs. I got the HP NICs from eBay where you still can find them (or even genuine Intel dual port NICs) for around 50 Euro.

Storage system:
Upgraded an existing Mini-ITX box with Intel Core2Duo E6750 (2 x 2.6 GHz) on Zotac G43-ITX mainboard with 4 GB RAM and 2 x 500GB + 2 x 320GB 2,5” HDDs. One HP NC360T Intel-based dual port NIC. Currently I’m running Ubuntu 12.04 LTS with iSCSI target, kernel mode NFS, DNS, NTP, DHCP and Kickstart server.

Network:
LevelOne GSW-1676 16 port Gigabit “smart” switch. Which basically means its friggin’ complicated to properly configure the VLANs, trunks and port settings using the Web UI. I’d rather suggest to look for a Cisco SG200 series switch or the like.

The cost was around 1000 Euro for the whole lab, which is not that much considering that you have two physical boxes and a real network. 

I chose AMD since in my opinion they (still!) offer the best ratio of cores to cost. The single thread performance of Intel CPU cores is superior, but with AMD you’ll get more cores, and that usually better suits virtualization needs. The ASUS mainboard officially supports only 4 GB DIMMs, and I started with 16 GB in each system. Last year when the RAM got amazingly cheap, I tried a set of four 8 GB DIMMs and found out that the board supports them without any problem, so the total memory went up to 48 GB. When the vCenter memory dramatically increased with vSphere 5.1 I was quite glad to have found the right time to expand the resources. BTW: a guide on how to reduce the vCenter memory requirements down to more home lab friendly 5 GB will follow soon.

Latest addition was a Juniper Netscreen-50 firewall. Used ones are around 40 Euro on eBay. They have only 4 Fast Ethernet ports, but add another “real life” complexity (like the switches) you’ll have to deal with when building real vSphere environments. If you have the chance to grab one of these fine devices, I recommend to do so.

Let me introduce myself…

Dear reader! :-)

This blog just came to life, and I will use it to post my thoughts, findings, hints, tips & tricks around all virtualization aspects I will come across (and some other stuff maybe), with the main focus on VMware products.

My journey to Virtualization and Cloud Computing started in late 2005 with Solaris 10 Zones / Containers. Later on I started to focus on x86 technologies and VMware products. In early 2008 I took my first certification and became VCP3 #25734. Continued to keep my certification as VCP4 and VCP5-DCV and became VCAP4-DCD #483 in February 2011.

I’m working for a consulting company and usually available for challenging projects.