Chapter 4. Creating and managing the cell within the Compute service After you have deployed the overcloud with your cell stacks, you must create the cell within the Compute service. To create the cell within the Compute service you create entries for the cell and message queue mappings in the global API database. You can then add Compute nodes to the cells by running the cell host discovery on one of the Controller nodes. To create your cells, you must perform the following tasks: Use the nova-manage utility to create the cell and message queue mapping records in the global API database. Add Compute nodes to each cell. Create an availability zone for each cell. Add all the Compute nodes in each cell to the availability zone for the cell. 4.1. Prerequisites You have configured and deployed your overcloud with multiple cells. 4.2. Creating the cell within the Compute service After you deploy the overcloud with a new cell stack, you must create the cell within the Compute service. To create the cell within the Compute service you create entries for the cell and message queue mappings in the global API database. NOTE: You must repeat this process for each cell that you create and launch. You can automate the steps in an Ansible playbook. For an example of an Ansible playbook, see the Create the cell and discover Compute nodes section of the OpenStack community documentation. Community documentation is provided as-is and is not officially supported. Procedure Get the IP addresses of the control plane and cell controller: Replace <controller_node> with the name of your Controller node, for example, controller-0 . Replace <cell_controller_node> with the name of your cell Controller node, for example, cell1-controller-0 . Add the cell information to all Controller nodes. This information is used to connect to the cell endpoint from the undercloud. The following example uses the prefix cell1 to specify only the cell systems and exclude the controller systems: Get the message queue endpoint for the controller cell from the transport_url parameter, and the database connection for the controller cell from the database.connection parameter: Log in to one of the global Controller nodes and create the cell: Check that the cell is created and appears in the cell list: Restart the Compute services on the Controller nodes: Check that the cell controller services are provisioned: 4.3. Adding Compute nodes to a cell Run the cell host discovery on one of the Controller nodes to discover the Compute nodes and update the API database with the node-to-cell mappings. Procedure Log in to the undercloud as the stack user. Get the IP address of the control plane for the cell: Replace <controller_node> with the name of your Controller node, for example, controller-0 . Expose and assign Compute hosts to the cell: Verify that the Compute hosts were assigned to the cell: 4.4. Creating a cell availability zone You must create an availability zone (AZ) for each cell to ensure that instances created on the Compute nodes in that cell are migrated only to other Compute nodes in the same cell. Migrating instances between cells is not supported. After you create the cell AZ you must add all the Compute nodes in the cell to the cell AZ. The default cell must be in a different availability zone from the Compute cells. Procedure Source the overcloudrc file: Create the AZ for the cell: Replace <availability_zone> with the name you want to assign to the availability zone. Replace <aggregate_name> with the name you want to assign to the host aggregate. Optional: Add metadata to the availability zone: Replace <key=value> with your metadata key-value pair. You can add as many key-value properties as required. Replace <aggregate_name> with the name of the availability zone host aggregate. Retrieve a list of the Compute nodes assigned to the cell: Add the Compute nodes assigned to the cell to the cell availability zone: Replace <aggregate_name> with the name of the availability zone host aggregate to add the Compute node to. Replace <host_name> with the name of the Compute node to add to the availability zone. Note You cannot use the OS::TripleO::Services::NovaAZConfig parameter to automatically create the AZ during deployment, because the cell is not created at this stage. Migrating instances between cells is not supported. To move an instance to a different cell, you must delete it from the old cell and re-create it in the new cell. For more information on host aggregates and availability zones, see Creating and managing host aggregates . 4.5. Deleting a Compute node from a cell To delete a Compute node from a cell, you must delete all instances from the cell and delete the host names from the Placement database. Procedure Delete all instances from the Compute nodes in the cell. Note Migrating instances between cells is not supported. You must delete the instances and re-create them in another cell. On one of the global Controllers, delete all Compute nodes from the cell: Replace <controller_node> with the name of the Controller node, for example, controller-0 . Delete the resource providers for the cell from the Placement service, to ensure that the host name is available in case you want to add Compute nodes with the same host name to another cell later: 4.6. Deleting a cell To delete a cell, you must first delete all instances and Compute nodes from the cell, as described in Deleting a Compute node from a cell . Then, you delete the cell itself and the cell stack. Procedure On one of the global Controllers, delete the cell: Replace <controller_node> with the name of the Controller node, for example, controller-0 . Launch the ephemeral Heat process and export the heat environment: Delete the cell stack from the overcloud: Note If you deployed separate cell stacks for a Controller and Compute cell, delete the Compute cell stack first and then the Controller cell stack. When the cell stack delete is complete, remove the ephemeral Heat process from the undercloud:

Commands:
CTRL_IP=USD(ansible-inventory -i /home/stack/overcloud-deploy/overcloud/config-download/overcloud/tripleo-ansible-inventory.yaml --host <controller_node> | jq -r .ctlplane_ip) CELL_CTRL_IP=USD(ansible-inventory -i /home/stack/overcloud-deploy/cell1/config-download/cell1/tripleo-ansible-inventory.yaml --host <cell_controller_node> | jq -r .ctlplane_ip)
(undercloud)USD CELL_INTERNALAPI_INFO=USD(ssh tripleo-admin@USD{CELL_CTRL_IP} egrep cell1.*\.internalapi /etc/hosts) (undercloud)USD ansible -i /home/stack/overcloud-deploy/overcloud/config-download/overcloud/tripleo-ansible-inventory.yaml Controller -b -m lineinfile -a "dest=/etc/hosts line=\"USDCELL_INTERNALAPI_INFO\""
(undercloud)USD CELL_TRANSPORT_URL=USD(ssh tripleo-admin@USD{CELL_CTRL_IP} sudo crudini --get /var/lib/config-data/puppet-generated/nova/etc/nova/nova.conf DEFAULT transport_url) (undercloud)USD CELL_MYSQL_VIP=USD(ssh tripleo-admin@USD{CELL_CTRL_IP} sudo crudini --get /var/lib/config-data/puppet-generated/nova/etc/nova/nova.conf database connection | awk -F[@/] '{print USD4}')
ssh tripleo-admin@USD{CTRL_IP} sudo podman exec -i -u root nova_api nova-manage cell_v2 create_cell --name cell1 --database_connection "{scheme}://{username}:{password}@USDCELL_MYSQL_VIP/nova?{query}" --transport-url "USDCELL_TRANSPORT_URL"
ssh tripleo-admin@USD{CTRL_IP} sudo podman exec -i -u root nova_api nova-manage cell_v2 list_cells --verbose
ansible -i /usr/bin/tripleo-ansible-inventory Controller -b -a "systemctl restart tripleo_nova_api tripleo_nova_conductor tripleo_nova_scheduler"
(overcloud)USD openstack compute service list -c Binary -c Host -c Status -c State +----------------+-------------------------+---------+-------+ | Binary | Host | Status | State | +----------------+-------------------------+---------+-------+ | nova-conductor | controller-0.ostest | enabled | up | | nova-scheduler | controller-0.ostest | enabled | up | | nova-conductor | cellcontroller-0.ostest | enabled | up | | nova-compute | compute-0.ostest | enabled | up | | nova-compute | compute-1.ostest | enabled | up | +----------------+-------------------------+---------+-------+
CTRL_IP=USD(ansible-inventory -i /home/stack/overcloud-deploy/overcloud/config-download/overcloud/tripleo-ansible-inventory.yaml --host <controller_node> | jq -r .ctlplane_ip)
ssh tripleo-admin@USD{CTRL_IP} sudo podman exec -i -u root nova_api nova-manage cell_v2 discover_hosts --by-service --verbose
ssh tripleo-admin@USD{CTRL_IP} sudo podman exec -i -u root nova_api nova-manage cell_v2 list_hosts
(undercloud)USD source ~/overcloudrc
(overcloud)# openstack aggregate create --zone <availability_zone> <aggregate_name>
(overcloud)# openstack aggregate set --property <key=value> <aggregate_name>
ssh tripleo-admin@USD{CTRL_IP} sudo podman exec -i -u root nova_api nova-manage cell_v2 list_hosts
(overcloud)# openstack aggregate add host <aggregate_name> <host_name>
CTRL_IP=USD(ansible-inventory -i /home/stack/overcloud-deploy/overcloud/config-download/overcloud/tripleo-ansible-inventory.yaml --host <controller_node> | jq -r .ctlplane_ip) ssh tripleo-admin@USD{CTRL_IP} sudo podman exec -i -u root nova_api nova-manage cell_v2 list_hosts ssh tripleo-admin@USD{CTRL_IP} sudo podman exec -i -u root nova_api nova-manage cell_v2 delete_host --cell_uuid <uuid> --host <compute>
(undercloud)USD source ~/overcloudrc (overcloud)USD openstack resource provider list +--------------------------------------+---------------------------------------+------------+ | uuid | name | generation | +--------------------------------------+---------------------------------------+------------+ | 9cd04a8b-5e6c-428e-a643-397c9bebcc16 | computecell1-novacompute-0.site1.test | 11 | +--------------------------------------+---------------------------------------+------------+ (overcloud)USD openstack resource provider delete 9cd04a8b-5e6c-428e-a643-397c9bebcc16
CTRL_IP=USD(ansible-inventory -i /home/stack/overcloud-deploy/overcloud/config-download/overcloud/tripleo-ansible-inventory.yaml --host <controller_node> | jq -r .ctlplane_ip) ssh tripleo-admin@USD{CTRL_IP} sudo podman exec -i -u root nova_api nova-manage cell_v2 list_cells ssh tripleo-admin@USD{CTRL_IP} sudo podman exec -i -u root nova_api nova-manage cell_v2 delete_cell --cell_uuid <uuid>
(undercloud)USD openstack tripleo launch heat --heat-dir /home/stack/overcloud-deploy/cell1/heat-launcher --restore-db (undercloud)USD export OS_CLOUD=heat
openstack stack delete <stack name> --wait --yes
(undercloud)USD openstack tripleo launch heat --kill