Delete a compute node¶
Since MOSK 23.2, the OpenStack-related metadata is automatically removed during the graceful machine deletion through the Mirantis Container Cloud web UI. For the procedure, refer to Mirantis Container Cloud Operations Guide: Delete a cluster machine.
During the graceful machine deletion, the OpenStack Controller performs the following operations:
Disables the OpenStack Compute and Block Storage services on the node to prevent further scheduling of workloads to it.
Verifies if any resources are present on the node, for example, instances and volumes. By default, the OpenStack Controller blocks the removal process until the resources are removed by the user. To adjust this behavior to the needs of your cluster, refer to OpenStack Controller configuration.
Removes OpenStack services metadata including compute services, Neutron agents, and volume services.
Caution
You cannot collocate the OpenStack compute node with other cluster components, such as Ceph. If done so, refer to the removal steps of the collocated components when planning the maintenance window.
If your cluster runs MOSK 23.1 or older version, perfrom the following steps before you remove the node from the cluster through the web UI to correctly remove the OpenStack-related metadata from it:
Disable the compute service to prevent spawning of new instances. In the
keystone-client
pod, run:openstack compute service set --disable <cmp_host_name> nova-compute --disable-reason "Compute is going to be removed."
Migrate all workloads from the node. For more information, follow Nova official documentation: Migrate instances.
Ensure that there are no pods running on the node to delete by draining the node as instructed in the Kubernetes official documentation: Safely drain node.
Delete the compute service using the OpenStack API. In the
keystone-client
pod, run:openstack compute service delete <service_id>
Note
To obtain
<service_id>
, run:openstack compute service list --host <cmp_host_name>
Delete the Neutron Agent service. In the
keystone-client
pod, run:openstack network agent delete <agent_id>
Note
To obtain
<agent_id>
, run:openstack network agent list --host <cmp_host_name>