Skip to main content

Migrate

@mccormick/migratev2026.06.09.1· 2mo agoMODELSREPORTS
01README

Host-to-host VM disk migration primitives for swamp. The @mccormick/migrate/disk model is the hypervisor-neutral middle of a VM lift-and-shift. stream copies a powered-off source block device to a destination block device over an encrypted, compressed pipe (dd | zstd | ssh "zstd -dc | dd conv=sparse"), either direct (source→dest) or relayed through the swamp host, with auto probing which is reachable and verifying the written byte count. edit_guest_disk is the agent-absent network fallback: it mounts the guest's LVM root over qemu-nbd (or locally) on a tool host, rewrites netplan to match by the target MAC, disables cloud-init networking, and tears it all down in a trap. verify polls a cutover IP for TCP/ICMP reachability. Paired with @mccormick/truenas/vm (provisioning) and a Proxmox inspect step, these primitives compose into the migrate-vm workflow. SSH is spawned directly (never sh -c locally) and every interpolated path is POSIX-quoted. The workflow-scoped @mccormick/migrate/summary report joins a run's resources (the Proxmox spec, TrueNAS zvol/VM/device, transfer, network-prep, and verify) into a markdown summary: source→target, firmware mapping, bytes verified, MAC preserved, reachability, and a rollback hint.

02Models1
disk.tsv2026.06.09.1

Global Arguments

ArgumentTypeDescription
sshUserstringDefault SSH user for src/dst/tool hosts (overridable per call)
sshPort?numberDefault SSH port (omit for 22)
migrationKeyPath?stringPrivate key path *on the source host* for direct-mode inner ssh; when
connectTimeoutSecnumber
taskTimeoutSecnumberMax seconds for a stream/edit (disk copies are long)
fn stream()
Stream a powered-off source block device to a destination block
fn edit_guest_disk()
Offline netplan fix: mount the guest LVM root over qemu-nbd/local on
fn verify()
Poll an IP for TCP/ICMP reachability after cutover. Fails if the

Resources

transfer— Result of one host-to-host disk stream
guest_disk_edit— Result of an offline guest-disk edit
03Reports1
@mccormick/migrate/summaryworkflow
summary.ts

VM migration run summary: joins the Proxmox vm_spec, TrueNAS zvol/VM/

migrationvirtualizationsummary
04Previous Versions2
2026.06.07.2
2026.06.07.1
05Stats
A
100 / 100
Downloads
1
Archive size
27.0 KB
  • Has README or module doc2/2earned
  • README has a code example1/1earned
  • README is substantive1/1earned
  • Most symbols documented1/1earned
  • No slow types (deprecated)1/1earned
  • Dependencies pass trust audit2/2earned
  • Has description1/1earned
  • Platform support declared (or universal)2/2earned
  • License declared1/1earned
  • Verified public repository2/2earned
06Platforms
07Labels