Rename and tag an instance
Change an instance's hostname, add tags, and copy the identifiers support and the API ask for.
In the dashboard
The Settings tab holds an instance's name, its tags and the identifiers that support and the API ask for. 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 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 Name 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 Reboot now so the guest picks it up. Leave it clear to apply the name at the next start.
- Select Save hostname.
The Cloud Compute list and the instance header show the new name at once. Inside the instance, cloud-init sets it as the hostname at the next start or restart from the dashboard. The Hostname card on the Access tab changes the same name, as Change the hostname describes.
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. 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.
- VM ID
- The number of the virtual machine on its host.
- Node
- The host the instance runs on, with its location.
- 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 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 TroubleshootingLetters, digits and dashes only; up to 63 characters; no leading or trailing dash.- 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.
- Reboot now so the guest picks it up 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, SSH keys and hostname
- 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, vmid, node_name, location_name, service_id, created_at and status.
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. A stopped instance does not start, even when it says true. A name that breaks the rules answers 400 with Invalid hostname, or 422 when it is longer than 63 characters.
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.