In my last post I talked about starting to build out a homelab for virtualization after diving into unRAID which had gotten me interested in the topic. While I’d read about Proxmox being good to start with, ultimately I started building out some infrastructure using XCP-NG and Xen Orchestra instead. I was quite pleased with the experience and decided it needed to be shared here.
This is an affiliate link; it helps support keeping my website content up to date.
What is XCP-NG and Xen Orchestra? #
If you’re unfamiliar, XCP-NG is a virtualization platform built on top of the Xen open-source hypervisor. Xen Orchestra is the management UI for XCP-NG, providing you with an out-of-the-box solution for administration, VM management, backups, disaster recovery, metrics, and more! Here is a great primer to get acquainted to XCP-NG.
I chose XCP-NG over Proxmox because between the two, I had to pick one; also some folks in a homelab-focused Discord server I’m in had mentioned it would be a better fit. After spending some time researching and watching a tonne of Lawrence Systems videos on YouTube and scoured their forums I felt that I was armed with the knowledge I needed. To start, I created the 8.3 LTS USB installer and fired up a machine to test it on.
Setting up your initial XCP-NG host is easy enough if you frequent the commandline, and once you’re USB drive is booted you are presented with the text-based GUI installer similar to Ubuntu or other distros. You’ll proceed to answer some questions, given a chance to load any necessary RAID drivers, pick your disks for OS installation as well as Storage Repository locations, and then the actual install begins.
Once you’ve rebooted you are presented with a traditional Linux server login screen and can begin configuring your server using the xsconsole. However, at this point it is best to do the rest of the configuration with Xen Orchestra which needs to be deployed somewhere. I won’t go into how to do that here, as there are a few ways to do this and you need to pick the one that fits your needs, but I chose to host it on my unRAID server using a community-maintained all-in-one docker image.
Once you have XO running you can add the IP address of your newly created host server and create your first pool where it will be managed within it. I highly recommend doing this because it seems to be the easiest way to add the necessary security patches in order to stay up to date.
Now that XO is setup, the sky is your limit!
Make sure to read the amazing documentation if you decide to check out XCP-NG with Xen Orchestra, and check out their forums if you run into any issues.
Some points worth noting at:
Storage #
XCP-NG with XO provides a few options for VM and ISO storage: SMB, NFS, and local storage on the machine.
Backups #
Generating backups is a breeze with XO: first you define a backup plan, include which VMs you want it to backup, pick your destination Storage Repository, set a schedule for it to run on, and voila! You have automatically backed up VMs. In my case, I have my full VM backups and snapshots transfer to an NFS share on my unRAID server and can move VMs between pool hosts with ease.
The Vates channel on YouTube has a great video on the feature set included in XO:
REST API #
XO has a REST API that you can use to automate certain tasks outside of the scope of application. I have some ideas on how to use this and want to explore a bit more before detailing them here.
Virtualization Hardware #
Virtualization is not a new concept, and you don’t need a lot of computing power to get started with XCP-NG. One can get by with consumer hardware so long as it supports Intel VT-d or AMD IOMMU.
Initially, I started small with a Lenovo ThinkCentre m720q purchased from eBay with an Intel i5-8400T 6-core 1.7GHz CPU, 16GB RAM, and 120GB SATA SSD. Its not much but it is capable of running a few smaller VMs. I have two Ubuntu-based VMs that run docker-based workloads using Dockge in one, and a Komodo Core controller in another with a little room for a third or even a fourth tiny VM.
Building my first host got me started, and now I am constantly on the hunt for inexpensive used machines that are a few generations old to add to my collection. It just so happens that I’ve accumulated a few over the past year. Below is a list of machines I have available for experimentation to use as hosts for XCP-NG:
From a former colleague at Vancouver Island University I acquired two Dell Optiplex 3070 small towers with specs:
- Intel i5-9500 6-core 3.0GHz CPU
- 32GB RAM
- 256GB NVME SSD
These were passed on very recently and replaced with two Lenovo ThinkStation P340 machines with specs:
- Intel i7-10700 8-core 2.90GHz CPU
- 32GB RAM
- 500GB NVMe SSD
- Quadro P1000 video card
Around the same time I acquired some “big guns” from my local municipal government IT department who were decommissioning a rack in their IT facility. I scored a whole stack of servers that are old and outdated, including a 30amp UPS, that I ended up passing on to a former student of mine from VIU. I decided, however, to keep the following from that stack:
- Dell PowerEdge R740
- 2x Intel Xeon Gold 6234 CPU
- 372GB ECC RAM
- 4x 1.92TB SAS SSDs, 12x 2TB SAS HDDs
- 2x 10GBe integrated NIC
- 2x 10GBe SFP integrated NIC
- PERC H800 PCI HBA
- Dell MediaVault 1220
- 24x 1TB SAS HDDs
I will write a blog post about this “new-to-me” server and DAS appliance once I come up with a plan for them and stop crying about the power usage (they idle at over 200w).
Finally to round it out, I built a new gaming machine earlier this year with some used parts I bought locally from Craigslist and turned it into a virtualized gaming machine with on-par performance to a native Windows installation (details for this to be discussed in a future post):
- AMD Ryzen 9 5900X 3.7GHz 12-core CPU (with a B550M Aorus PRO-P motherboard and 32GB RAM)
- 500GB NVME SSD (had on hand already)
- Nvidia RTX 3060 (had on hand already)
- various USB peripherals
Having more processing power and memory available than you know what to do with at your disposal is a fun world to live in!
Virtual Machines #
Some of the VMs I’ve ran on these machines in the XCP-NG pools are:
- Multiple Ubuntu Server VMs, one running Dockge with a few docker containers I want to isolate from running on my unRAID server, and one running my Komodo Core controller. I plan to migrate the Dockge containers to a dedicated stack in my Komodo-based infrastructure soon.
- A Windows 11 Pro VM for gaming with the RTX 3060 and XBox USB controller passed through to the OS; a followup specifically on this topic will come soon but XCP-NG makes this whole concept too easy. Performance seems as good if not better than bare-metal which is crazy to me, and I can do backups/snapshots easily with Xen Orchestra using a remote NFS mount on my unRAID server for the storage.
- Various Linux distributions that I am playing with now that I have resources to run multiple VMs at once.
My plan moving forward is to start using some of these resources to experiment with Kubernetes and other DevOps/infrastructure tooling.
Conclusion #
Experimenting and playing around with technologies like these allow me to not only replace existing services I use (and sometimes pay for) with free and open-source versions. It also helps me build me the confidence to run the infrastructure myself, own my data, and modify the environment it runs in as I see fit; I can make destructive changes in an OS and revert to a prior snapshot at any time without worrying! This helps reinforce certain concepts and allows me to play with solutions to problems I have on the fly. Venturing into the world of self-hosting and “homelab” has truly freed my mind, and I am very excited to keep up this journey!