3.7. Managing placements

3.7. Managing placements

3.7.1. vinfra service compute placement create

Create a new compute placement:

usage: vinfra service compute placement create [--description <description>]
                                               [--nodes <nodes>] [--images <images>]
                                               <placement-name>
--description <description>
Placement description
--nodes <nodes>
A comma-separated list of compute node IDs or hostnames to assign to a compute placement
--images <images>
A comma-separated list of image IDs or names to assign to a compute placement
<placement-name>
Placement name

Example:

# vinfra service compute placement create placement1 --nodes node001,node002,node003
+-------------+--------------------------------------+
| Field       | Value                                |
+-------------+--------------------------------------+
| description |                                      |
| id          | e4230b75-a858-404c-be3b-4b3f2dedb057 |
| images      | 0                                    |
| name        | placement1                           |
| nodes       | 0                                    |
| servers     | 0                                    |
+-------------+--------------------------------------+

This command creates a placement called placement1 for the nodes node001, node002, node003.

3.7.2. vinfra service compute placement assign

Assign nodes or images to a placement:

usage: vinfra service compute placement assign (--images <images> | --nodes <nodes>)
                                               <placement>
--images <images>
A comma-separated list of image IDs to assign to a compute placement
--nodes <nodes>
A comma-separated list of compute node IDs to assign to a compute placement
<placement>
Placement ID or name

A virtual machine is assigned a placement when it is created from an image with the placement assigned. A VM can also inherit a placement from a volume created with an assigned image (refer to Creating, editing, and removing volumes). However, a VM does not inherit the placement and changes to it from the node. For example, if you add a node with existing VMs to a placement, only the node will have the placement. The VMs will not inherit the same placement. Likewise, if you have a node and VMs on it assigned to the same placement, and you delete such a node from a placement, only the node will change the placement. The VMs on it will still keep the original placement.

If you need to edit the VM placement, use the vinfra service compute server set command. Make sure that the node and its VMs have the same placement configuration.

Example:

# vinfra service compute placement assign \
--images b23e23e8-7338-4a09-a827-3c9c509cf35c placement1
Operation successful.

This command assigns the image with the ID b23e23e8-7338-4a09-a827-3c9c509cf35c to the placement placement1.

3.7.3. vinfra service compute placement delete-assign

Remove images and nodes from a compute placement:

usage: vinfra service compute placement delete-assign (--image <images> | --node <nodes>)
                                                      <placement>
--image <image>
An image ID to remove from a compute placement
--node <node>
A compute node ID to remove from a compute placement
<placement>
Placement ID or name

A virtual machine is assigned a placement when it is created from an image with the placement assigned. A VM can also inherit a placement from a volume created with an assigned image (refer to Creating, editing, and removing volumes). However, a VM does not inherit the placement and changes to it from the node. For example, if you add a node with existing VMs to a placement, only the node will have the placement. The VMs will not inherit the same placement. Likewise, if you have a node and VMs on it assigned to the same placement, and you delete such a node from a placement, only the node will change the placement. The VMs on it will still keep the original placement.

If you need to edit the VM placement, use the vinfra service compute server set command. Make sure that the node and its VMs have the same placement configuration.

Example:

# vinfra service compute placement delete-assign \
--image b23e23e8-7338-4a09-a827-3c9c509cf35c placement1
Operation successful.

This command removes the image with the ID b23e23e8-7338-4a09-a827-3c9c509cf35c from the placement placement1.

3.7.4. vinfra service compute placement list

List compute placements:

usage: vinfra service compute placement list [--long]
--long
Enable access and listing of all fields of objects.

Example:

# vinfra service compute placement list
+---------------------+------------+-------------+-------+--------+---------+
| id                  | name       | description | nodes | images | servers |
+---------------------+------------+-------------+-------+--------+---------+
| e4230b75-a858-<...> | placement1 |             |     3 |      0 |       0 |
+---------------------+------------+-------------+-------+--------+---------+

This command lists available compute placements.

3.7.5. vinfra service compute placement show

Display compute placement details:

usage: vinfra service compute placement show <placement>
<placement>
Placement ID or name

Example:

# vinfra service compute placement show placement1
+-------------+--------------------------------------+
| Field       | Value                                |
+-------------+--------------------------------------+
| description |                                      |
| id          | e4230b75-a858-404c-be3b-4b3f2dedb057 |
| images      | 0                                    |
| name        | placement1                           |
| nodes       | 0                                    |
| servers     | 0                                    |
+-------------+--------------------------------------+

This command shows the details of the placement placement1.

3.7.6. vinfra service compute placement update

Update a compute placement:

usage: vinfra service compute placement update [--name <placement-name>]
                                 [--description <placement-description>]
                                 <placement>
--name <placement-name>
A new name for the placement
--description <placement-description>
A new description for the placement
<placement>
Placement ID or name

Example:

# vinfra service compute placement update --name placement1-UPD placement1
Operation successful

This command renames the placement placement1 to placement1-UPD.

3.7.7. vinfra service compute placement delete

Delete a compute placement:

usage: vinfra service compute placement delete <placement>
<placement>
Placement ID or name

Example:

# vinfra service compute placement delete placement1-UPD
Operation successful

This command deletes the placement placement1-UPD.