Rename and tag an instance
Change an instance's hostname in one place, add tags, and copy the identifiers support and the API ask for.
In the dashboard
The Settings tab holds an instance's hostname, its tags and the identifiers that support and the API ask for. It is the only place that changes the hostname. It also links to the tabs where you rebuild or cancel the instance.
Before you begin
Section titled Before you begin- A new name reaches the inside of the instance when you next start or restart it from the dashboard. To apply it at once, the instance must be running so that it can restart. The hint under the field says the same.
- The instance must not be suspended or moving to another host. Renaming a suspended instance fails with
Instance is suspended.
Rename the instance
Section titled Rename the instance- In the dashboard, go to Cloud Compute, open the instance and select the Settings tab.
- On the Hostname card, type the new name under Hostname. Use letters, digits and hyphens, up to 63 characters, with no hyphen at the start or end.
- To apply it now, tick Restart now to apply the name. Leave it clear to apply the name at the next start.
- Select Save hostname.
A message confirms Hostname saved. The Cloud Compute list and the instance header show the new name at once. Inside the instance, the name applies at the next start or restart from the dashboard.
A hostname is one label, such as web-2, and it creates no DNS record. To reach the instance at a name such as web-2.example.com, follow Manage an instance's addresses and names.
Tag the instance
Section titled Tag the instance- On the Tags card, type a tag in Add a tag, such as
production. - Press Enter or select Add tag. Suggestions offers tags you already use on other instances.
- To remove a tag, select the cross on its chip.
A tag uses lowercase letters, digits and hyphens, and starts with a letter or a digit. The dashboard saves each change at once. Tags on the instance filter the Cloud Compute list (Search, filter and sort). Its service keeps a separate set, as Tag your services explains.
Find the instance's identifiers
Section titled Find the instance's identifiersThe Identifiers card lists what support asks for when you contact them.
- Instance
- The instance's ID, a UUID. The card shows its first eight characters. Select Copy instance ID to copy all of it. The API uses this ID in every Cloud Compute path.
- Location
- Where the instance runs.
- Operating system
- The image the instance was created or last rebuilt from. It shows
—when we have no record of the image. - Service
- The service that carries the instance's plan and billing, as
#and its number. Select it to open the service. - Created
- When we created the instance.
- State
- Whether the instance is running or stopped now.
Rebuild or cancel the instance
Section titled Rebuild or cancel the instanceThe Danger zone card links to the two actions that erase the instance's data. Each one asks you to type a word before it goes ahead.
- Rebuild operating system wipes the disk and its snapshots, and installs a fresh image. Select Open Access to go to the Access tab, then follow Rebuild an instance.
- Cancel service stops billing and deletes the instance. Select Open Billing to go to the Billing tab, then follow Cancel the instance.
Result
Section titled ResultThe instance has its new name in the dashboard at once. Inside the instance, the name applies after the next start or restart from the dashboard. The instance's tags show on the Tags card and in the Cloud Compute list.
Troubleshooting
Section titled TroubleshootingUse letters, digits and dashes, up to 63 characters, with no dash at the start or end.- The name has a dot, a space or another character a hostname cannot hold, or it is too long. Use one label, such as
web-2. - Save hostname stays greyed out
- The name is the one the instance already has, or it breaks the rules above. Change it, or correct the mistake the field shows.
- Restart now to apply the name is greyed out
- The instance is stopped. Save the name without it. The instance takes the name when you start it.
hostnameinside the instance still prints the old name- The instance has not booted since you saved the name. Select Restart in the instance header. A
reboottyped inside the instance does not apply the name. Instance is suspended- We suspended the instance, usually for an unpaid invoice. Select Open Billing in the alert at the top of the page and pay the open invoice.
- Could not save the tags with
Tag must be 1–128 chars: lowercase letters, digits, hyphen, underscore - The tag has a character that tags cannot hold, such as a dot, a colon or a slash, or it starts with a hyphen. Use lowercase letters, digits and hyphens.
Related
Section titled Related- Manage an instance's password and SSH keys
- Tag your services
- Rebuild an instance
- Change an instance's plan or cancel it
- Contact support from the dashboard
With the API
Section titled With the APIGET /api/v1/client/vps/{uuid} returns the identifiers on this tab: uuid, location_name, template_name, service_id, created_at and status. template_name is missing when we have no record of the image. It also carries vmid and node_name, the host's own names for the instance, which the tab leaves out. The response also carries installed_os, which names the host's operating system.
curl -s https://api.coritan.com/api/v1/client/vps/$INSTANCE_UUID \
-H "Authorization: Bearer $CORITAN_TOKEN"
To rename the instance, send hostname. Add "reboot": true to restart it at once.
curl -s -X PATCH https://api.coritan.com/api/v1/client/vps/$INSTANCE_UUID/hostname \
-H "Authorization: Bearer $CORITAN_TOKEN" \
-H "Content-Type: application/json" \
-d '{"hostname": "web-2", "reboot": true}'
{"hostname": "web-2", "rebooted": true}
rebooted repeats what you asked for, and it is false when you leave reboot out. A stopped instance does not start, even when it says true. A name that breaks the rules answers 422, and its detail says what to change, such as A hostname can be at most 63 characters. A suspended instance answers 403 with Instance is suspended.
An instance's tags use the source type vps and the instance's UUID:
curl -s -X PUT https://api.coritan.com/api/v1/client/tags/sources/vps/$INSTANCE_UUID \
-H "Authorization: Bearer $CORITAN_TOKEN" \
-H "Content-Type: application/json" \
-d '{"tags": ["production", "eu-customers"]}'
Tag your services covers the rest of the tags API. The Cloud Compute API reference lists every field.
API operations on this page
| Method | Path | What it does |
|---|---|---|
PATCH | /api/v1/client/vps/{uuid}/hostname | Patch hostname |