Linode Instances v4.176.0

List Linodes

GET https://api.linode.com/v4/linode/instances

Returns a paginated list of Linodes you have permission to view.


Authorizations

personalAccessToken
oauthlinodes:read_only

Query Parameters

page
Type:
integer >= 1
Default: 1
Default:
1

The page of a collection to return.

page_size
Type:
integer 25..500
Default: 100
Default:
100

The number of items to return per page.

Request Samples

Response Samples

Responses

Create a Linode

POST https://api.linode.com/v4/linode/instances

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.
    • 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.

  • Create an empty Linode.

    • The Linode will remain offline and must be manually started.
    • Disks and Configs must be created manually.
    • This is only recommended for advanced use cases.

Authorizations

personalAccessToken
oauthlinodes:read_write

Request Samples

Request Body Schema

authorized_keys
array of strings

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.

authorized_users
array of strings

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.

backup_id
integer

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 for a Linode’s available backups.

This field and the image field are mutually exclusive.

backups_enabled
boolean

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 for more information.

Backup pricing is included in the response from List types

booted
boolean
Default: true

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.

disk_encryption
string
Enum: enabled disabled

Local disk encryption ensures that your data stored on compute instances is encrypted. Encryption converts the data on the compute instance into unreadable code. Decryption of the the disk requires other systems within the datacenter. This requirement protects against data leakage if the disk is removed from a datacenter, lost, stolen, recycled or disposed.

By default, encryption is enabled on all compute instances but you can opt-out of implementing this feature. If you opted-out of encryption or if the compute instance was created prior to the introduction of the local disk encryption support, you can encrypt your data using Rebuild.

firewall_id
integer

The id of the Firewall to attach this Linode to upon creation.

group
string

A deprecated property denoting a group label for this Linode.

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.

interfaces
array of objects

An array of Network Interfaces to add to this Linode’s Configuration Profile. At least one and up to three Interface objects can exist in this array. The position in the array determines which of the Linode’s network Interfaces is configured:

  • First [0]: eth0
  • Second [1]: eth1
  • Third [2]: eth2

When updating a Linode’s Interfaces, each Interface must be redefined. An empty interfaces array results in a default public type Interface configuration only.

If no public Interface is configured, public IP addresses are still assigned to the Linode but will not be usable without manual configuration.

Note: Changes to Linode Interface configurations can be enabled by rebooting the Linode.

vpc details

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.
  • See the VLANs Overview guide to view additional specifications and limitations.

active
boolean

Returns true if the Interface is in use, meaning that Compute Instance has been booted using the Configuration Profile to which the Interface belongs. Otherwise returns false.

ip_ranges
Nullable
array of strings

An array of IPv4 CIDR VPC Subnet ranges that are routed to this Interface.

  • Array items are only allowed for vpc type Interfaces.
  • This must be empty for non-vpc type Interfaces.

For requests:

  • Addresses in submitted ranges must not already be actively assigned.
  • Submitting values replaces any existing values.
  • Submitting an empty array removes any existing values.
  • Omitting this property results in no change to existing values.

ipam_address
Nullable
string<ip/netmask>

This Network Interface’s private IP address in Classless Inter-Domain Routing (CIDR) notation.

For vlan purpose Interfaces:

  • Must be unique among the Linode’s Interfaces to avoid conflicting addresses.
  • Should be unique among devices attached to the VLAN to avoid conflict.
  • The Linode is configured to use this address for the associated Interface upon reboot if Network Helper is enabled. If Network Helper is disabled, the address can be enabled with manual static IP configuration.

For public purpose Interfaces:

  • In requests, must be an empty string ("") or null if included.
  • In responses, always returns null.

For vpc purpose Interfaces:

  • In requests, must be an empty string ("") or null if included.
  • In responses, always returns null.

ipv4
object

IPv4 addresses configured for this Interface. Only allowed for vpc type Interfaces. Returns null if no vpc Interface is assigned.

nat_1_1
Nullable
string<ip>

The 1:1 NAT IPv4 address, used to associate a public IPv4 address with the VPC Subnet IPv4 address assigned to this Interface.

  • Only allowed for vpc type Interfaces.
  • Returns null if no 1:1 NAT is set for a vpc type Interface.
  • Returns an empty string ("") for non-vpc type Interfaces.

For requests:

  • Setting this value to any enables the Linode’s assigned public IPv4 address on this Interface and establishes a 1:1 NAT between the public IPv4 and VPC Subnet IPv4 addresses.
  • Setting the value to a specific public IPv4 address that is assigned to the Linode enables a 1:1 NAT between that address and the VPC Subnet IPv4 address.
  • The public IPv4 address can’t be shared with another Linode.
  • If omitted, set to null, or set to an empty string (""), no 1:1 NAT is established.

Note: When creating a new compute-instance, you can’t set this to a specific IPv4 address. When a new compute instance is created, the network establishes a public IPv4 address for it. Since this address doesn’t exist yet, you can’t include a custom IPv4 address to change it. Once your compute instances is created, you can update your configuration profile interface to change the nat_1_1 address.

vpc
Nullable
string<ip>

The VPC Subnet IPv4 address for this Interface.

  • Only allowed for vpc type Interfaces.
  • Returns an empty string ("") for non-vpc type Interfaces.

For requests:

  • Must not already be actively assigned as an address or within a range to any Linodes.
  • Must not be the first two or last two addresses in the Subnet IPv4 Range.
  • If omitted, a valid address within the Subnet IPv4 range is automatically assigned.

label
Nullable
string 1..64 characters

The name of this Interface.

For vlan purpose Interfaces:

  • Required.
  • Must be unique among the Linode’s Interfaces (a Linode cannot be attached to the same VLAN multiple times).
  • Can only contain ASCII letters, numbers, and hyphens (-). You can’t use two consecutive hyphens (--).
  • If the VLAN label is new, a VLAN is created. Up to 10 VLANs can be created in each data center region. To view your active VLANs, run the List VLANs operation.

For public purpose Interfaces:

  • In requests, must be an empty string ("") or null if included.
  • In responses, always returns null.

For vpc purpose Interfaces:

  • In requests, must be an empty string ("") or null if included.
  • In responses, always returns null.

primary
boolean

The primary Interface is configured as the default route to the Linode.

Each Configuration Profile can have up to one "primary": true Interface at a time.

Must be false for vlan type Interfaces.

If no Interface is configured as the primary, the first non-vlan type Interface in the interfaces array is automatically treated as the primary Interface.

purpose
Required
string
Enum: public vlan vpc

The type of Interface.

  • public

    • Only one public Interface per Linode can be defined.
    • The Linode’s default public IPv4 address is assigned to the public Interface.
    • A Linode must have a public Interface in the first/eth0 position to be reachable via the public internet upon boot without additional system configuration. If no public Interface is configured, the Linode is not directly reachable via the public internet. In this case, access can only be established via LISH or other Linodes connected to the same VLAN or VPC.
  • vlan

    • Configuring a vlan purpose Interface attaches this Linode to the VLAN with the specified label.
    • The Linode is configured to use the specified ipam_address, if any.
  • vpc

    • Configuring a vpc purpose Interface attaches this Linode to the existing VPC Subnet with the specified subnet_id.
    • When the Interface is activated, the Linode is configured to use an IP address from the range in the assigned VPC Subnet. See ipv4.vpc for more information.

subnet_id
Nullable
integer

The id of the VPC Subnet for this Interface.

In requests, this value is used to assign a Linode to a VPC Subnet.

  • Required for vpc type Interfaces.
  • Returns null for non-vpc type Interfaces.
  • Once a VPC Subnet is assigned to an Interface, it cannot be updated.
  • The Linode must be rebooted with the Interface’s Configuration Profile to complete assignment to a VPC Subnet.

label
string 3..64 characters

The Linode’s label is for display purposes only. If no label is provided for a Linode, a default will be assigned.

Linode labels have the following constraints:

  • Must begin and end with an alphanumeric character.
  • May only consist of alphanumeric characters, hyphens (-), underscores (_) or periods (.).
  • Cannot have two hyphens (--), underscores (__) or periods (..) in a row.

metadata
object

Write-only An object containing user-defined data relevant to the creation of Linodes.

user_data
string<byte>

Base64-encoded cloud-config data.

Cannot be modified after provisioning. To update, use either the Clone a Linode or Rebuild a Linode operations.

Must not be included when cloning to an existing Linode.

Unencoded data must not exceed 65535 bytes, or about 16kb encoded.

placement_group
object

Include this to assign this Linode to an existing placement group. 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 operation and store the maximum_linodes_per_pg value to know the Linode limit per placement group. You can then run the Get a placement group operation to review the Linodes in that group.

id
integer

The placement group’s ID. You need to provide it for all operations impacting it.

private_ip
boolean

If true, the created Linode will have private networking enabled and assigned a private IPv4 address.

region
Required
string

The region where the Linode will be located.

root_pass
string<password> 7..128 characters

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.

stackscript_data
object <= 65535 characters

This field is required only if the StackScript being deployed requires input data from the User for successful completion. See User Defined Fields (UDFs) for more details.

This field is required to be valid JSON.

Total length cannot exceed 65,535 characters.

stackscript_id
integer

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. This field cannot be used when deploying from a Backup or a Private Image.

swap_size
integer
Default: 512

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.

tags
array of strings

An array of tags applied to this object. Tags are for organizational purposes only.

type
Required
string

The Linode type of the Linode you are creating.

Response Samples

Responses

Delete a Linode

DELETE https://api.linode.com/v4/linode/instances/{linodeId}

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.


Authorizations

personalAccessToken
oauthlinodes:read_write

Path Parameters

linodeIdinteger
Required

ID of the Linode to look up

Request Samples

Response Samples

Responses

Get a Linode

GET https://api.linode.com/v4/linode/instances/{linodeId}

Get a specific Linode by ID.


Authorizations

personalAccessToken
oauthlinodes:read_only

Path Parameters

linodeIdinteger
Required

ID of the Linode to look up

Request Samples

Response Samples

Responses

Update a Linode

PUT https://api.linode.com/v4/linode/instances/{linodeId}

Updates a Linode that you have permission to read_write.

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


Authorizations

personalAccessToken
oauthlinodes:read_write

Path Parameters

linodeIdinteger
Required

ID of the Linode to look up

Request Samples

Request Body Schema

alerts
object
cpu
integer

The percentage of CPU usage required to trigger an alert. If the average CPU usage over two hours exceeds this value, we’ll send you an alert. Your Linode’s total CPU capacity is represented as 100%, multiplied by its number of cores.

For example, a two core Linode’s CPU capacity is represented as 200%. If you want to be alerted at 90% of a two core Linode’s CPU capacity, set the alert value to 180.

The default value is 90% multiplied by the number of cores.

If the value is set to 0 (zero), the alert is disabled.

io
integer

The amount of disk IO operation per second required to trigger an alert. If the average disk IO over two hours exceeds this value, we’ll send you an alert. If set to 0 (zero), this alert is disabled.

network_in
integer

The amount of incoming traffic, in Mbit/s, required to trigger an alert. If the average incoming traffic over two hours exceeds this value, we’ll send you an alert. If this is set to 0 (zero), the alert is disabled.

network_out
integer

The amount of outbound traffic, in Mbit/s, required to trigger an alert. If the average outbound traffic over two hours exceeds this value, we’ll send you an alert. If this is set to 0 (zero), the alert is disabled.

transfer_quota
integer

The percentage of network transfer that may be used before an alert is triggered. When this value is exceeded, we’ll alert you. If this is set to 0 (zero), the alert is disabled.

backups
object

Information about this Linode’s backups status. For information about available backups, run List backups.

schedule
object
day
Nullable
string
Enum: Scheduling Sunday Monday Tuesday Wednesday Thursday Friday Saturday

The day of the week that your Linode’s weekly Backup is taken. If not set manually, a day will be chosen for you. Backups are taken every day, but backups taken on this day are preferred when selecting backups to retain for a longer period.

If not set manually, then when backups are initially enabled, this may come back as Scheduling until the day is automatically selected.

window
Nullable
string
Enum: Scheduling W0 W2 W4 W6 W8 W10 W12 W14 W16 W18 W20 W22

The window in which your backups will be taken, in UTC. A backups window is a two-hour span of time in which the backup may occur.

For example, W10 indicates that your backups should be taken between 10:00 and 12:00. If you do not choose a backup window, one will be selected for you automatically.

If not set manually, when backups are initially enabled this may come back as Scheduling until the window is automatically selected.

disk_encryption
string
Enum: enabled disabled Default: enabled

Local disk encryption ensures that your data stored on compute instances is encrypted. Encryption converts the data on the compute instance into unreadable code. Decryption of the the disk requires other systems within the datacenter. This requirement protects against data leakage if the disk is removed from a datacenter, lost, stolen, recycled or disposed.

group
string

A deprecated property denoting a group label for this Linode.

label
string 3..64 characters

The Linode’s label is for display purposes only. If no label is provided for a Linode, a default will be assigned.

Linode labels have the following constraints:

  • Must begin and end with an alphanumeric character.
  • May only consist of alphanumeric characters, hyphens (-), underscores (_) or periods (.).
  • Cannot have two hyphens (--), underscores (__) or periods (..) in a row.

tags
array of strings

An array of tags applied to this object. Tags are for organizational purposes only.

watchdog_enabled
boolean

The watchdog, named Lassie, is a Shutdown Watchdog that monitors your Linode and will reboot 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 will give up if there have been more than 5 boot jobs issued within 15 minutes.

Response Samples

Responses

Boot a Linode

POST https://api.linode.com/v4/linode/instances/{linodeId}/boot

Boots a Linode you have permission to modify. If no parameters are given, a Config profile will be 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.

Authorizations

personalAccessToken
oauthlinodes:read_write

Path Parameters

linodeIdinteger
Required

The ID of the Linode to boot.

Request Samples

Request Body Schema

config_id
integer

The Linode Config ID to boot into.

Response Samples

Responses

Clone a Linode

POST https://api.linode.com/v4/linode/instances/{linodeId}/clone

You can clone your Linode’s existing Disks or Configuration profiles to another Linode on your Account. In order for this request to complete successfully, your User must have the add_linodes grant. Cloning to a new Linode will incur 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 are cloning has a vpc purpose Interface on its active 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.

Authorizations

personalAccessToken
oauthlinodes:read_write

Path Parameters

linodeIdinteger
Required

ID of the Linode to clone.

Request Samples

Request Body Schema

backups_enabled
boolean

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. Pricing is included in the response from List types.

  • Can only be included when cloning to a new Linode.

configs
array of integers

An array of configuration profile IDs.

  • If the configs parameter is not provided, then all configuration profiles and their associated disks will be cloned from the source Linode. Any disks specified by the disks parameter will also be cloned.
  • If an empty array is provided for the configs parameter, then no configuration profiles (nor their associated disks) will be cloned from the source Linode. Any disks specified by the disks parameter will still be cloned.
  • If a non-empty array is provided for the configs parameter, then the configuration profiles specified in the array (and their associated disks) will be cloned from the source Linode. Any disks specified by the disks parameter will also be cloned.

disks
array of integers

An array of disk IDs.

  • If the disks parameter is not provided, then no extra disks will be cloned from the source Linode. All disks associated with the configuration profiles specified by the configs parameter will still be cloned.
  • If an empty array is provided for the disks parameter, then no extra disks will be cloned from the source Linode. All disks associated with the configuration profiles specified by the configs parameter will still be cloned.
  • If a non-empty array is provided for the disks parameter, then the disks specified in the array will be cloned from the source Linode, in addition to any disks associated with the configuration profiles specified by the configs parameter.

group
string

A label used to group Linodes for display. Linodes are not required to have a group.

label
string 3..64 characters

The label to assign this Linode when cloning to a new Linode.

  • Can only be provided when cloning to a new Linode.
  • Defaults to “linode”.

linode_id
integer

If an existing Linode is the target for the clone, the ID of that Linode. The existing Linode must have enough resources to accept the clone.

metadata
object

Write-only An object containing user-defined data relevant to the creation of Linodes.

user_data
string<byte>

Base64-encoded cloud-config data.

Cannot be modified after provisioning. To update, use either the Clone a Linode or Rebuild a Linode operations.

Must not be included when cloning to an existing Linode.

Unencoded data must not exceed 65535 bytes, or about 16kb encoded.

placement_group
object

Include this to assign this Linode to an existing placement group. Consider these points when cloning:

  • If the Linode you’re cloning exists in a placement group, the API won’t automatically add the cloned instance to the same placement group. You need to specify a placement group to add the clone to.
  • 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 operation and store the maximum_linodes_per_pg value to know the Linode limit per placement group. You can then run the Get a placement group operation to review the Linodes in that group.

id
Required
integer

The placement group’s ID. You need to provide it for all operations impacting it.

private_ip
boolean

If true, the created Linode will have private networking enabled and assigned a private IPv4 address.

  • Can only be provided when cloning to a new Linode.

region
string

This is the Region where the Linode will be deployed. To view all available Regions you can deploy to, run List regions.

  • Region can only be provided and is required when cloning to a new Linode.

type
string

A Linode’s Type determines what resources are available to it, including disk space, memory, and virtual cpus. The amounts available to a specific Linode are returned as specs on the Linode object.

To view all available Linode Types you can deploy with, run List types.

  • Type can only be provided and is required when cloning to a new Linode.

Response Samples

Responses

Initiate a DC migration/pending host migration

POST https://api.linode.com/v4/linode/instances/{linodeId}/migrate

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 are not allowed for Linodes that have a vpc purpose Configuration Profile Interface. Host migrations within the same DC are permitted.
  • 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.

Authorizations

personalAccessToken
oauthlinodes:read_write

Path Parameters

linodeIdinteger
Required

ID of the Linode to migrate.

Request Samples

Request Body Schema

placement_group
object

Include this to assign this Linode to an existing placement group in the data center you’re migrating to. These constraints apply:

  • If the target Linode is in a placement group, it will be removed from it when migrating.
  • The target placement group needs to be in the same region you’re migrating to.
  • The target placement group needs to have capacity. Run the Get a region operation for the region you want to migrate to, and store the maximum_linodes_per_pg value. Run the Get a placement group operation for that same region to review how many Linodes are in that group.

id
Required
integer

The placement group’s ID. You need to provide it for all operations impacting it.

region
string

The region to which the Linode will be migrated. Must be a valid region slug. A list of regions can be viewed by running the List regions operation. A cross data center migration will cancel a pending migration that has not yet been initiated. A cross data center migration will initiate a linode_migrate_datacenter_create event.

type
string
Enum: warm cold Default: cold

Type of migration used in moving to a new host or Linode type.

warm: the Linode will not power down until the migration is complete. Warm migrations are not available for DC migrations.

cold: the Linode will be powered down and migrated. When the migration is complete, the Linode will be powered on.

upgrade
boolean
Default: false

When initiating a cross DC migration, setting this value to true will also ensure that the Linode is upgraded to the latest generation of hardware that corresponds to your Linode’s Type, if any free upgrades are available for it. If no free upgrades are available, and this value is set to true, then the endpoint will return a 400 error code and the migration will not be performed. If the data center set in the region field does not allow upgrades, then the endpoint will return a 400 error code and the migration will not be performed.

Response Samples

Responses

Upgrade a Linode

POST https://api.linode.com/v4/linode/instances/{linodeId}/mutate

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.


Authorizations

personalAccessToken
oauthlinodes:read_write

Path Parameters

linodeIdinteger
Required

ID of the Linode to mutate.

Request Samples

Request Body Schema

allow_auto_disk_resize
boolean
Default: true

Automatically resize disks when resizing a Linode. When resizing down to a smaller plan your Linode’s data must fit within the smaller disk size.

Response Samples

Responses

Reset a Linode's root password

POST https://api.linode.com/v4/linode/instances/{linodeId}/password

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.

Authorizations

personalAccessToken
oauthlinodes:read_write

Path Parameters

linodeIdinteger
Required

ID of the Linode for which to reset its root password.

Request Samples

Request Body Schema

root_pass
Required
string

The root user’s password on this Linode. Linode passwords 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.

Response Samples

Responses

Reboot a Linode

POST https://api.linode.com/v4/linode/instances/{linodeId}/reboot

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.


Authorizations

personalAccessToken
oauthlinodes:read_write

Path Parameters

linodeIdinteger
Required

ID of the linode to reboot.

Request Samples

Request Body Schema

config_id
integer

The Linode Config ID to reboot into. If null or omitted, the last booted config will be used. If there was no last booted config and this Linode only has one config, it will be used. If a config cannot be determined, an error will be returned.

Response Samples

Responses

Rebuild a Linode

POST https://api.linode.com/v4/linode/instances/{linodeId}/rebuild

Rebuilds a Linode you have the read_write permission to modify.

A rebuild will first shut down the Linode, delete all disks and configs on the Linode, and then deploy 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.

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.

Authorizations

personalAccessToken
oauthlinodes:read_write

Path Parameters

linodeIdinteger
Required

ID of the Linode to rebuild.

Request Samples

Request Body Schema

authorized_keys
array of strings

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.

authorized_users
array of strings

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.

booted
boolean
Default: true

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.

disk_encryption
string
Enum: enabled disabled

Local disk encryption ensures that your data stored on compute instances is encrypted. Encryption converts the data on the compute instance into unreadable code. Decryption of the the disk requires other systems within the datacenter. This requirement protects against data leakage if the disk is removed from a datacenter, lost, stolen, recycled or disposed.

By default, encryption is enabled on all compute instances but you can opt-out of implementing this feature. If you opted-out of encryption or if the compute instance was created prior to the introduction of the local disk encryption support, you can encrypt your data using Rebuild.

image
Required
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.

metadata
object

Write-only An object containing user-defined data relevant to the creation of Linodes.

user_data
string<byte>

Base64-encoded cloud-config data.

Cannot be modified after provisioning. To update, use either the Clone a Linode or Rebuild a Linode operations.

Must not be included when cloning to an existing Linode.

Unencoded data must not exceed 65535 bytes, or about 16kb encoded.

root_pass
Required
string<password> 7..128 characters

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.

stackscript_data
object <= 65535 characters

This field is required only if the StackScript being deployed requires input data from the User for successful completion. See User Defined Fields (UDFs) for more details.

This field is required to be valid JSON.

Total length cannot exceed 65,535 characters.

stackscript_id
integer

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. This field cannot be used when deploying from a Backup or a Private Image.

type
string

The ID of the Linode type to resize to with this request.

Response Samples

Responses

Boot a Linode into rescue mode

POST https://api.linode.com/v4/linode/instances/{linodeId}/rescue

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.

  • Note that “sdh” is reserved and unavailable during rescue.

Authorizations

personalAccessToken
oauthlinodes:read_write

Path Parameters

linodeIdinteger
Required

ID of the Linode to rescue.

Request Samples

Request Body Schema

devices
object
sda
object

Device can be either a Disk or Volume identified by disk_id or volume_id. Only one type per slot allowed. Can be null. Devices mapped from sde through sdh are unavailable in fullvirt virt_mode.

disk_id
integer

The Disk ID, or null if a Volume is assigned to this slot.

volume_id
integer

The Volume ID, or null if a Disk is assigned to this slot.

sdb
object

Device can be either a Disk or Volume identified by disk_id or volume_id. Only one type per slot allowed. Can be null. Devices mapped from sde through sdh are unavailable in fullvirt virt_mode.

disk_id
integer

The Disk ID, or null if a Volume is assigned to this slot.

volume_id
integer

The Volume ID, or null if a Disk is assigned to this slot.

sdc
object

Device can be either a Disk or Volume identified by disk_id or volume_id. Only one type per slot allowed. Can be null. Devices mapped from sde through sdh are unavailable in fullvirt virt_mode.

disk_id
integer

The Disk ID, or null if a Volume is assigned to this slot.

volume_id
integer

The Volume ID, or null if a Disk is assigned to this slot.

sdd
object

Device can be either a Disk or Volume identified by disk_id or volume_id. Only one type per slot allowed. Can be null. Devices mapped from sde through sdh are unavailable in fullvirt virt_mode.

disk_id
integer

The Disk ID, or null if a Volume is assigned to this slot.

volume_id
integer

The Volume ID, or null if a Disk is assigned to this slot.

sde
object

Device can be either a Disk or Volume identified by disk_id or volume_id. Only one type per slot allowed. Can be null. Devices mapped from sde through sdh are unavailable in fullvirt virt_mode.

disk_id
integer

The Disk ID, or null if a Volume is assigned to this slot.

volume_id
integer

The Volume ID, or null if a Disk is assigned to this slot.

sdf
object

Device can be either a Disk or Volume identified by disk_id or volume_id. Only one type per slot allowed. Can be null. Devices mapped from sde through sdh are unavailable in fullvirt virt_mode.

disk_id
integer

The Disk ID, or null if a Volume is assigned to this slot.

volume_id
integer

The Volume ID, or null if a Disk is assigned to this slot.

sdg
object

Device can be either a Disk or Volume identified by disk_id or volume_id. Only one type per slot allowed. Can be null. Devices mapped from sde through sdh are unavailable in fullvirt virt_mode.

disk_id
integer

The Disk ID, or null if a Volume is assigned to this slot.

volume_id
integer

The Volume ID, or null if a Disk is assigned to this slot.

Response Samples

Responses

Resize a Linode

POST https://api.linode.com/v4/linode/instances/{linodeId}/resize

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.


Authorizations

personalAccessToken
oauthlinodes:read_write

Path Parameters

linodeIdinteger
Required

ID of the Linode to resize.

Request Samples

Request Body Schema

allow_auto_disk_resize
boolean
Default: true

Automatically resize disks when resizing a Linode. When resizing down to a smaller plan your Linode’s data must fit within the smaller disk size.

migration_type
string
Enum: warm cold Default: cold

Type of migration used in moving to a new host or Linode type.

warm: the Linode will not power down until the migration is complete. Warm migrations are not available for DC migrations.

cold: the Linode will be powered down and migrated. When the migration is complete, the Linode will be powered on.

type
Required
string

The ID representing the Linode Type.

Response Samples

Responses

Shut down a Linode

POST https://api.linode.com/v4/linode/instances/{linodeId}/shutdown

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.


Authorizations

personalAccessToken
oauthlinodes:read_write

Path Parameters

linodeIdinteger
Required

ID of the Linode to shutdown.

Request Samples

Response Samples

Responses