Skip to main content

placement_groups

Creates, updates, deletes, gets or lists a placement_groups resource.

Overview

Nameplacement_groups
TypeResource
Idlinode.placement.placement_groups

Fields

The following fields are returned by SELECT queries:

Returns a single placement group object.

NameDatatypeDescription
idintegerThe placement group's ID. You need to provide it for all operations that affect it.
is_compliantbooleanWhether all of the compute instances in your placement group are compliant. If true, all compute instances meet either the grouped-together or spread-apart model, which you determine through your selected placement_group_type. If false, a compute instance is out of this compliance. For example, assume you've set anti-affinity:local as your placement_group_type and your group already has three qualifying compute instances on separate hosts, to support the spread-apart model. If a fourth compute instance is assigned that's on the same host as one of the existing three, the placement group is non-compliant. Enforce compliance in your group by setting a placement_group_policy. > 📘 > > Fixing compliance is not self-service. You need to wait for our assistance to physically move compute instances to make the group compliant again.
labelstringFilterable The unique name set for the placement group. A label has these constraints: - It needs to begin and end with an alphanumeric character. - It can only consist of alphanumeric characters, hyphens (-), underscores (_) or periods (.). (example: PG_Miami_failover)
membersarrayAn array of compute instances included in the placement group.
migrationsobjectAny compute instances that are being migrated to or from the placement group. Returned as null if no migrations are taking place.
placement_group_policystringHow requests to add future compute instances to your placement group are handled, and whether it remains compliant: - strict. Don't assign a new compute instance if it breaks the grouped-together or spread-apart model set by the placement_group_type. Use this to ensure the placement group stays compliant (is_compliant: true). - flexible. Assign a new compute instance, even if it breaks the grouped-together or spread-apart model set by the placement_group_type. This makes the group non-compliant (is_compliant: false). You need to wait for Akamai to move the offending compute instance to make it compliant again, once the necessary capacity is available in the region. Offers flexibility to add future compute instances if compliance isn't an immediate concern. <<LB>> > 📘 > > In rare cases, non-compliance can occur with a strict placement group if Akamai needs to failover or migrate your compute instances for maintenance. Fixing non-compliance for a strict placement group is prioritized over a flexible group. (example: strict)
placement_group_typestringFilterable, Read-only How compute instances are distributed in your placement group. A placement_group_type using anti-affinity (anti-affinity:local) places compute instances in separate hosts, but still in the same region. This best supports the spread-apart model for high availability. A placement_group_type using affinity places compute instances physically close together, possibly on the same host. This supports the grouped-together model for low-latency. > 📘 > > Currently, only anti_affinity:local is available for placement_group_type. (example: anti-affinity:local)
regionstringFilterable, Read-only The region where the placement group was deployed. (example: us-mia)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_placement_groupselectView a specific placement group by ID.

> 📘
>
> Your user needs at least read-only permission to all Linodes included in a placement group to view it. If you don't have this access and call this operation, the API returns a 403 error. Talk to your local account administrator about managing permissions.

Learn more...

Learn more...
get_placement_groupsselectpage, page_sizeReturns a paginated list of placement groups you have permission to view.

> 📘
>
> Your user needs at least read-only permission to all Linodes included in a placement group to view it. Placement groups that contain Linodes that you don't have this permission for are left out of the response. If all placement groups contain Linodes that lack this permission, the API returns a 403 error. Talk to your local account administrator about managing permissions.

Learn more...

Learn more...
post_placement_groupinsertdata__placement_group_type, data__placement_group_policy, data__label, data__regionCreates a placement group on your account. Placement groups disperse your Linodes across physical machines (hosts) in one of our compute regions. Depending on your workload requirements, you may need your Linodes to follow specific strategies:

- Grouped together. You may want them placed close together to reduce latency between Linodes that are used for an application or workload.

- Spread apart. You may want to disperse them across several hosts to support high availability, for example when required for failover.

We offer an example API workflow you can follow to create a placement group.

> 📘
>
> To run this operation, your user needs the add_linodes grant. Talk to your local account administrator about grant management for your user.

Learn more...

Learn more...
put_placement_groupreplaceChange the label for a specific placement group. This is the only value you can update. However, you can add more Linodes or remove existing ones.

> 📘
>
> To update a placement group, your user grants need to include read_write permission to all of the Linodes in the group. Talk to your local account administrator about grant management for your user.

Learn more...

Learn more...
delete_placement_groupdeleteDeletes a placement group you have permission to read_write.

- Deleting a placement group can't be undone.

- All Linodes need to be removed before you can delete a placement group.

- If your placement group is non-compliant, you can't delete it. You need to wait for our help to bring it compliant.

<<LB>>

> 📘
>
> To run this operation, your user needs the add_linodes grant. Talk to your local account administrator about grant management for your user.

Learn more...

Learn more...
post_group_add_linodeexecAdd a Linode to your placement group. Check out our example API workflow to create a placement group and add Linodes.

> 📘
>
> To run this operation, your user needs the add_linodes grant and read-write permission to the Linodes you want to add to the group. Talk to your local account administrator about grant and permissions management.

Learn more...

Learn more...
post_group_unassignexecRemove a Linode from your placement group.

> 📘
>
> To run this operation, your user needs the add_linodes grant and read-write permission to the Linodes you want to remove from the group. Talk to your local account administrator about grant and permissions management.

Learn more...

Learn more...

Parameters

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

NameDatatypeDescription
pageintegerThe page of a collection to return.
page_sizeintegerThe number of items to return per page.

SELECT examples

View a specific placement group by ID.

> 📘
>
> Your user needs at least read-only permission to all Linodes included in a placement group to view it. If you don't have this access and call this operation, the API returns a 403 error. Talk to your local account administrator about managing permissions.

Learn more...

Learn more...

SELECT
id,
is_compliant,
label,
members,
migrations,
placement_group_policy,
placement_group_type,
region
FROM linode.placement.placement_groups;

INSERT examples

Creates a placement group on your account. Placement groups disperse your Linodes across physical machines (hosts) in one of our compute regions. Depending on your workload requirements, you may need your Linodes to follow specific strategies:

- Grouped together. You may want them placed close together to reduce latency between Linodes that are used for an application or workload.

- Spread apart. You may want to disperse them across several hosts to support high availability, for example when required for failover.

We offer an example API workflow you can follow to create a placement group.

> 📘
>
> To run this operation, your user needs the add_linodes grant. Talk to your local account administrator about grant management for your user.

Learn more...

Learn more...

INSERT INTO linode.placement.placement_groups (
data__label,
data__placement_group_policy,
data__placement_group_type,
data__region
)
SELECT
'{{ label }}' --required,
'{{ placement_group_policy }}' --required,
'{{ placement_group_type }}' --required,
'{{ region }}' --required
RETURNING
id,
is_compliant,
label,
members,
placement_group_policy,
placement_group_type,
region
;

REPLACE examples

Change the label for a specific placement group. This is the only value you can update. However, you can add more Linodes or remove existing ones.

> 📘
>
> To update a placement group, your user grants need to include read_write permission to all of the Linodes in the group. Talk to your local account administrator about grant management for your user.

Learn more...

Learn more...

REPLACE linode.placement.placement_groups
SET
data__label = '{{ label }}'
WHERE

RETURNING
id,
is_compliant,
label,
members,
placement_group_policy,
placement_group_type,
region;

DELETE examples

Deletes a placement group you have permission to read_write.

- Deleting a placement group can't be undone.

- All Linodes need to be removed before you can delete a placement group.

- If your placement group is non-compliant, you can't delete it. You need to wait for our help to bring it compliant.

<<LB>>

> 📘
>
> To run this operation, your user needs the add_linodes grant. Talk to your local account administrator about grant management for your user.

Learn more...

Learn more...

DELETE FROM linode.placement.placement_groups;

Lifecycle Methods

Add a Linode to your placement group. Check out our example API workflow to create a placement group and add Linodes.

> 📘
>
> To run this operation, your user needs the add_linodes grant and read-write permission to the Linodes you want to add to the group. Talk to your local account administrator about grant and permissions management.

Learn more...

Learn more...

EXEC linode.placement.placement_groups.post_group_add_linode 
@@json=
'{
"linodes": "{{ linodes }}"
}';