Building a more advanced homelab setup with a dedicated server running VMware ESXi

Building a more advanced homelab setup with a dedicated server running VMware ESXi
from pexels

This article builds on my previous article "Building a minmal homelab on Windows with Virtualbox and Vagrant within minutes". Especially for larger deployments, such as a multinode OpenStack or Kubernetes cluster, the small homelab setup with Virtualbox quickly reaches its limits. In this case, it makes sense to use a dedicated server running VMware ESXi that can be equipped with more RAM and a CPU with more cores. I have treated myself to the following setup:

  • Intel Xeon E5-2658 10 cores / 20 threads
  • 64GB DDR3 RAM
  • DEEPCOOL MATREXX 55 V3 ADD-RGB 3F White
  • SuperMicro X9DRD-7LN4F-JBOD LGA 2011
  • Noctua NH-U12DX i4
  • Seasonic FOCUS GX-650
  • NVME adapter PCIe x16 supports PCIe x4 x8 x16 slot
  • CSL - USB 3.0 (Super Speed) Card / PCIe Express Controller Card

In total this is about 400€. Sure, it's not exactly a small amount of money, but you get enough resources to build larger test environments and it's also very quiet compared to a 19" inch rack server. I do not have it 24/7 in use. The power consumption is much too high for that and I don't see any sense in running such a monster continuously. In the setup I'm describing here, it will be possible to simply turn on the server and then deploy virtual machines and larger test environments with Vagrant in a short time. If you don't want to spend that much money at first, no problem. The setup also works with less resources without any problems. An old PC with a quad core CPU and 8GB RAM are pretty much the minimum. Of course it depends on how many VMs you want to deploy. I really only recommend an SSD. A consumer SSD is more than sufficient here. I also use VMware ESXi a lot in my job and I think it is a very easy to install hypervisor. But now let's finally get started.

Prerequisites

Hardware

PC with Quadcore CPU, 8GB RAM + SSD

Software

VMware ESXi

Vagrant

VMware ESXi Vagrant plugin

VMware OVFTool  

Installation

VMware ESXi

You will need an account at VMware to download the ESXi ISO image. VMware ESXi is still free of charge. I will not go into the details of installing VMware ESXi here. It is pretty much self explanatory. You download the ISO image, burn it to a CD or create a bootable USB stick, boot from it and follow the simple installation steps. Once it is installed you will be prompted to reboot and once ESXi has bootet, you can log in by pressing F2 and entering root and the passwort that you set during the install. It is a good idea to set a static IP. Once you have configured it with a static IP you can do the rest of the configuration via its WebGui called Hostmanager. Simply fire up a browser and browse to

https://your-static-ip

That is pretty much it for now. Of course there are a lot of things that you can configure but for now this is fine to deploy our very first VM using Vagrant.

Vagrant

Also very simple to install. Just download the installer and run it. I have it running on Windows, but it will also work fine under MacOS and Linux.

OVFTool

Agaom very simple to install. Should also work fine under MacOS and Linux.

Vagrant VMware ESXi Plugin

Open a cmd shell and run

vagrant plugin install vagrant-vmware-esxi

Once the plugin is installed we can go ahead and deploy our very first VM. For this you can download the Vagrant examples from my Github repo. In order for Vagrant to communicate with your ESXi host it needs a username and password. You can either specify the password in plaintext or in a file inside of your home directory.

echo "my_esxi_password" > $Home\.esxi_password

Now you can go ahead and deploy a single VM

cd vag-examples\single-esxivagrant up

The Vagrantbox will now be downloaded and then uploaded to your ESXi host using OVFTool. After a few moments the deployment process should be completed and you can ssh to your VM.

vagrant ssh

An IP address will be automatically assigned by DHCP if you have a DHCP server on your local network. You can add a lot more resouces like network interfaces, virtual disks etc. in the Vagrant file. The VMware Vagrant Plugin Github page is very well documented and shows some pretty good examples. There is also a multinode example that you can try out. This even offers the ability to assign static IPs and other resources.

cd vag-examples\multi-esxivagrant up

After a few moments you have two VMs deployed. Let's ssh into both.

vagrant ssh centos8stream-1vagrant ssh centos8stream-2

It is very simple to deploy additional VMs by editing the Vagrantfile and just copying and pasting the line defining a VM and it's resources. Don't forget to increment the IPs. Let's add another VM called centos8stream-3.

{ :hostname => 'centos8stream-3', :ip => '192.168.0.232', :public_ip => '192.168.2.232', :box => 'bento/centos-stream-8', :cpus => 2, :ram => 512,  :osd => 'no',  :osdsize => 20, :hv => 'no', },

Now run vagrant up again

vagrant up centos8stream-3

As you can see VMware ESXi, Vagrant and the Vagrant ESXi plugin is a very powerful combo that can help you to easily deploy test or even production environments in just a few minutes. If you liked this article, you might want to check out my next article based on this setup to deploy a complete  multinode HA OpenStack Cluster.


All the best and have fun building your test environment.

Privacy Policy Cookie Policy Terms and Conditions