Many IT administrators or virtualization guys run their homelabs at home. It is a good way to learn new technologies, be able to break things in a lab to get stronger skills.
It is sometimes a challenge, to squeeze as much RAM as possible from it. The main challenge is always a memory utilization. VMware VMs are getting memory hungry all the time and they are not “optimized” for Homelab use, but rather for production environments. Yes, it is the main purpose of those VMs after all.
One of the large VMs, but most critical, is VMware vCenter Server Appliance (VCSA). This product is becoming very popular within VMware communities and it is very easy to setup. Today we will have a look if we can do some optimizations and some “tweaks” to make it less memory hungry.
Small disclaimer: You do that at your own risk, you won’t get VMware support. Usual precautions (snapshot, full backup….). Especially take the time to do the backup if you are not strong Linux skilled admin or if you’re learning things out. This is a “don’t do in production” warning. You know what I mean.
Let’s get started. When deploying VMware VCSA 6.5 in a lab you pick the “Tiny” option from the drop-down menu, but still, this configuration takes 10Gb of RAM from your underlying whitebox. The “Tiny” deployment allows you to have up to 10 hosts and 100 VMs. This might be still quite “overkill”. We might manage to lower that a bit. Let’s see.
If you increase (or decrease) the VCSA’s Memory size, each of the services is adjusted automatically. But what we should have a look first is perhaps to stop services we don’t use as those services are using memory.
Which services are running within VCSA and which ones can we stop?
There are some services which you might not actually use? Do you use VMware vSAN? If not, we can disable the vSAN health service.
Simply go to the VCSA console and Stop the vSAN Health Service:
1 |
# service vmware-vsan-health stop |
Stopping Virtual SAN Health Service:
Disable the vSAN Health Service:
1 |
# chkconfig vmware-vsan-health off |
There are some services which can safely be stopped through the vSphere web client.
General services which can (possibly) be switched OFF.
Without much risk, you can stop services which you don’t use. You can also setup their startup type to “manual” to prevent those services to start when the VCSA starts.
Open the vSphere Web Client and navigate to Administration > Deployment > System Configuration > Services.
You can disable those services:
- VMware Update Manager
- VMware vSphere Profile Driven Storage Service
- VMware vSAN health service
- VMware content library service
- VMware vCenter High availability
- VMware vSphere ESXi dump collector
Figure 1: Set service startup manual
To stop the service, you use the Stop button icon or simply Right click the service > Stop. The service will be stopped in a few seconds. (sometimes longer).
Make sure you stop only the services you don’t use as if you stop some vital service for vCenter, you might lose the UI and have to go into the CLI for starting the service up.
Figure 2: Stop unneeded services
With those simple tweaks, we might be able to lower the VM memory size from 10Gb to 6 Gb. I know it seems to be a little, but on systems running several nested ESXi instances, or other VMs, it’s still good memory economies.
You can check the memory consumption via CLI. For this, you must connect via an SSH client such as putty (if SSH is enabled on VCSA).
After connection, enter this command:
1 |
vimtop |
You’ll see the initial screen, which can be further personalized. You type “h” for help.
Figure 3: VCSA appliance vimtop screen
Wrap up:
We have tested to lower the memory from 10Gb to 6Gb. You might be able to go even lower than that, but the stability of the product might get affected, there might be some heavy swapping etc.
The physical RAM in your server has the crucial value for Homelab (and also enterprise) installations. Whenever you get the chance get as much RAM as you can. While using older server hardware from eBay might be considered as a smart move at the beginning, very fast you’ll find out the limitations of 2-3 years or even more older hardware.
Physical RAM is almost always exhausted first. You can always add more disk space or buy an SSD, but if your system’s motherboard has limited RAM slots, you won’t be able to extend your RAM. Think about it before making the purchase.
If you’re building a Homelab today, I would recommend going for 128Gb of RAM (or at least 64 Gb with a possibility to upgrade).
Other things to consider is also the cloud. You can run some VMs in Azure or on AWS if your company is willing to allocate some budget for your learning activities.