Move to Pantech / Connect other clouds
Connect DigitalOcean, Hetzner, Linode, Vultr, Contabo or OpenStack
Connect a cloud that only offers API tokens through the Pantech Migrate agent, with a read-only token that never leaves your machine, and the exact scopes to give it on each cloud.
These clouds have no way to trust Pantech as an identity provider: they only offer API tokens. So Pantech never asks for one. You make a read-only token in your cloud, give it to the Pantech Migrate agent on a machine of yours, and the agent reads your cloud with it and uploads only what it found. The token is never sent to Pantech.
You need to be an Owner or Admin of your Pantech organization, and able to create a token (or a restricted user) in your cloud.
How it works
- You create a connection with the cloud's
provider. It gets an id likeccn_06gk3x9tq7m2v8r4y1c5d0zp8w, the status awaiting agent, and asetupwhoseagentpart says how to run the agent and make the token. - You make a read-only token in your cloud, with exactly the scopes below.
- You issue a one-time enrollment code in Pantech and enroll the agent with it. The connection is connected as soon as the agent enrolls.
- You keep the agent running, with the token in its environment. When you scan, the agent picks the scan up, reads your cloud and uploads the inventory.
Create the connection
provider is one of digitalocean, hetzner, linode, vultr, contabo or openstack:
$ curl -X POST https://api.pantechdynamics.com/public/v1/cloud-connections \ -H "Authorization: Bearer $PANTECH_API_KEY" \ -H "Idempotency-Key: $(uuidgen)" \ -H "Content-Type: application/json" \ -d '{"provider": "hetzner", "name": "Hetzner production"}'Its setup has access agent, the scopes in permissions, and an agent object:
setup.agent field | What it is |
|---|---|
image | The agent's container image |
download_url | The folder holding the agent program's latest release, for Linux, macOS and Windows with its checksums (install it); null only while none is published, so use image |
api_url | The Pantech API the agent talks to |
token_variables | The environment variables the agent reads your token from, on your machine |
token_how_to | How to make the read-only token in this cloud, the same steps as below |
enroll_command, run_command, container_command | The commands to enroll and run the agent; <ENROLLMENT_CODE> marks where the code goes |
Enroll the agent
Issue a code:
$ curl -X POST https://api.pantechdynamics.com/public/v1/cloud-connections/ccn_06gk3x9tq7m2v8r4y1c5d0zp8w/agent-enrollments \ -H "Authorization: Bearer $PANTECH_API_KEY" \ -H "Idempotency-Key: $(uuidgen)"The response's code (pme_…) is shown only once. It works once, within an hour (expires_at), and issuing another replaces it. Then, on the machine where the agent will run, enroll and start it with your token in the environment:
$ pantech-migrate-agent enroll --api https://api.pantechdynamics.com --code pme_…$ HCLOUD_TOKEN=… pantech-migrate-agent runThe Pantech Migrate agent covers installing it, configuring it for database imports and Kubernetes moves, where it keeps its state, checking a scan before anything is uploaded, and revoking it. The same agent also runs this connection's copy steps; to copy a server it runs on that server instead, which replaces it until you enroll it again.
Before you enroll, pantech-migrate-agent scan --provider hetzner prints exactly what a scan would upload, and uploads nothing: a good way to check the token reads what you expect.
DigitalOcean
The agent reads DIGITALOCEAN_TOKEN.
In DigitalOcean › API › Tokens, generate a token with Custom Scopes and only these read scopes, and give it a short expiry:
account:read, droplet:read, sizes:read, block_storage:read, vpc:read, firewall:read, reserved_ip:read, load_balancer:read, database:read, ssh_key:read, regions:read, billing:read
A scan reads Droplets, volumes, VPCs, cloud firewalls, reserved IPs, load balancers, managed databases, SSH keys, and your invoices for the price comparison. DigitalOcean has no read-only team API, so people are not listed (users_not_listed).
Hetzner Cloud
The agent reads HCLOUD_TOKEN.
In Hetzner Cloud Console › your project › Security › API tokens, generate a token with the Read permission: it can only make GET requests. A token belongs to one project, so connect each project separately.
A scan reads servers, volumes, networks and subnets, firewalls, public IPs, load balancers and SSH keys. Hetzner Cloud has no read-only spend or team API, so the scan says cost_not_available and users_not_listed.
Linode
The agent reads LINODE_TOKEN.
In Cloud Manager › Profile › API Tokens, create a personal access token with Read Only for Account, Linodes, Volumes, VPCs, Firewalls, IPs, NodeBalancers and Databases, and No Access for everything else.
A scan reads Linodes, volumes, VPCs and subnets, firewalls, NodeBalancers, managed databases, SSH keys and invoices. People are the account's users, listed only when the token's user is unrestricted; an unrestricted user is suggested as an Admin on Pantech. Linode dates an invoice the first of the month after the one it bills.
Vultr
The agent reads VULTR_API_KEY.
Vultr API keys have no read-only scope, so the key comes from a separate, restricted user. Under Account › Users, create a user with only the subscriptions_view and billing permissions, turn on its API access, restrict that access to the address the agent runs from, and use that user's API key.
A scan reads instances, block storage, VPCs, firewall groups, reserved IPs, load balancers, managed databases, SSH keys and invoices (the billing permission). Listing Vultr's users needs a permission that can also change the account, so people are not listed (users_not_listed).
Contabo
The agent reads CONTABO_CLIENT_ID, CONTABO_CLIENT_SECRET, CONTABO_API_USER and CONTABO_API_PASSWORD.
Contabo has no scoped tokens. In the Customer Control Panel › Users and Roles, create a role that is not an admin role and allows only READ on /v1/compute/instances, /v1/private-networks, /v1/firewalls, /v1/vips and /v1/users. Assign it to a new user, and use that user's API credentials.
A scan reads instances, private networks, firewalls, VIPs and users. SSH keys are not read, because Contabo keeps them together with passwords (ssh_keys_not_read): add them to Pantech yourself. Contabo has no read-only spend API (cost_not_available). The account owner, or a user with an admin role, is suggested as an Admin on Pantech.
OpenStack
The agent reads OS_AUTH_URL, OS_APPLICATION_CREDENTIAL_ID and OS_APPLICATION_CREDENTIAL_SECRET, and OS_REGION_NAME if you set it.
Create an application credential with only the reader role:
$ openstack application credential create pantech-migrate --role reader --restrictedIf your cloud supports access rules on application credentials, allow GET only.
A scan reads servers, volumes, networks and subnets, security groups, floating IPs, load balancers and key pairs. OpenStack has no standard spend or team API, so the scan says cost_not_available and users_not_listed.
Nobus and other OpenStack-based clouds
A cloud built on OpenStack can be connected as openstack only if it gives you a public Keystone endpoint (your OS_AUTH_URL) and application credentials. Nobus does not document one, so contact support before you start, and we will check it with you.
If a scan fails
| Code | What it means | What to do |
|---|---|---|
agent_offline | No agent picked the scan up within an hour | Check the agent is running (pantech-migrate-agent run) and enrolled for this connection, then scan again |
token_rejected | Your cloud refused the token the agent uses | Check the token is still valid and has the scopes above, then scan again |
invalid_upload | The agent sent a scan Pantech couldn't read | Update the agent to the latest version and scan again |
The connection shows the agent under agent: its version and platform, online (it polled in the last two minutes), and when it was last seen. Troubleshooting has every code.
Disconnect
- In Pantech, disconnect the connection:
DELETE /cloud-connections/{connection_id}, or ask your AI app. The agent's credential stops working at once. To keep the connection and only stop the agent, revoke it instead. - In your cloud, delete the token, or the restricted user you made for it.
- On your machine, stop the agent and delete its state file.