Skip to content

Use placement groups

This guide shows you how to create and manage placement groups using the evroc CLI.

Placement groups control how VMs are distributed across physical hardware to improve availability and resilience.

For information about placement groups and how they work, see Placement Groups.

  • Access to an evroc organization and project
  • evroc CLI installed and configured

Create a placement group with the spread strategy to ensure VMs run on different physical hosts:

Terminal window
evroc compute placementgroup create my-pg \
--zone=a \
--strategy-type spread

See Create a Placement Group in the API reference.

Add a VM to a placement group when creating it:

Terminal window
evroc compute virtualmachine create myvm \
--zone=a \
--running=true \
--compute-profile-ref=a1a.s \
--disk=mybootdisk \
--boot-from=true \
--placement-group=my-pg

Add an existing VM to a placement group (the VM must be stopped first):

Terminal window
evroc compute virtualmachine update myvm --running=false

Wait for the VM to stop, then add it to the placement group:

Terminal window
evroc compute virtualmachine update myvm --placement-group=my-pg

Start the VM again:

Terminal window
evroc compute virtualmachine update myvm --running=true

View information about a placement group, including which VMs are members:

Terminal window
evroc compute placementgroup get my-pg

See Get a Placement Group in the API reference.

List all placement groups in your project:

Terminal window
evroc compute placementgroup list

See List Placement Groups in the API reference.

Delete placement groups you no longer need. A placement group must not contain any VMs before you can delete it.

Terminal window
evroc compute placementgroup delete my-pg

See Delete a Placement Group in the API reference.