instances
Creates, updates, deletes, gets or lists an instances
resource.
Overview
Name | instances |
Type | Resource |
Id | linode.linode.instances |
Fields
The following fields are returned by SELECT
queries:
- get_linode_instance
- get_linode_instances
Returns a single Linode object.
Name | Datatype | Description |
---|---|---|
id | integer | Filterable, Read-only This Linode's ID which must be provided for all operations impacting this Linode. |
lke_cluster_id | integer | Read-only The ID of the Kubernetes cluster if the Linode is part of cluster. |
alerts | object | |
backups | object | Information about this Linode's backups status. For information about available backups, run List backups. |
capabilities | array | Limited availability, Read-only A list of capabilities this compute instance supports. |
created | string (date-time) | Read-only When this Linode was created. (example: 2018-01-01T00:01:01) |
disk_encryption | string | Read-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) |
group | string | Deprecated, Filterable The group label for this Linode. (example: Linode-Group) |
has_user_data | boolean | Read-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_uuid | string (uuid) | Read-only The Linode's host machine, as a UUID. (example: 1a2bcd34e5f67gh8ij901234567kl89mn01opqr2) |
hypervisor | string | Read-only The virtualization software powering this Linode. (example: kvm) |
image | string | An 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_generation | string | Beta Indicates if the Linode is configured to use Linode interfaces (linode ) or legacy configuration profile interfaces (legacy_config ). (example: linode) |
ipv4 | array (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. |
ipv6 | string (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) |
label | string | Filterable 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_group | object | Read-only Details on the placement group that this Linode belongs to. Empty if the Linode isn't in a placement group. |
region | string | Filterable, 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) |
specs | object | Read-only Information about the resources available to this Linode. |
status | string | Read-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) |
tags | array | Filterable Tags to help you organize your content. |
type | string | Read-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) |
updated | string (date-time) | Read-only When this Linode was last updated. (example: 2018-01-01T00:01:01) |
watchdog_enabled | boolean | The 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:
Name | Accessible by | Required Params | Optional Params | Description |
---|---|---|---|---|
get_linode_instance | select | Get a specific Linode by ID. Learn more... Learn more... | ||
get_linode_instances | select | X-Filter , page , page_size | Returns a paginated list of Linodes you have permission to view. Learn more... Learn more... | |
post_linode_instance | insert | data__type , data__region | 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... | |
put_linode_instance | replace | 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... | ||
delete_linode_instance | delete | 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... | ||
post_boot_linode_instance | exec | 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... | ||
post_clone_linode_instance | exec | You 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_instance | exec | Initiate 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_instance | exec | Linodes 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_password | exec | root_pass | Resets 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_instance | exec | Reboots 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_instance | exec | image , root_pass | Rebuilds 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_instance | exec | Rescue 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_instance | exec | type | Resizes 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_instance | exec | Shuts 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.
Name | Datatype | Description |
---|---|---|
X-Filter |
| Specifies a JSON object to filter down the results. See Filtering and sorting for details. (example: {{X-Filter}}) |
page | integer | The page of a collection to return. |
page_size | integer | The number of items to return per page. |
SELECT
examples
- get_linode_instance
- get_linode_instances
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;
Returns a paginated list of Linodes you have permission to view.
Learn more...
Learn more...
SELECT
data,
page,
pages,
results
FROM linode.linode.instances
WHERE X-Filter = '{{ X-Filter }}'
AND page = '{{ page }}'
AND page_size = '{{ page_size }}';
INSERT
examples
- post_linode_instance
- Manifest
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
;
# Description fields are for documentation purposes
- name: instances
props:
- name: authorized_keys
value: array
description: >
__Write-only__ A list of public SSH keys that will be automatically appended to the root user's `~/.ssh/authorized_keys` file when deploying from an Image.
- name: authorized_users
value: array
description: >
__Write-only__ A list of usernames. If the usernames have associated SSH keys, the keys will be appended to the root users `~/.ssh/authorized_keys` file automatically when deploying from an Image.
- name: booted
value: boolean
description: >
__Write-only__ This field defaults to `true` if the Linode is created with an Image or from a Backup. If it is deployed from an Image or a Backup and you wish it to remain `offline` after deployment, set this to `false`.
default: true
- name: disk_encryption
value: string
description: >
Local disk encryption ensures that your data stored on Linodes is secured. Disk encryption protects against unauthorized data access by keeping the data encrypted if the disk is ever removed from the data center, decommissioned, or disposed of. The platform manages the encryption and decryption for you.
By default, encryption is `enabled` on all Linodes. If you opted out of encryption or if the Linode was created prior to local disk encryption support, you can encrypt your data using [Rebuild](https://techdocs.akamai.com/linode-api/reference/post-rebuild-linode-instance).
valid_values: ['enabled', 'disabled']
- name: image
value: string
description: >
An Image ID to deploy the Linode Disk from.
Run the [List images](https://techdocs.akamai.com/linode-api/reference/get-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](https://techdocs.akamai.com/linode-api/reference/put-user-grants) operation to adjust permissions for an Account Image.
- name: metadata
value: object
description: >
__Write-only__ An object containing user-defined data relevant to the creation of Linodes.
- name: root_pass
value: string
description: >
__Write-only__ This sets the root user's password on a newly created Linode Disk when deploying from an Image.
- __Required__ when creating a Linode Disk from an Image, including when using a StackScript.
- Must meet a password strength score requirement that is calculated internally by the API. If the strength requirement is not met, you will receive a `Password does not meet strength requirement` error.
- name: stackscript_data
value: object
description: >
This field is required only if the StackScript being deployed requires input data from the User for successful completion. See [User Defined Fields (UDFs)](https://www.linode.com/docs/products/tools/stackscripts/guides/write-a-custom-script/#declare-user-defined-fields-udfs) for more details.
This field is required to be valid JSON.
Total length cannot exceed 65,535 characters.
- name: stackscript_id
value: integer
description: >
A StackScript ID that will cause the referenced StackScript to be run during deployment of this Linode. A compatible `image` is required to use a StackScript. To get a list of available StackScript and their permitted Images, run [List StackScripts](https://techdocs.akamai.com/linode-api/reference/get-stack-scripts). This field cannot be used when deploying from a Backup or a Private Image.
- name: backup_id
value: integer
description: >
A Backup ID from another Linode's available backups. Your User must have `read_write` access to that Linode, the Backup must have a `status` of `successful`, and the Linode must be deployed to the same `region` as the Backup. Run [List backups](https://techdocs.akamai.com/linode-api/reference/get-backups) for a Linode's available backups.
This field and the `image` field are mutually exclusive.
- name: backups_enabled
value: boolean
description: >
If this field is set to `true`, the created Linode will automatically be enrolled in the Linode Backup service. This will incur an additional charge. The cost for the Backup service is dependent on the Type of Linode deployed.
This option is always treated as `true` if the account-wide `backups_enabled` setting is `true`. See [Get account settings](https://techdocs.akamai.com/linode-api/reference/get-account-settings) for more information.
Backup pricing is included in the response from [List types](https://techdocs.akamai.com/linode-api/reference/get-linode-types)
- name: firewall_id
value: integer
description: >
The `id` of the Firewall to attach this Linode to upon creation. This `firewall_id` field is for Linodes using VLAN and legacy configuration interfaces only.
- name: group
value: string
description: >
__Deprecated__, __Filterable__ The group label for this Linode.
- name: interface_generation
value: string
description: >
__Beta__ Specifies the interface type for the Linode. The value can be either `legacy_config` or `linode`. The default value is determined by the `interfaces_for_new_linodes` setting in the [account settings](https://techdocs.akamai.com/linode-api/reference/get-account-settings). If the `interface_generation` option is set to `linode`, legacy configuration interfaces can no longer be used on the Linode.
- If `interfaces_for_new_linodes` is set to `linode_only`, set `interface_generation` to `linode` or omit it for Linode interfaces.
- If `interfaces_for_new_linodes` is set to `legacy_config_only`, set `interface_generation` to `legacy_config` or omit it for legacy configuration interfaces.
- If `interfaces_for_new_linodes` is set to `linode_default_but_legacy_config_allowed`, set `interface_generation` to `linode` or omit it for Linode interfaces, and to `legacy_config` if the Linode uses legacy configuration interfaces.
- If `interfaces_for_new_linodes` is set to `legacy_config_default_but_linode_allowed`, set `interface_generation` to `legacy_config` or omit it for legacy configuration interfaces, and to `linode` if the Linode uses Linode interfaces.
valid_values: ['legacy_config', 'linode']
- name: interfaces
value: array
description: >
Interfaces for the Linode. This can be a Linode interface or legacy configuration interface.
default:
- name: label
value: string
description: >
__Filterable__ 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.
- name: network_helper
value: boolean
description: >
Enables the Network Helper feature. The default value is determined by the `network_helper` setting in the [account settings](https://techdocs.akamai.com/linode-api/reference/get-account-settings). This `network_helper` field is for Linodes using Linode interfaces only.
- name: placement_group
value: object
description: >
Include this to assign this Linode to an existing [placement group](https://www.linode.com/docs/products/compute/compute-instances/guides/placement-groups/). These constraints apply:
- The target placement group needs to be in the same `region` set for this Linode.
- The placement group needs to have capacity. Run the [Get a region](https://techdocs.akamai.com/linode-api/reference/get-region) operation and note either the `maximum_linodes_per_pg` (strict) or `maximum_linodes_per_flexible_pg` (flexible), based on your selected `placement_group_policy`. These represent the Linode limit per placement group, for each `placement_group_policy` type. You can then run the [Get a placement group](https://techdocs.akamai.com/linode-api/reference/get-placement-group) operation to review the Linodes in that group.
- name: private_ip
value: boolean
description: >
If `true`, the created Linode will have private networking enabled and assigned a private IPv4 address.
- name: region
value: string
description: >
The [region](https://techdocs.akamai.com/linode-api/reference/get-regions) where the Linode will be located.
- name: swap_size
value: integer
description: >
When deploying from an Image, this field is optional, otherwise it is ignored. This is used to set the swap disk size for the newly created Linode.
default: 512
- name: tags
value: array
description: >
__Filterable__ Tags to help you organize your content.
- name: type
value: string
description: >
The [Linode type](https://techdocs.akamai.com/linode-api/reference/get-linode-types) of the Linode you are creating.
REPLACE
examples
- put_linode_instance
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
- delete_linode_instance
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
- post_boot_linode_instance
- post_clone_linode_instance
- post_migrate_linode_instance
- post_mutate_linode_instance
- post_reset_linode_password
- post_reboot_linode_instance
- post_rebuild_linode_instance
- post_rescue_linode_instance
- post_resize_linode_instance
- post_shutdown_linode_instance
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 }}
}';
You 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...
EXEC linode.linode.instances.post_clone_linode_instance
@@json=
'{
"backups_enabled": {{ backups_enabled }},
"configs": "{{ configs }}",
"disks": "{{ disks }}",
"group": "{{ group }}",
"label": "{{ label }}",
"linode_id": {{ linode_id }},
"metadata": "{{ metadata }}",
"placement_group": "{{ placement_group }}",
"private_ip": {{ private_ip }},
"region": "{{ region }}",
"type": "{{ type }}"
}';
Initiate 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...
EXEC linode.linode.instances.post_migrate_linode_instance
@@json=
'{
"placement_group": "{{ placement_group }}",
"region": "{{ region }}",
"type": "{{ type }}",
"upgrade": {{ upgrade }}
}';
Linodes 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...
EXEC linode.linode.instances.post_mutate_linode_instance
@@json=
'{
"allow_auto_disk_resize": {{ allow_auto_disk_resize }}
}';
Resets 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...
EXEC linode.linode.instances.post_reset_linode_password
@@json=
'{
"root_pass": "{{ root_pass }}"
}';
Reboots 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...
EXEC linode.linode.instances.post_reboot_linode_instance
@@json=
'{
"config_id": {{ config_id }}
}';
Rebuilds 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...
EXEC linode.linode.instances.post_rebuild_linode_instance
@@json=
'{
"authorized_keys": "{{ authorized_keys }}",
"authorized_users": "{{ authorized_users }}",
"booted": {{ booted }},
"disk_encryption": "{{ disk_encryption }}",
"image": "{{ image }}",
"metadata": "{{ metadata }}",
"root_pass": "{{ root_pass }}",
"stackscript_data": "{{ stackscript_data }}",
"stackscript_id": {{ stackscript_id }},
"type": "{{ type }}"
}';
Rescue 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...
EXEC linode.linode.instances.post_rescue_linode_instance
@@json=
'{
"devices": "{{ devices }}"
}';
Resizes 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...
EXEC linode.linode.instances.post_resize_linode_instance
@@json=
'{
"allow_auto_disk_resize": {{ allow_auto_disk_resize }},
"migration_type": "{{ migration_type }}",
"type": "{{ type }}"
}';
Shuts 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...
EXEC linode.linode.instances.post_shutdown_linode_instance
;