Showing posts with label proxmox. Show all posts
Showing posts with label proxmox. Show all posts

Monday, June 23, 2025

Homelab Adventures, part 6: Playing with Proxmox VM management

Herding the cats VMs

Before doing any more Kubernetes work I need to get my VMs under control. I need a way to group related VMs together, and ideally manage them as a group. I also want to be able to quickly spin up new VM instances.

The first one is easy. I use the pulldown menu in the top left of the Proxmox console to switch to Tag View, and then assign my Kubernetes The Hard Way VMs a tag. I'll label them kthw:

Assigning a tag to a VM in the Proxmox console

To tag a VM select it, click on the pencil icon, and pick the tag you want, or type a new one. As a bonus Proxmox automatically color-codes tags, and groups tagged VMs together.

I can work on these VMs as a group in bulk operations by specifying the tag. For instance, I can start all the Kubernetes The Hard Way VMs in one operation by choosing kthw in the "Include Tags" box of the Bulk Start dialog:

Proxmox bulk start dialog, with all VMs tagged kthw selected

This gives me what I need to manage my VMs.

Send in the clones

Proxmox will let me convert any VM into a template, which I can then use as a base for additional VMs.

First I create a new VM, using the same Debian 12 install iso as before. I make two changes in the install process: I manually partition the virtual disk to eliminate the swap partition, so I don't have to manually disable swap post-install, and I skip installing the "Debian Desktop" software.

Once the install completes I log in to the VM, do the usual steps of enabling root ssh logins adding my local user to the sudo group, and installing some essential software:

# Truncate the too-verbose motd
echo 'Your motd here' > /etc/motd

# Essential software
apt install curl git zip unzip

# Cleanup
apt update
apt upgrade
apt autoremove

Let's see how big the VM is:

root@debian12:~# df -k /
Filesystem     1K-blocks    Used Available Use% Mounted on
/dev/sda1       32845584 1807868  29343716   6% /

Plenty of room for additional software.

Now stop the VM, right-click on the VM name, select "Convert to template", and behold:

Proxmox VM window, showing a template VM

I've given my template a name reflecting its creation date, since the VM can no longer be updated after being converted to a clone.

I've got my VM tools ready. Time to attack Kubernetes again.

Sunday, May 11, 2025

Homelab Adventures, part 1: Installing Proxmox

The saga of an ancient Dell server, and goodbye OpenSolaris

Having some free time on my hands as a result of being DOGE'd- my employer was heavily reliant on now-frozen NIH and NSF contracts- I decided to take the opportunity to learn more about Kubernetes. I had dabbled enough in it to see its potential for the kind of work I did, but was never able to explore it in depth.

Also as a result of being DOGE'd, I needed to spend as little money as possible on this. Luckily, I had an unused Dell server lying around (I'm a computer person, so of course I have a collection of surplus computers, boards, and accessories in the basement. And someday I'll need that Centronics printer cable). It was over a decade old, and only had 2 gb of memory, but its processor supported VT-x, so it should work as a KVM box, albeit a slow one. 

My plan was to install a KVM, then spin up a Kubernetes cluster as described in Kubernetes the Hard Way.  After some research I decided to use Proxmox for the KVM. It was free for home use, well regarded, and looked relatively simple to use. In a couple of days, I had this:

Proxmox management console for my homelab


But not without a few mistakes along the way.

Resurrecting the dead (server)

I gave the Dell box a good cleaning before powering it up, blasting away the dust bunnies in its interior, including clearing a felt-like coat from the largest CPU heatsink I've ever seen. While people have strong opinions about vendors (to put it mildly), I've always been impressed by Dell's servers and business-grade laptops.

Now, time to give OpenSolaris an honorable farewell.  

I worked with SunOS and Solaris systems from the Sun-3 days through the dot-com era of SPARC servers ruling the internet. I ran OpenSolaris on this machine (and am now running OmniOS on its replacement) because the CDDL-licensed version of ZFS is both bulletproof and drop-dead simple to manage. And because I hate Larry Ellison with the fire of a thousand suns.

Time to power things up and see if everything still works:

♫ Won't you give me one last boot... ♫ [apologies to Hikrau Utada]

After a quick check that there was nothing on the machine I still needed, I rebooted into the BIOS, enabled VT-x, and set USB as the first bootable device.

Then it was time to install Proxmox. I downloaded the iso, burned a bootable USB drive with Rufus, and booted the Dell back up. After that I simply followed the installation instructions in the Proxmox administration document. I kept the old hostname and static IP address, so I wouldn't have to tinker with my home DNS configuration, completed the install, and rebooted.

To a blank screen.

The disk the install had found and configured as the boot disk,wasn't the first disk in boot order. Three tries later (on a four-disk machine) I had the order right, and a Proxmox console showing on my browser.

The install had also only used one of the four disks. I used the Wipe Disk and Initialize Disk with GPT controls on the console to clear the other three disks, then allocated the disks as follows:

I formatted one disk as a single partition, and added this to the LVM logical volume, which seemed severely undersized. While I haven't used Linux's physical/logical volume tools for a long time, doing this was pretty straightforward, though tedious enough to remind me why I prefer ZFS' "throw the raw disk into a pool" simplicity.

I created a ZFS pool from the second disk. I'll use this for virtual disks for my VMs.

I carved an 8 gb swap partition out of the lastdisk, and reconfigured the system to use this for swap instead of the swapfile in the LVM volume. I don't expect a dedicated swap drive to turn a system with only 2 gb of memory into a speed demon, but it should give a slight performance boost, and even if I wasn't trying to be frugal I'd be reluctant to put in the effort required to track down compatible vintage ECC DRAMs for this machine. If I can scrounge up a cheap SATA SSD I'll use that for swap, instead.

Now it's time to install my VMs. And discover just how ancient that Dell's processor is.