Migrate
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.
Global Arguments
| Argument | Type | Description |
|---|---|---|
| sshUser | string | Default SSH user for src/dst/tool hosts (overridable per call) |
| sshPort? | number | Default SSH port (omit for 22) |
| migrationKeyPath? | string | Private key path *on the source host* for direct-mode inner ssh; when |
| connectTimeoutSec | number | |
| taskTimeoutSec | number | Max seconds for a stream/edit (disk copies are long) |
| Argument | Type | Description |
|---|---|---|
| srcHost | string | |
| srcUser? | string | |
| dstHost | string | |
| dstUser? | string | |
| srcDevPath | string | |
| dstDevPath | string | |
| expectedBytes? | number | |
| mode | enum | |
| blockSize | string | |
| zstdLevel | number | |
| zstdThreads | number | |
| sparse | boolean |
| Argument | Type | Description |
|---|---|---|
| toolHost | string | |
| toolUser? | string | |
| targetMode | enum | |
| nbdHost? | string | |
| nbdPort | number | |
| nbdDevice | string | |
| localDevPath? | string | |
| vgName | string | |
| lvName | string | |
| mountPoint | string | |
| lvmGlobalFilter | string | |
| targetMac | string | |
| useDhcp | boolean | |
| staticCidr? | string | |
| gateway? | string |
| Argument | Type | Description |
|---|---|---|
| ip | string | |
| port | number | |
| mode | enum | |
| expectReachable | boolean | |
| timeoutSec | number | |
| pollIntervalSec | number |
Resources
VM migration run summary: joins the Proxmox vm_spec, TrueNAS zvol/VM/
- 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