Documentation

esc
    Move to Pantech / Copy servers

    Copy servers and disks

    Copy a planned server's disks into a new Pantech machine, from the Pantech Migrate agent on the server or keylessly from EBS snapshots on AWS, in passes that keep the server running, then cut over.

    A server copy moves one planned server, with all its disks, into a new Pantech machine in your organization. It copies while the server keeps running, in passes, and builds the machine only when you cut over. The new machine boots from the copied disks: same operating system, software, users and keys.

    You need a plan with the server as a planned instance item (scan and plan), and the Pantech side it will join: the subnet and security group it goes in, which the plan's Terraform export or the console can create. A copy never creates networks itself. You must be an Owner or Admin, and allowed to create virtual machines (instances:Create): the copy's server is created as you.

    Pantech never logs into your server and never needs its SSH key, .pem file or password: it reads either an AWS snapshot you allowed, or the disks the agent reads when you run it on the server yourself.

    Two ways to read the disks

    SourceHowFor
    agent (the default)The Pantech Migrate agent, run on the server itself, checks the server and sends its disks over HTTPSLinux and Windows servers on any cloud: AWS, Google Cloud, Azure, Huawei Cloud, DigitalOcean, Hetzner Cloud, Linode, Vultr, Contabo and OpenStack
    aws_snapshotPantech reads EBS snapshots with a separate, keyless copy role, and nothing is installed on the serverLinux servers on AWS

    With the agent on the server

    The agent that copies a server runs on that server, as root (Administrator on Windows), and copies only the server it runs on:

    1. Put the agent program on the server (install it). The container cannot read the server's disks.

    2. Enroll it for the plan's connection, on the server, as in the agent. A connection has one agent at a time, so this replaces the agent you run elsewhere for scans, imports and moves until you enroll that one again.

    3. Start the copy with source agent, and note its id (sco_…).

    4. Run the agent on the server with that id:

      Terminal
      $ sudo pantech-migrate-agent run --server-copy sco_06gk3x9tq7m2v8r4y1c5d0zp8w

      Only an agent started this way is handed the copy, and only the copy it names, on a server of the same operating system. A long-running agent elsewhere is never handed a copy, so it can never send its own disks into someone else's machine.

    By default the agent copies the boot disk: on Linux the disk holding /, on Windows \\.\PhysicalDrive0. To copy data disks too, name every disk with --disk, boot disk first (--disk /dev/vda --disk /dev/vdb, or --disk \\.\PhysicalDrive0 --disk \\.\PhysicalDrive1). The agent reads only those disks: a pass that names other disks than the server's own is refused.

    Keep the agent running until you have cut over. A connection copies one server through its agent at a time: copy the next one when this one is done.

    • Consistency. On Linux the agent reads from an LVM snapshot when the disk is a logical volume with free space in its volume group. Otherwise it reads the live disk, and the copy says so with the flag crash_consistent_copy. On the last pass it flushes and freezes every mounted filesystem it can (not the root filesystem, which the agent runs from) while it reads. On Windows it reads each NTFS volume from a Volume Shadow Copy, deleted after the pass.
    • Less to send. Blocks that are all zeros are never sent. On Windows, clusters NTFS marks as free are read as zeros. On Linux, running fstrim -a before the first pass makes free space read as zeros on thin-provisioned disks, so there is less to copy.
    • On the wire. Disks travel compressed and encrypted, in pieces checked on arrival. A later pass sends only what changed, and an interrupted pass resumes where it stopped.

    From AWS snapshots

    Nothing is installed on the server. Pantech reads EBS snapshots with the EBS direct APIs, using a copy role in a second CloudFormation stack, never the connection's read-only role. Get the template for the server:

    Terminal
    $ curl "https://api.pantechdynamics.com/public/v1/migrations/mig_06gk3x9tq7m2v8r4y1c5d0zp8w/server-copy-template?item_key=instance:us-east-1:i-0a1b2c3d4e5f67890&create_snapshots=true" \    -H "Authorization: Bearer $PANTECH_API_KEY"

    Create a stack from its template after the connect stack (it reuses the same identity provider), and keep its CopyRoleArn output. The copy role can:

    ActionsOn
    ebs:ListSnapshotBlocks, ebs:GetSnapshotBlock, ebs:ListChangedBlocks, ec2:DescribeSnapshotsOnly snapshots tagged pantech-migrate-connection with this connection's id (snapshot_tag in the response)
    ec2:CreateSnapshotWith create_snapshots=true only: this server's own volumes, and nothing else
    ec2:CreateTagsWith create_snapshots=true only: snapshots, while they are being created
    ec2:DeleteSnapshotWith create_snapshots=true only: snapshots carrying the connection's tag

    Who makes the snapshots is your choice:

    • You make them (the default): snapshot each of the server's volumes, tag each snapshot pantech-migrate-connection = <connection id>, and pass their ids for each pass.
    • Pantech makes them (create_snapshots: true on the template and the copy): the role makes one snapshot per volume for each pass, and deletes it after the next pass or the import.

    Each block is checked against the checksum AWS gives for it. A copy from snapshots cannot look inside the server, so it carries drivers_not_checked: most Linux kernels have the virtio drivers Pantech needs, but check yours does before cutting over. Windows servers are copied with the agent only (WINDOWS_NEEDS_AGENT).

    Two things cost money on your AWS bill: the snapshots' storage, and the EBS direct API's requests.

    1. Start the copy

    Terminal
    $ curl -X POST https://api.pantechdynamics.com/public/v1/migrations/mig_06gk3x9tq7m2v8r4y1c5d0zp8w/server-copies \    -H "Authorization: Bearer $PANTECH_API_KEY" \    -H "Idempotency-Key: $(uuidgen)" \    -H "Content-Type: application/json" \    -d '{"item_key": "instance:us-east-1:i-0a1b2c3d4e5f67890", "source": "aws_snapshot", "subnet_id": "snet_06gk3x9tq7m2v8r4y1c5d0zp8w", "security_group_id": "sg_06gk3x9tq7m2v8r4y1c5d0zp8w", "aws": {"copy_role_arn": "arn:aws:iam::123456789012:role/PantechMigrateServerCopy-Role-1A2B3C4D5E6F", "create_snapshots": true}}'
    FieldWhat it is
    item_keyThe planned server's item key
    sourceagent (the default) or aws_snapshot
    nameThe new machine's name; the source's when you leave it out
    plan_slugAnother plan than the item's
    subnet_id, security_group_idWhere the new machine goes
    ssh_key_idOptional. The copied disk keeps its own users and keys, so most copies need none
    aws.copy_role_arnFor aws_snapshot: the copy stack's CopyRoleArn
    aws.create_snapshotsFor aws_snapshot: let the copy role make the snapshots
    aws.snapshotsFor aws_snapshot without create_snapshots: the first pass's snapshot for each volume id, like {"vol-0123456789abcdef0": "snap-0123456789abcdef0"}

    The copy starts waiting for its first pass, which copies every disk. With source agent, the pass starts once you run the agent on the server with --server-copy and the copy's id. Nothing is created on Pantech yet, and the copy itself is free.

    The pre-flight

    Before the first byte is copied, the server is checked, and the copy's flags say what was found. A blocking flag stops the copy (it fails with guest_not_fit): fix the server, then start a new copy.

    FlagBlockingWhat it says
    operating_system_not_supported✓Only Linux and Windows servers can be copied.
    guest_architecture_not_supported✓Only x86 (64-bit) servers can be copied. Rebuild ARM software on a new server instead.
    virtio_drivers_missing✓The server's kernel has no virtio disk or network driver, so it would not boot on Pantech. Install a kernel with virtio support (most distribution kernels have it) and rebuild the initramfs.
    windows_virtio_drivers_missing✓Windows needs the virtio storage and network drivers to boot on Pantech. Install the virtio-win guest tools (viostor or vioscsi, and netkvm), restart, then start the copy again.
    windows_not_enabled✓Windows servers aren't enabled for your organization yet. Contact support to turn them on.
    root_disk_too_large_for_plan✓The system disk is larger than the plan's disk. Choose a bigger plan, or move data to another disk first.
    too_many_disks✓A server can be copied with at most 8 disks.
    data_disk_too_large✓A data disk is larger than the largest Pantech volume (16 TiB) or than a copy can take (2 TiB).
    no_disks_reported✓The server reported no disks to copy.
    windows_copy_needs_agent✓Windows servers are copied with the Pantech Migrate agent, which checks the drivers and takes a consistent snapshot. Install the agent on the server.
    secure_boot_turned_offSecure Boot is on. The copy boots in UEFI mode with Secure Boot off.
    boot_mode_unknownThe boot mode couldn't be read; the copy boots in BIOS mode.
    crash_consistent_copyThe disk is read while the server runs, without a snapshot. Stop the application before cutting over so the last pass is consistent.
    cloud_init_missingcloud-init isn't installed, so the copy keeps its old network settings and passwords. Check the server's network starts with DHCP.
    network_config_pinned_to_macThe network settings name the old network card's MAC address. The copy gets a new one, so remove the MAC match or the network won't start.
    fstab_uses_device_names/etc/fstab mounts disks by device name (like /dev/xvdf). Disk names change on Pantech, so mount by UUID or label instead.
    windows_activation_neededThe source's Windows licence doesn't move with the disk. Windows will need to be activated with Pantech's licence.
    drivers_not_checkedCopying from snapshots can't look inside the server. Most Linux kernels have the virtio drivers Pantech needs; check yours does before cutting over.

    BIOS and UEFI servers both boot on Pantech.

    2. Follow it, and sync again

    GET /server-copies/{copy_id} shows the copy:

    FieldWhat it says
    statuswaiting, copying, synced, importing, creating_instance, then completed; or failed or cancelled
    passThe pass running now: its number and kind (full, delta or final)
    pending_passA pass asked for and not started yet
    progressChunks and bytes done of the total, bytes sent over the wire, and eta_seconds
    disksEach disk: root or data, its size, its snapshot, and the Pantech volume it became
    flags, os_family, boot_modeWhat the pre-flight found
    instanceThe machine-to-be: name, plan, region, subnet, security group, and its id and order_id once it is being created
    expires_at14 days after the start: the last moment to cut over

    Once it is synced, ask for another pass whenever you like. It copies only what changed since the last one:

    Terminal
    $ curl -X POST https://api.pantechdynamics.com/public/v1/server-copies/sco_06gk3x9tq7m2v8r4y1c5d0zp8w/sync \    -H "Authorization: Bearer $PANTECH_API_KEY" \    -H "Idempotency-Key: $(uuidgen)" \    -H "Content-Type: application/json" -d '{}'

    For a copy from snapshots you make yourself, send each volume's new snapshot: {"snapshots": {"vol-0123456789abcdef0": "snap-…"}}. One pass runs at a time. Syncing close to the cutover keeps the last pass short.

    3. Cut over

    1. Stop the application on the source server, so nothing writes to its disks.
    2. Cut over: POST /server-copies/{copy_id}/cutover, with the last snapshots in snapshots if you make them yourself. The agent flushes and freezes what it can and copies the last changes.
    3. Pantech checks every chunk of the copy, builds the disks, then creates the machine through the normal create path: it is an order like any new machine, paid for, billed by the hour and counted against your limits. Each data disk becomes a volume attached to it.
    4. The copy is completed, and the machine is running with your disks. Check it, then switch DNS to its address.

    The machine boots with its own users, keys and settings: Pantech passes it no user data, and no SSH key unless you named one. Its addresses are new, so check anything that names the old ones.

    If your organization is over a limit or not in good standing, the machine is not created and the copy fails with quota_exceeded or account_not_in_good_standing: fix it, then start a new copy.

    Cancel

    POST /server-copies/{copy_id}/cancel stops the copy and deletes everything Pantech staged for it. Once the machine is being created, cancel is refused: the machine is yours then, so delete it as any machine.

    Windows servers

    Windows Server is available on request. With Windows turned on for your organization, a Windows server is copied with the agent, which reads each volume from a shadow copy, and becomes a Windows machine billed as Windows machines are. Install the virtio-win guest tools on the source first (the pre-flight checks for them). The source's Windows licence does not move with its disk, so Windows will need activating with Pantech's licence. Contact support to turn Windows on.

    Where the data is kept

    What has been copied is kept encrypted with a key made for that one copy, where nothing else can reach it. Everything held for a copy is deleted as soon as the copy is completed, failed or cancelled, or when it expires 14 days after it started without a cutover. Pantech never mounts, opens or runs what it copies: the disks are attached only to your own new machine.

    Limits

    • 5 copies in progress per organization, one per server.
    • One server at a time copied through each connection's agent.
    • 8 disks per server, each at most 2 TiB (and data disks at most the largest volume, 16 TiB).
    • One pass at a time per copy.
    • 14 days from the start to the cutover.

    The move itself is free. The machine and its volumes bill as usual from the moment they exist. Troubleshooting has every failure and error.

    Was this page helpful?

    Updated