ployzctl migrate — move workloads
The migrate command moves a workload — container and persistent volumes — from one machine to another within the cluster. Migration uses ZFS incremental send to transfer volume state efficiently, with minimal downtime. It is a single explicit operation with a clear result: the workload is running on the target machine or the command fails cleanly.
ployzctl migrate <subcommand> <service-ref> --to <machine> [flags]Identifying a service
Section titled “Identifying a service”The service-ref positional argument identifies the workload to migrate. It takes the form namespace/service-name, for example production/web or staging/worker.
Subcommands
Section titled “Subcommands”preview — preview a migration
Section titled “preview — preview a migration”Compute the migration plan without executing it. Returns what would be transferred, which volumes are involved, and the target machine. Use this before any production migration.
ployzctl migrate preview <service-ref> --to <machine>-
service-ref(string) required:The service to migrate, in
namespace/serviceformat. -
--to(string) required:ID or address of the target machine to migrate the workload to.
The preview response includes the target machine, the service’s current placement, and the list of volumes that will be transferred.
apply — execute a migration
Section titled “apply — execute a migration”Execute the migration. The daemon stops the workload on the source machine, transfers its volumes using ZFS incremental send, and starts it on the target machine.
ployzctl migrate apply <service-ref> --to <machine>-
service-ref(string) required:The service to migrate, in
namespace/serviceformat. -
--to(string) required:ID or address of the target machine.
render-manifest — render the migration manifest
Section titled “render-manifest — render the migration manifest”Render the manifest that describes the migration operation, without applying it. Useful for auditing, storing in version control, or applying manually.
ployzctl migrate render-manifest <service-ref> --to <machine>-
service-ref(string) required:The service to migrate, in
namespace/serviceformat. -
--to(string) required:ID or address of the target machine.
Outputs the manifest to stdout.
How migration works
Section titled “How migration works”- The daemon snapshots all ZFS volumes attached to the service on the source machine.
- The snapshot is sent to the target machine using ZFS incremental send over the cluster’s WireGuard overlay network.
- Once the transfer is complete, the workload is stopped on the source and started on the target from the received volumes.
- The cluster membership and routing records are updated to reflect the new placement.
Because ZFS send is incremental, migrating a service that was previously migrated (or whose volumes were cloned from the target) transfers only the delta since the last common snapshot — making repeated migrations between the same pair of machines fast.
Recommended workflow
Section titled “Recommended workflow”Preview the migration
Section titled “Preview the migration”Confirm the source placement, target machine, and volumes involved.
ployzctl migrate preview production/worker --to machine-bDrain the source machine (optional)
Section titled “Drain the source machine (optional)”If migrating because of planned maintenance, drain the source first to stop new workload placements.
ployzctl machine drain machine-aApply the migration
Section titled “Apply the migration”Execute the migration. The daemon returns when the workload is running on the target.
ployzctl migrate apply production/worker --to machine-bVerify
Section titled “Verify”Confirm the service is running on the expected machine.
ployzctl --json machine lsExamples
Section titled “Examples”# Preview migrating the 'worker' service in production to machine-bployzctl migrate preview production/worker --to machine-b
# Apply the migrationployzctl migrate apply production/worker --to machine-b
# Get the migration manifest as JSONployzctl --json migrate render-manifest production/worker --to machine-b