Skip to main content

instances

Creates, updates, deletes, gets or lists an instances resource.

Overview

Nameinstances
TypeResource
Idlinode.linode.instances

Fields

The following fields are returned by SELECT queries:

Returns a single Linode object.

NameDatatypeDescription
idintegerFilterable, Read-only This Linode's ID which must be provided for all operations impacting this Linode.
lke_cluster_idintegerRead-only The ID of the Kubernetes cluster if the Linode is part of cluster.
alertsobject
backupsobjectInformation about this Linode's backups status. For information about available backups, run List backups.
capabilitiesarrayLimited availability, Read-only A list of capabilities this compute instance supports.
createdstring (date-time)Read-only When this Linode was created. (example: 2018-01-01T00:01:01)
disk_encryptionstringRead-only Indicates the local disk encryption setting for this Linode. If the Linode is part of an LKE cluster, the value is null. (default: enabled, example: disabled)
groupstringDeprecated, Filterable The group label for this Linode. (example: Linode-Group)
has_user_databooleanRead-only Whether this compute instance was provisioned with user_data provided via the Metadata service. See the Create a Linode description for more information on Metadata.
host_uuidstring (uuid)Read-only The Linode's host machine, as a UUID. (example: 1a2bcd34e5f67gh8ij901234567kl89mn01opqr2)
hypervisorstringRead-only The virtualization software powering this Linode. (example: kvm)
imagestringAn Image ID to deploy the Linode Disk from. Run the List images operation with authentication to view all available Images. Official Linode Images start with linode/, while your Account's Images start with private/. Creating a disk from a Private Image requires read_only or read_write permissions for that Image. Run the Update a user's grants operation to adjust permissions for an Account Image. (example: linode/debian9)
interface_generationstringBeta Indicates if the Linode is configured to use Linode interfaces (linode) or legacy configuration profile interfaces (legacy_config). (example: linode)
ipv4array (ipv4)Filterable, Read-only This Linode's IPv4 Addresses. Each Linode is assigned a single public IPv4 address upon creation, and may get a single private IPv4 address if needed. You may need to Open a support ticket to get additional IPv4 addresses. IPv4 addresses may be reassigned between your Linodes, or shared with other Linodes. See the networking operations for details.
ipv6string (ipv6/128)Read-only This Linode's IPv6 SLAAC address. This address is specific to a Linode, and may not be shared. If the Linode has not been assigned an IPv6 address, the return value will be null. (example: c001:d00d::1337/128)
labelstringFilterable Provides a name for the Linode. If not provided, the API generates one for it. Linode labels have the following constraints: - It needs to begin and end with an alphanumeric character. - It can only consist of alphanumeric characters, hyphens (-), underscores (_) or periods (.). - Cannot have two hyphens (--), underscores (__) or periods (..) in a row. (example: linode123, pattern: ^a-zA-Z+$)
placement_groupobjectRead-only Details on the placement group that this Linode belongs to. Empty if the Linode isn't in a placement group.
regionstringFilterable, Read-only The region where the Linode deployed. A Linode's region can only be changed by initiating a cross data center migration. (example: us-east)
specsobjectRead-only Information about the resources available to this Linode.
statusstringRead-only A brief description of the compute instance's current state. This value can change without direct action from you. For example, when a compute instance goes into maintenance mode, its status is stopped. Status is generally self-explanatory, based on its name. - busy indicates you've assigned the compute instance to a placement group, but the compute instance is currently booting. Once the boot completes, the API completes the assignment and updates the compute instance's status accordingly. - provisioning indicates that the API is applying operating system or Marketplace applications on the compute instance. - billing_suspension indicates that payment is past due on the compute instance, so we've suspended its use. (example: running)
tagsarrayFilterable Tags to help you organize your content.
typestringRead-only This is the Linode type that this Linode was deployed with. To change a Linode's type, use Resize a Linode. (example: g6-standard-1)
updatedstring (date-time)Read-only When this Linode was last updated. (example: 2018-01-01T00:01:01)
watchdog_enabledbooleanThe watchdog, named Lassie, is a Shutdown Watchdog that monitors your Linode and reboots it if it powers off unexpectedly. It works by issuing a boot job when your Linode powers off without a shutdown job being responsible. To prevent a loop, Lassie gives up if there have been more than 5 boot jobs issued within 15 minutes.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_linode_instanceselectGet a specific Linode by ID.

Learn more...

Learn more...
get_linode_instancesselectX-Filter, page, page_sizeReturns a paginated list of Linodes you have permission to view.

Learn more...

Learn more...
post_linode_instanceinsertdata__type, data__regionCreates a Linode Instance on your Account. In order for this request to complete successfully, your User must have the add_linodes grant. Creating a new Linode will incur a charge on your Account.

Linodes can be created using one of the available Types. Run List Linode types to get more information about each Type's specs and cost.

Linodes can be created in any one of our available Regions, which are accessible from the List regions operation.

In an effort to fight spam, Linode restricts outbound connections on ports 25, 465, and 587 on all Linodes for new accounts created after November 5th, 2019. For more information, see our guide on Running a Mail Server.

Important. You must be an unrestricted User in order to add or modify tags on Linodes.

Linodes can be created in a number of ways:

- Using a Linode Public Image distribution or a Private Image you created based on another Linode.

- Run the List images operation with authentication to view all available Images.

- The Linode will be running after it completes provisioning.
- A default config with two Disks, one being a 512 swap disk, is created.
- swap_size can be used to customize the swap disk size.
- Requires a root_pass be supplied to use for the root User's Account.
- It is recommended to supply SSH keys for the root User using the authorized_keys field.
- You may also supply a list of usernames via the authorized_users field.
- These users must have an SSH Key associated with your Profile first. See the Add an SSH key) operation for more information.

- Using cloud-init with Metadata.
- Automate system configuration and software installation by providing a base-64 encoded cloud-config file.
- Requires a compatible Image. You can determine compatible Images by checking for cloud-init under capabilities when running List images.
- Requires a compatible Region. You can determine compatible Regions by checking for Metadata under capabilities when running List regions.

- Using a StackScript.

- Run List StackScripts for a list of available StackScripts.
- The Linode will be running after it completes provisioning.
- Requires a compatible Image to be supplied.
- Run Get a StackScript for compatible Images.
- Requires a root_pass be supplied to use for the root User's Account.
- It is recommended to supply SSH keys for the root User using the authorized_keys field.
- You may also supply a list of usernames via the authorized_users field.
- These users must have an SSH Key associated with your Profile first. See Add an SSH key for more information.

- Using one of your other Linode's backups.
- You must create a Linode large enough to accommodate the Backup's size.
- The Disks and Config will match that of the Linode that was backed up.
- The root_pass will match that of the Linode that was backed up.

- Attached to a private VLAN.
- Review the interfaces property of the Request Body Schema for details.
- For more information, see our guide on Getting Started with VLANs.

- Create an empty Linode.
- The Linode will remain offline and must be manually started.
- Run Boot a Linode.
- Disks and Configs must be created manually.
- This is only recommended for advanced use cases.

Depending on your account settings, you can choose between legacy configuration interfaces or Linode interfaces when creating a Linode. Only one type of interface is allowed per Linode. The interface_generation field lets you select one interface type for new Linodes when both legacy and Linode interfaces options are available on your account. If a Linode is configured with a Linode interface, legacy configuration interfaces can no longer be used on that Linode.

Learn more...

Learn more...
put_linode_instancereplaceUpdates a Linode that you have permission to read_write. Only unrestricted users can add or modify tags on Linodes.
<<LB>>

> 🚧
>
> All tags for the instance are overwritten if tags are included in the request.

Learn more...

Learn more...
delete_linode_instancedeleteDeletes a Linode you have permission to read_write.

Deleting a Linode is a destructive action and cannot be undone.

Additionally, deleting a Linode:

- Gives up any IP addresses the Linode was assigned.
- Deletes all Disks, Backups, Configs, etc.
- Detaches any Volumes associated with the Linode.
- Stops billing for the Linode and its associated services. You will be billed for time used within the billing period the Linode was active.

Linodes that are in the process of cloning or backup restoration cannot be deleted.

Learn more...

Learn more...
post_boot_linode_instanceexecBoots a Linode you have permission to modify.

If the Linode is using config profiles, and no parameters are given, a config profile is chosen for this boot based on the following criteria:
- If there is only one config profile for this Linode, it will be used.
- If there is more than one config profile, the last booted config will be used.
- If there is more than one config profile and none were the last to be booted (because the Linode was never booted or the last booted config was deleted) an error will be returned.

If the Linode is using Linode interfaces, where interface_generation is set as linode, an error is returned if the Linode has to boot without any interface defined.

Learn more...

Learn more...
post_clone_linode_instanceexecYou can clone your Linode's existing disks, configuration profiles and interfaces to another Linode on your account. In order for this request to complete successfully, you need the add_linodes grant.

For Linodes using Linode interfaces, the clone needs to be located in a region that supports Linode interfaces (see GET a region). The account settings need to allow creation of Linodes with Linode interfaces.

Cloning to a new Linode incurs a charge on your account.

If cloning to an existing Linode, any actions currently running or queued must be completed first before you can clone to it.

Up to five clone operations from any given source Linode can be run concurrently. If more concurrent clones are attempted, an HTTP 400 error will be returned by this operation.

Any tags existing on the source Linode will be cloned to the target Linode.

Linodes utilizing Metadata ("has_user_data": true) must be cloned to a new Linode with metadata.user_data included with the clone request.

vpc details

- If the Linode you're cloning has a vpc interface on its active legacy configuration profile that includes a 1:1 NAT, the resulting clone is configured with an any 1:1 NAT.
- See the VPC documentation guide for its specifications and limitations.

vlan details

- Only Next Generation Network (NGN) data centers support VLANs. If a VLAN is attached to your Linode and you attempt clone it to a non-NGN data center, the cloning will not initiate. If a Linode cannot be cloned because of an incompatibility, you will be prompted to select a different data center or contact support.
- See the VLANs Overview guide to view additional specifications and limitations.

Learn more...

Learn more...
post_migrate_linode_instanceexecInitiate a pending host migration that has been scheduled by Linode or initiate a cross data center (DC) migration. A list of pending migrations, if any, can be accessed from List notifications. When the migration begins, your Linode will be shutdown if not already off. If the migration initiated the shutdown, it will reboot the Linode when completed.

To initiate a cross DC migration, you must pass a region parameter to the request body specifying the target data center region. You can view a list of all available regions and their feature capabilities from List regions. See our Pricing Page for Region-specific pricing, which applies after migration is complete. If your Linode has a DC migration already queued or you have initiated a previously scheduled migration, you will not be able to initiate a DC migration until it has completed.

vpc details

- Cross DC migrations don't work for Linodes that have a vpc purpose legacy configuration interface or a VPC Linode interface. They work for host migrations within the same DC.
- See the VPC documentation guide for its specifications and limitations.

vlan details:

- Only Next Generation Network (NGN) data centers support VLANs. Run the List regions operation to view the capabilities of data center regions. If a VLAN is attached to your Linode and you attempt to migrate or clone it to a non-NGN data center, the migration or cloning will not initiate. If a Linode cannot be migrated or cloned because of an incompatibility, you will be prompted to select a different data center or contact support.
- Next Generation Network (NGN) data centers do not support IPv6 /116 pools or IP Failover. If you have these features enabled on your Linode and attempt to migrate to an NGN data center, the migration will not initiate. If a Linode cannot be migrated because of an incompatibility, you will be prompted to select a different data center or contact support.
- See the VLANs Overview guide to view additional specifications and limitations.

public details:

- If the Linode is using Linode interfaces, the destination region needs to also support Linode interfaces.
- After migrating to a different data center, Linode public interfaces retain the same number of IP addresses, but the IP addresses themselves change.

Learn more...

Learn more...
post_mutate_linode_instanceexecLinodes created with now-deprecated Types are entitled to a free upgrade to the next generation. A mutating Linode will be allocated any new resources the upgraded Type provides, and will be subsequently restarted if it was currently running. If any actions are currently running or queued, those actions must be completed first before you can initiate a mutate.

Learn more...

Learn more...
post_reset_linode_passwordexecroot_passResets the root password for this Linode.

- Your Linode must be shut down for a password reset to complete.
- If your Linode has more than one disk (not counting its swap disk), run the Reset a disk root password operation to update a specific disk's root password.
- A password_reset event is generated when a root password reset is successful.

Learn more...

Learn more...
post_reboot_linode_instanceexecReboots a Linode you have permission to modify. If any actions are currently running or queued, those actions must be completed first before you can initiate a reboot.

If the Linode is using Linode interfaces, where interface_generation is set as linode, an error is returned if the Linode has to reboot without any interface defined.

Learn more...

Learn more...
post_rebuild_linode_instanceexecimage, root_passRebuilds a Linode you have the read_write permission to modify.

A rebuild first shuts down the Linode, deletes all disks and configuration profiles on the Linode, then deploys a new image to the Linode with the given attributes. Additionally:

- Requires an image be supplied.
- Requires a root_pass be supplied to use for the root User's Account.
- It is recommended to supply SSH keys for the root User using the authorized_keys field.
- Linodes utilizing Metadata ("has_user_data": true) should include metadata.user_data in the rebuild request to continue using the service.

Linode interfaces don't change during a rebuild.

During a rebuild, you can enable or disable local disk encryption. If disk encryption is not included in the request, the previous disk_encryption value is used. Disk encryption cannot be disabled if the compute instance is attached to a LKE nodepool.

You also have the option to resize the Linode to a different plan by including the type parameter with your request. Note that resizing involves migrating the Linode to a new hardware host, while rebuilding without resizing maintains the same hardware host. Resizing also requires significantly more time for completion of this operation. The following additional conditions apply:

- The Linode must not have a pending migration.
- Your Account cannot have an outstanding balance.
- The Linode must not have more disk allocation than the new Type allows.
- In that situation, you must first delete or resize the disk to be smaller.

Learn more...

Learn more...
post_rescue_linode_instanceexecRescue Mode is a safe environment for performing many system recovery and disk management tasks. Rescue Mode is based on the Finnix recovery distribution, a self-contained and bootable Linux distribution. You can also use Rescue Mode for tasks other than disaster recovery, such as formatting disks to use different filesystems, copying data between disks, and downloading files from a disk via SSH and SFTP.

Linodes with legacy configuration interfaces receive a public IP and boot into the recovery Linux distribution. Linodes with Linode interfaces still boot into recovery mode with the recovery Linux distribution, but they retain their original network interfaces and settings from before entering rescue mode.

- Note that sdh is reserved and unavailable during rescue.

Learn more...

Learn more...
post_resize_linode_instanceexectypeResizes a Linode you have the read_write permission to a different Type. If any actions are currently running or queued, those actions must be completed first before you can initiate a resize. Additionally, the following criteria must be met in order to resize a Linode:

- The Linode must not have a pending migration.
- Your Account cannot have an outstanding balance.
- The Linode must not have more disk allocation than the new Type allows.
- In that situation, you must first delete or resize the disk to be smaller.

You can also resize a Linode when using the Rebuild a Linode operation.

Learn more...

Learn more...
post_shutdown_linode_instanceexecShuts down a Linode you have permission to modify. If any actions are currently running or queued, those actions must be completed first before you can initiate a shutdown.

Learn more...

Learn more...

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
X-FilterSpecifies a JSON object to filter down the results. See Filtering and sorting for details. (example: {{X-Filter}})
pageintegerThe page of a collection to return.
page_sizeintegerThe number of items to return per page.

SELECT examples

Get a specific Linode by ID.

Learn more...

Learn more...

SELECT
id,
lke_cluster_id,
alerts,
backups,
capabilities,
created,
disk_encryption,
group,
has_user_data,
host_uuid,
hypervisor,
image,
interface_generation,
ipv4,
ipv6,
label,
placement_group,
region,
specs,
status,
tags,
type,
updated,
watchdog_enabled
FROM linode.linode.instances;

INSERT examples

Creates a Linode Instance on your Account. In order for this request to complete successfully, your User must have the add_linodes grant. Creating a new Linode will incur a charge on your Account.

Linodes can be created using one of the available Types. Run List Linode types to get more information about each Type's specs and cost.

Linodes can be created in any one of our available Regions, which are accessible from the List regions operation.

In an effort to fight spam, Linode restricts outbound connections on ports 25, 465, and 587 on all Linodes for new accounts created after November 5th, 2019. For more information, see our guide on Running a Mail Server.

Important. You must be an unrestricted User in order to add or modify tags on Linodes.

Linodes can be created in a number of ways:

- Using a Linode Public Image distribution or a Private Image you created based on another Linode.

- Run the List images operation with authentication to view all available Images.

- The Linode will be running after it completes provisioning.
- A default config with two Disks, one being a 512 swap disk, is created.
- swap_size can be used to customize the swap disk size.
- Requires a root_pass be supplied to use for the root User's Account.
- It is recommended to supply SSH keys for the root User using the authorized_keys field.
- You may also supply a list of usernames via the authorized_users field.
- These users must have an SSH Key associated with your Profile first. See the Add an SSH key) operation for more information.

- Using cloud-init with Metadata.
- Automate system configuration and software installation by providing a base-64 encoded cloud-config file.
- Requires a compatible Image. You can determine compatible Images by checking for cloud-init under capabilities when running List images.
- Requires a compatible Region. You can determine compatible Regions by checking for Metadata under capabilities when running List regions.

- Using a StackScript.

- Run List StackScripts for a list of available StackScripts.
- The Linode will be running after it completes provisioning.
- Requires a compatible Image to be supplied.
- Run Get a StackScript for compatible Images.
- Requires a root_pass be supplied to use for the root User's Account.
- It is recommended to supply SSH keys for the root User using the authorized_keys field.
- You may also supply a list of usernames via the authorized_users field.
- These users must have an SSH Key associated with your Profile first. See Add an SSH key for more information.

- Using one of your other Linode's backups.
- You must create a Linode large enough to accommodate the Backup's size.
- The Disks and Config will match that of the Linode that was backed up.
- The root_pass will match that of the Linode that was backed up.

- Attached to a private VLAN.
- Review the interfaces property of the Request Body Schema for details.
- For more information, see our guide on Getting Started with VLANs.

- Create an empty Linode.
- The Linode will remain offline and must be manually started.
- Run Boot a Linode.
- Disks and Configs must be created manually.
- This is only recommended for advanced use cases.

Depending on your account settings, you can choose between legacy configuration interfaces or Linode interfaces when creating a Linode. Only one type of interface is allowed per Linode. The interface_generation field lets you select one interface type for new Linodes when both legacy and Linode interfaces options are available on your account. If a Linode is configured with a Linode interface, legacy configuration interfaces can no longer be used on that Linode.

Learn more...

Learn more...

INSERT INTO linode.linode.instances (
data__authorized_keys,
data__authorized_users,
data__booted,
data__disk_encryption,
data__image,
data__metadata,
data__root_pass,
data__stackscript_data,
data__stackscript_id,
data__backup_id,
data__backups_enabled,
data__firewall_id,
data__group,
data__interface_generation,
data__interfaces,
data__label,
data__network_helper,
data__placement_group,
data__private_ip,
data__region,
data__swap_size,
data__tags,
data__type
)
SELECT
'{{ authorized_keys }}',
'{{ authorized_users }}',
{{ booted }},
'{{ disk_encryption }}',
'{{ image }}',
'{{ metadata }}',
'{{ root_pass }}',
'{{ stackscript_data }}',
{{ stackscript_id }},
{{ backup_id }},
{{ backups_enabled }},
{{ firewall_id }},
'{{ group }}',
'{{ interface_generation }}',
'{{ interfaces }}',
'{{ label }}',
{{ network_helper }},
'{{ placement_group }}',
{{ private_ip }},
'{{ region }}' --required,
{{ swap_size }},
'{{ tags }}',
'{{ type }}' --required
RETURNING
id,
lke_cluster_id,
alerts,
backups,
capabilities,
created,
disk_encryption,
group,
has_user_data,
host_uuid,
hypervisor,
image,
interface_generation,
ipv4,
ipv6,
label,
placement_group,
region,
specs,
status,
tags,
type,
updated,
watchdog_enabled
;

REPLACE examples

Updates a Linode that you have permission to read_write. Only unrestricted users can add or modify tags on Linodes.
<<LB>>

> 🚧
>
> All tags for the instance are overwritten if tags are included in the request.

Learn more...

Learn more...

REPLACE linode.linode.instances
SET
data__alerts = '{{ alerts }}',
data__backups = '{{ backups }}',
data__group = '{{ group }}',
data__label = '{{ label }}',
data__tags = '{{ tags }}',
data__watchdog_enabled = {{ watchdog_enabled }}
WHERE

RETURNING
id,
lke_cluster_id,
alerts,
backups,
capabilities,
created,
disk_encryption,
group,
has_user_data,
host_uuid,
hypervisor,
image,
interface_generation,
ipv4,
ipv6,
label,
placement_group,
region,
specs,
status,
tags,
type,
updated,
watchdog_enabled;

DELETE examples

Deletes a Linode you have permission to read_write.

Deleting a Linode is a destructive action and cannot be undone.

Additionally, deleting a Linode:

- Gives up any IP addresses the Linode was assigned.
- Deletes all Disks, Backups, Configs, etc.
- Detaches any Volumes associated with the Linode.
- Stops billing for the Linode and its associated services. You will be billed for time used within the billing period the Linode was active.

Linodes that are in the process of cloning or backup restoration cannot be deleted.

Learn more...

Learn more...

DELETE FROM linode.linode.instances;

Lifecycle Methods

Boots a Linode you have permission to modify.

If the Linode is using config profiles, and no parameters are given, a config profile is chosen for this boot based on the following criteria:
- If there is only one config profile for this Linode, it will be used.
- If there is more than one config profile, the last booted config will be used.
- If there is more than one config profile and none were the last to be booted (because the Linode was never booted or the last booted config was deleted) an error will be returned.

If the Linode is using Linode interfaces, where interface_generation is set as linode, an error is returned if the Linode has to boot without any interface defined.

Learn more...

Learn more...

EXEC linode.linode.instances.post_boot_linode_instance 
@@json=
'{
"config_id": {{ config_id }}
}';