From 0736f29f793fddd526522098836355f5a05a11a2 Mon Sep 17 00:00:00 2001 From: counterweight Date: Sun, 22 Mar 2026 21:25:08 +0100 Subject: [PATCH] little thingies --- 03_vm_disk_enlargement.md | 69 ++++++++++++++++++++++++ ansible/infra/420_system_healthcheck.yml | 2 +- 2 files changed, 70 insertions(+), 1 deletion(-) create mode 100644 03_vm_disk_enlargement.md diff --git a/03_vm_disk_enlargement.md b/03_vm_disk_enlargement.md new file mode 100644 index 0000000..260a3ea --- /dev/null +++ b/03_vm_disk_enlargement.md @@ -0,0 +1,69 @@ +# 03 VM Disk Enlargement + +How to enlarge the disk of an existing Proxmox VM that was provisioned via the tofu project. + +## Overview + +Since the tofu VM resource uses `ignore_changes = all` in its lifecycle block, disk resizes are performed manually through the Proxmox UI and then expanded inside the guest OS. You should still update the tofu vars to keep them in sync with reality. + +## Step 1: Update disk size in tofu vars + +* Edit `tofu/nodito/terraform.tfvars` and bump the `disk_size_gb` value for the VM you want to resize. +* This won't trigger any actual change (because of `ignore_changes = all`), but keeps the declared state consistent so future readers know the real disk size. + +## Step 2: Resize the disk in Proxmox + +* Open the Proxmox web UI and navigate to the VM. +* Go to the **Hardware** tab. +* Select the **Hard Disk** entry (scsi0). +* Click **Disk Action** > **Resize**. +* Enter the amount of additional space you want to add (this is the increment, not the total). For example, to go from 10 GB to 30 GB, enter `20`. +* Click **Resize disk**. + +The VM does **not** need to be stopped for this operation. Proxmox will grow the underlying block device while the VM is running. + +## Step 3: Expand the partition and filesystem inside the VM + +SSH into the VM and run these steps as root (or with `sudo`). + +### Check the current layout + +```bash +lsblk +``` + +You should see that the disk (`sda`) now shows the new total size, but the root partition (`sda1`) still has the old size. + +### Grow the partition + +Install `cloud-guest-utils` if `growpart` is not available: + +```bash +apt install -y cloud-guest-utils +``` + +Then grow the root partition to fill all available space: + +```bash +growpart /dev/sda 1 +``` + +> Note the space between the device and the partition number. + +### Resize the filesystem + +For ext4 (the default for Debian cloud images): + +```bash +resize2fs /dev/sda1 +``` + +This works online; no reboot is required. + +### Verify + +```bash +df -h / +``` + +The root filesystem should now reflect the new size. diff --git a/ansible/infra/420_system_healthcheck.yml b/ansible/infra/420_system_healthcheck.yml index fa507bd..2580ff0 100644 --- a/ansible/infra/420_system_healthcheck.yml +++ b/ansible/infra/420_system_healthcheck.yml @@ -61,7 +61,7 @@ retries = int(sys.argv[8]) ntfy_topic = sys.argv[9] if len(sys.argv) > 9 else "alerts" - api = UptimeKumaApi(api_url, timeout=60, wait_events=2.0) + api = UptimeKumaApi(api_url, timeout=120, wait_events=2.0) api.login(username, password) # Get all monitors