Skip to main content

Migrate

@mccormick/migratev2026.06.09.1· 7d 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
@mccormick/migrate/diskv2026.06.09.1disk.ts

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(srcHost: string, srcUser?: string, dstHost: string, dstUser?: string, srcDevPath: string, dstDevPath: string, expectedBytes?: number, mode: enum, blockSize: string, zstdLevel: number, zstdThreads: number, sparse: boolean)
Stream a powered-off source block device to a destination block
ArgumentTypeDescription
srcHoststring
srcUser?string
dstHoststring
dstUser?string
srcDevPathstring
dstDevPathstring
expectedBytes?number
modeenum
blockSizestring
zstdLevelnumber
zstdThreadsnumber
sparseboolean
fn edit_guest_disk(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)
Offline netplan fix: mount the guest LVM root over qemu-nbd/local on
ArgumentTypeDescription
toolHoststring
toolUser?string
targetModeenum
nbdHost?string
nbdPortnumber
nbdDevicestring
localDevPath?string
vgNamestring
lvNamestring
mountPointstring
lvmGlobalFilterstring
targetMacstring
useDhcpboolean
staticCidr?string
gateway?string
fn verify(ip: string, port: number, mode: enum, expectReachable: boolean, timeoutSec: number, pollIntervalSec: number)
Poll an IP for TCP/ICMP reachability after cutover. Fails if the
ArgumentTypeDescription
ipstring
portnumber
modeenum
expectReachableboolean
timeoutSecnumber
pollIntervalSecnumber

Resources

transfer(infinite)— Result of one host-to-host disk stream
guest_disk_edit(infinite)— Result of an offline guest-disk edit
verify(infinite)— Result of a post-cutover reachability check
03Reports1
@mccormick/migrate/summaryworkflow
summary.ts

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

migrationvirtualizationsummary
04Previous Versions2
2026.06.07.2Jun 7, 2026
2026.06.07.1Jun 7, 2026
05Stats
A
100 / 100
Downloads
0
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