Creating placements

Though you can create and configure placements only in the admin panel, they are also applied in the self-service panel. Self-service users can use placements by creating VMs from images and flavors with assigned placements. After uploading an image in the self-service panel, a user cannot assign any placements to it. A VM created from such an image can only be placed on nodes that have placements in the soft mode or on nodes without any placements. When creating placements, ensure that you have either placements in the soft mode or some unassigned nodes. Otherwise self-service users will not be able to create VMs from their custom images.

Limitations

  • After adding a node to a placement, VMs already hosted on the node will not be automatically assigned this placement.
  • A virtual machine that is assigned a placement can only be migrated between nodes in this placement. When adding nodes to placements, make sure to provide migration options for various scenarios, including high availability and maintenance. Avoid situations when VMs cannot migrate because of limitations imposed by placements. In this case, a VM placement can be edited, as described in Managing virtual machines in placements.
  • If you create a placement after creating a project, the placement is not automatically enabled in the project quotas.

Prerequisites

  • A clear understanding of the placement modes, which are explained in Placement modes.

To create a placement

Admin panel

  1. Open the Compute > Nodes > Placements tab, and then click Create placement.
  2. Select the placement mode:

    • In the Soft mode, a VM can be placed on a node that is assigned at least the same placements as the VM. This mode allows placing a VM without assigned placements on any node.
    • In the Hard mode, a VM can be placed on a node that is assigned exactly the same placements as the VM.
  3. Specify a name for the new placement and, optionally, a description. The name should clearly state the distinctive feature of nodes in the placement. For example, Microsoft Windows Server license.

    A description should not contain any personally identifiable information or sensitive business data.

  4. In the Nodes section, click Add, and then select the nodes to assign the placement to. The same node can be added to several placements.
  5. In the Images and Flavors sections, click Add, and then select images and flavors to assign the placement to. VMs created from such images or flavors will automatically be assigned this placement.

  6. Click Create.

The new placement will appear in the list. To allow self-service users to create virtual machines from the images that are assigned this placement, include the placement into your project quotas.

Command-line interface

Use the following command:

vinfra service compute placement create [--isolated | --non-isolated] [--description <description>]
                                        [--nodes <nodes>] [--images <images>] [--flavors <flavors>]
                                        <placement-name>
--isolated
Create an isolated placement (hard policy, default)
--non-isolated
Create a non-isolated placement (soft policy)
--description <description>

Placement description

A description should not contain any personally identifiable information or sensitive business data.

--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
--flavors <flavors>
A comma-separated list of flavor IDs or names to assign to a compute placement
<placement-name>
Placement name

For example, to create a placement called placement1 with the hard policy and assign it to the nodes node001, node002, node003, as well as to the flavor with the ID 101, run:

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

The new placement will appear in the vinfra service compute placement list output:

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