Add pve1->pve-test VM/CT migration script (vzdump + qmrestore pattern) #32

Closed
beatzaplenty wants to merge 2 commits from worktree-migrate-vm-script into main
Owner

Adds scripts/proxmox/migrate-vm.sh, built on the same vzdump/relay/restore pattern as clone-pve1-to-pve-test.sh, but as a migration (move) rather than a clone:

  • Restores with the original MAC by default (no --unique) since the source is being retired, not left running alongside the target (opt in via --unique for a fresh MAC anyway).
  • Adds a cutover step: stop the guest on the source node, then start it on the target (skip with --no-start).
  • Adds --remove-source to destroy the now-stopped guest on the source node afterward -- irreversible, so it gets its own separate typed confirmation. Default behavior leaves the stopped guest intact on the source as a safety net.
  • Generic node-to-node (--source-node/--target-node), defaulting to pve1 -> pve-test like the clone script, since a real Proxmox cluster could have more than two nodes.
  • Documents clearly that this is not a true qm migrate live migration: pve1/pve-test aren't a clustered pair with shared storage, so vzdump (not incremental) is the closest equivalent. With the default --mode snapshot, writes on the source between the snapshot and cutover are lost; --mode stop avoids that at the cost of downtime for the whole backup duration instead of just cutover.
  • --dry-run and --keep-backup throughout, matching the clone script.

Also backfills a CLAUDE.md doc entry for clone-pve1-to-pve-test.sh, which had shipped without one, alongside the new entry for migrate-vm.sh.

No .nix files touched, so codex-maintenance.sh has nothing to check here; validated with bash -n and shellcheck (only the same info-level SC2029 notices already present in the clone script, from the same intentional client-side-expansion pattern).

https://claude.ai/code/session_013Lkv8k24Wuua3GRxrfMBLz

Adds `scripts/proxmox/migrate-vm.sh`, built on the same vzdump/relay/restore pattern as `clone-pve1-to-pve-test.sh`, but as a *migration* (move) rather than a clone: - Restores with the **original MAC** by default (no `--unique`) since the source is being retired, not left running alongside the target (opt in via `--unique` for a fresh MAC anyway). - Adds a **cutover** step: stop the guest on the source node, then start it on the target (skip with `--no-start`). - Adds `--remove-source` to destroy the now-stopped guest on the source node afterward -- irreversible, so it gets its own separate typed confirmation. Default behavior leaves the stopped guest intact on the source as a safety net. - Generic node-to-node (`--source-node`/`--target-node`), defaulting to pve1 -> pve-test like the clone script, since a real Proxmox cluster could have more than two nodes. - Documents clearly that this is **not** a true `qm migrate` live migration: pve1/pve-test aren't a clustered pair with shared storage, so vzdump (not incremental) is the closest equivalent. With the default `--mode snapshot`, writes on the source between the snapshot and cutover are lost; `--mode stop` avoids that at the cost of downtime for the whole backup duration instead of just cutover. - `--dry-run` and `--keep-backup` throughout, matching the clone script. Also backfills a `CLAUDE.md` doc entry for `clone-pve1-to-pve-test.sh`, which had shipped without one, alongside the new entry for `migrate-vm.sh`. No `.nix` files touched, so `codex-maintenance.sh` has nothing to check here; validated with `bash -n` and `shellcheck` (only the same info-level `SC2029` notices already present in the clone script, from the same intentional client-side-expansion pattern). https://claude.ai/code/session_013Lkv8k24Wuua3GRxrfMBLz
beatzaplenty added 1 commit 2026-07-21 23:01:14 +00:00
Add pve1->pve-test VM/CT migration script (vzdump + qmrestore pattern)
Check NixOS configurations / eval-hosts (pull_request) Successful in 10m29s
d35b7c4b57
Reuses the clone script's vzdump/relay/restore flow but as a move rather
than a copy: preserves the original MAC by default, adds a stop-source/
start-target cutover step, and an opt-in --remove-source to destroy the
source guest afterward. Not a true qm migrate (nodes aren't clustered),
so the default --mode snapshot has a documented write gap between
snapshot and cutover; --mode stop avoids it at the cost of downtime.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013Lkv8k24Wuua3GRxrfMBLz
beatzaplenty marked the pull request as work in progress 2026-07-21 23:01:31 +00:00
beatzaplenty marked the pull request as ready for review 2026-07-21 23:02:06 +00:00
beatzaplenty added 1 commit 2026-07-21 23:02:08 +00:00
Merge branch 'main' into worktree-migrate-vm-script
Check NixOS configurations / eval-hosts (pull_request) Successful in 10m20s
60fd64f0f7
beatzaplenty closed this pull request 2026-07-21 23:02:20 +00:00
This repo is archived. You cannot comment on pull requests.
No Reviewers
No labels
1 Participants
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: beatzaplenty/nixos#32