update-os.sh¶
Updates a VM's operating system based on its type (NixOS or Debian/Ubuntu).
Usage¶
Parameters¶
| Parameter | Description | Example |
|---|---|---|
vmname | Name of the VM | nextcloud |
vmid | Proxmox VM ID | 610 |
node | Proxmox node name | tappaas1 |
Example¶
What it does¶
- Waits for VM to get an IP address (via guest agent or DHCP leases)
- Updates SSH known_hosts
- Detects OS type (NixOS or Debian/Ubuntu)
- For NixOS:
- Runs
nixos-rebuildusing./<vmname>.nixin current directory - Reboots VM to apply configuration
- Waits for VM to come back up
- For Debian/Ubuntu:
- Waits for cloud-init to complete
- Runs
apt-get update && apt-get upgrade - Installs QEMU guest agent
- Fixes DHCP hostname registration via NetworkManager
Requirements¶
- For NixOS VMs:
./<vmname>.nixmust exist in current directory - SSH access to VM as tappaas user
- QEMU guest agent installed on VM
See Also¶
- install-vm.sh - VM creation library
- update-ha.sh - HA and replication management