INFN vs Unipd "segregation"
In order to "segregate" the Cloud, so that INFN users use only INFN resources and Unipd users use only Unipd resources, for each project there is a Host Aggregate which can be of the INFN/Unipd type. In this way the Host Aggregate of an INFN project will be called INFN-ProjectName, while the host aggregates Unipd-ProjectName refer to Unipd project
When a project is created, a new host aggregate for such project is automatically created.
E.g.:
[root@controller-02 ~]# openstack aggregate show INFN-SgaraPrj1 +-------------------+---------------------------------------------------------------------------------------+ | Field | Value | +-------------------+---------------------------------------------------------------------------------------+ | availability_zone | nova | | created_at | 2018-03-02T11:07:46.000000 | | deleted_at | None | | hosts | compute-01.cloud.pd.infn.it, compute-02.cloud.pd.infn.it, compute-04.cloud.pd.infn.it | | id | 52 | | is_deleted | False | | name | INFN-SgaraPrj1 | | properties | filter_tenant_id='ee1865a76440481cbcff08544c7d580a', size='normal' | | updated_at | 2018-06-08T08:33:10.000000 | | uuid | 675f6291-6997-470d-87e1-e9ea199a379f | +-------------------+---------------------------------------------------------------------------------------+ [root@controller-02 ~]#
So the aggregates specify the size=normal property (used basically in all flavors, unless you want to use custom scheduling) and the id of the project
To update the list of computes nodes of the already created host aggregates, you should use the script /usr/local/bin/aggregate_manage.sh available in cld-ctrl-01, specifying the type (INFN/Unipd) of the compute node. Using the same script it is also possible to remove a compute node from all host aggregates of a specific type.
For example if you have to add the INFN compute node cld-nl-14.cloud.pd.infn.it on the Cloud you have to login on cld-ctrl-01 and run
# ./usr/local/bin/aggregate_manage.sh add cld-nl-14.cloud.pd.infn.it INFN
while if you have to remove the Unipd compute node cld-blu-16.cloud.pd.infn.it to he Cloud you have to login on cld-ctrl-01 and run
# ./usr/local/bin/aggregate_manage.sh remove cld-blu-16.cloud.pd.infn.it Unipd
"Segregation" wrt used flavors (using the "size" property)
HostAggregates can also be used to have some compute nodes hosting only VMs instantiated using a specific flavor
By default all flavors have a size=normal property, e.g.:
[root@controller-02 ~]# openstack flavor show m1.tiny +----------------------------+----------------------------------------------+ | Field | Value | +----------------------------+----------------------------------------------+ | OS-FLV-DISABLED:disabled | False | | OS-FLV-EXT-DATA:ephemeral | 0 | | access_project_ids | None | | description | None | | disk | 1 | | id | 1 | | name | m1.tiny | | os-flavor-access:is_public | True | | properties | aggregate_instance_extra_specs:size='normal' | | ram | 512 | | rxtx_factor | 1.0 | | swap | 0 | | vcpus | 1 | +----------------------------+----------------------------------------------+ [root@controller-02 ~]#
Let's assume that you want that all VMs (of any project) using a special flavor (e.g. cloudveneto.1cores512MB5GB-compute-03), get instantiated on a specific compute node (e.g. compute-03) and this compute node should be used only for such VMs
The flavor must have a special tag (size=compute-03):
[root@controller-02 ~]# openstack flavor show fcc7000b-7abb-4b9c-a84d-643b2dd1e112 +----------------------------+--------------------------------------------------+ | Field | Value | +----------------------------+--------------------------------------------------+ | OS-FLV-DISABLED:disabled | False | | OS-FLV-EXT-DATA:ephemeral | 0 | | access_project_ids | ['ee1865a76440481cbcff08544c7d580a'] | | description | None | | disk | 5 | | id | fcc7000b-7abb-4b9c-a84d-643b2dd1e112 | | name | cloudveneto.1cores512MB5GB-compute-03 | | os-flavor-access:is_public | False | | properties | aggregate_instance_extra_specs:size='compute-03' | | ram | 512 | | rxtx_factor | 1.0 | | swap | 0 | | vcpus | 1 | +----------------------------+--------------------------------------------------+ [root@controller-02 ~]#
Then you need to setup an host aggregate with the property size=compute-03 which includes the desired host(s), in this case only compute-03:
[root@controller-02 ~]# openstack aggregate show 206 +-------------------+--------------------------------------+ | Field | Value | +-------------------+--------------------------------------+ | availability_zone | nova | | created_at | 2023-05-07T07:29:27.000000 | | deleted_at | None | | hosts | compute-03.cloud.pd.infn.it | | id | 206 | | is_deleted | False | | name | compute-03 | | properties | size='compute-03' | | updated_at | None | | uuid | ebbae242-47fb-4410-aaff-dd60ac8bf215 | +-------------------+--------------------------------------+
Important: the host (compute-03 in our example) must not belong to other host aggregates where the tenant_id is specified.
To check which host aggregates is using a compute node, you can query the database:
mysql> use nova_api; Database changed mysql> select * from aggregate_hosts where host="compute-03.cloud.pd.infn.it"; +---------------------+------------+-----+-----------------------------+--------------+ | created_at | updated_at | id | host | aggregate_id | +---------------------+------------+-----+-----------------------------+--------------+ | 2023-05-07 19:47:20 | NULL | 392 | compute-03.cloud.pd.infn.it | 206 | +---------------------+------------+-----+-----------------------------+--------------+ 1 row in set (0.00 sec)