IP addresses and hooks
Keep, change or reassign IP addresses during migration, preserve MAC addresses, and automate routed IP moves with hooks.
IP modes#
Each NIC of a job is mapped to a PikoStack network with an ip_mode:
| Mode | Use |
|---|---|
keep |
Keep the source IP on the new port. For shared layer-2 networks and routed /32 addresses |
static |
Assign a specific new IP |
dhcp |
Let PikoStack choose; remember to update DNS and firewalls |
"mapping": {
"flavor_id": "<plan id>",
"nics": [
{"source_key": "net0", "network_id": "<network id>", "ip_mode": "keep"}
]
}
MAC addresses#
keep_source_mac is on by default. Keep it on for virtual MACs at OVH and Hetzner and for software licensed by MAC address.
Special cases#
- Failover IPs and VRRP: add the extra addresses to
allowed_address_pairs. - Routers and VPN gateways that forward traffic for other networks: set
port_securitytofalsefor that NIC. - Pre-flight refuses IPs and MACs that are already used by another port, and IPs outside the target subnet, before anything is copied.
Hooks#
Hooks are commands the migration service runs at key moments. They receive the job as JSON on standard input and PIKO_MIGRATE_EVENT and PIKO_MIGRATE_JOB in the environment.
| Hook | When | On failure |
|---|---|---|
pre_cutover |
Before the source is quiesced | Cutover is aborted, source keeps running |
pre_boot |
After ports exist, before the target boots | Rollback |
post_cutover |
After verification succeeded | Logged |
rollback |
During a rollback, before the source starts | Logged; the rollback continues |
Example: move a routed failover IP at OVH or Hetzner to the PikoStack host before the target boots, and back on rollback:
hooks:
pre_boot: ["/usr/local/lib/piko-migrate/hooks/move-failover-ip to-target"]
rollback: ["/usr/local/lib/piko-migrate/hooks/move-failover-ip to-source"]
Something unclear or wrong on this page? Tell us. © 2026 PikoStack.