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.
Prerequisites
Section titled “Prerequisites”- Access to an evroc organization and project
- evroc CLI installed and configured
Create a placement group
Section titled “Create a placement group”Create a placement group with the spread strategy to ensure VMs run on different physical hosts:
evroc compute placementgroup create my-pg \ --zone=a \ --strategy-type spreadSee Create a Placement Group in the API reference.
Add a VM to a placement group
Section titled “Add a VM to a placement group”Add a VM to a placement group when creating it:
evroc compute virtualmachine create myvm \ --zone=a \ --running=true \ --compute-profile-ref=a1a.s \ --disk=mybootdisk \ --boot-from=true \ --placement-group=my-pgAdd an existing VM to a placement group (the VM must be stopped first):
evroc compute virtualmachine update myvm --running=falseWait for the VM to stop, then add it to the placement group:
evroc compute virtualmachine update myvm --placement-group=my-pgStart the VM again:
evroc compute virtualmachine update myvm --running=trueView placement group details
Section titled “View placement group details”View information about a placement group, including which VMs are members:
evroc compute placementgroup get my-pgSee Get a Placement Group in the API reference.
List placement groups
Section titled “List placement groups”List all placement groups in your project:
evroc compute placementgroup listSee List Placement Groups in the API reference.
Delete a placement group
Section titled “Delete a placement group”Delete placement groups you no longer need. A placement group must not contain any VMs before you can delete it.
evroc compute placementgroup delete my-pgSee Delete a Placement Group in the API reference.
Next steps
Section titled “Next steps”- Learn how to create a virtual machine with a placement group
- See how to manage VM lifecycle including stopping VMs before changing placement groups