7.4. Removing a Compute node from the data plane
You can remove a Compute node from a node set on the data plane. If you remove all the nodes from a node set, then you must also remove the node set from the data plane.
Prerequisites
-
You are logged in to the RHOCP cluster as a user with
cluster-adminprivileges. - The workloads on the Compute nodes have been migrated to other Compute nodes.
Procedure
Access the remote shell for the
openstackclientpod:$ oc rsh -n openstack openstackclientRetrieve the IP address of the Compute node that you want to remove:
$ openstack hypervisor listRetrieve a list of your Compute nodes to identify the name and UUID of the node that you want to remove:
$ openstack compute service listDisable the
nova-computeservice on the Compute node to be removed:$ openstack compute service set <hostname> nova-compute --disable작은 정보Use the
--disable-reasonoption to add a short explanation on why the service is being disabled. This is useful if you intend to redeploy the Compute service.Exit the
OpenStackClientpod:$ exitSSH into the Compute node to be removed and stop the
ovnandnova-computecontainers:$ ssh -i <key_file_name> cloud-admin@<node_IP_address> [cloud-admin@<hostname> ~]$ sudo systemctl stop edpm_ovn_controller [cloud-admin@<hostname> ~]$ sudo systemctl stop edpm_ovn_metadata_agent [cloud-admin@<hostname> ~]$ sudo systemctl stop edpm_nova_compute-
Replace
<key_file_name>with the name and location of the SSH key pair file you created to enable Ansible to manage the RHEL nodes. -
Replace
<node_IP_address>with the IP address for the Compute node that you retrieved in step 2.
-
Replace
Remove the
systemdunit files that manage theovnandnova-computecontainers to prevent the agents from being automatically started and registered in the database if the removed node is rebooted:[cloud-admin@<hostname> ~]$ sudo rm -f /etc/systemd/system/edpm_ovn_controller [cloud-admin@<hostname> ~]$ sudo rm -f /etc/systemd/system/edpm_ovn_metadata_agent [cloud-admin@<hostname> ~]$ sudo rm -f /etc/systemd/system/edpm_nova_computeDisconnect from the Compute node:
$ exitAccess the remote shell for
openstackclient:$ oc rsh -n openstack openstackclientDelete the network agents for the Compute node to be removed:
$ openstack network agent list [--host <hostname>] $ openstack network agent delete <agent_id>Delete the
nova-computeservice for the Compute node to be removed:$ openstack compute service delete <node_uuid>-
Replace
<node_uuid>with the UUID of the node to be removed that you retrieved in step 3.
-
Replace
Exit the
OpenStackClientpod:$ exitRemove the node from the
OpenStackDataPlaneNodeSetCR:$ oc patch openstackdataplanenodeset/<node_set_name> --type json --patch '[{ "op": "remove", "path": "/spec/nodes/<node_name>" }]'-
Replace
<node_set_name>with the name of theOpenStackDataPlaneNodeSetCR that the node belongs to. -
Replace
<node_name>with the name of the node defined in thenodessection of theOpenStackDataPlaneNodeSetCR.
-
Replace
Create a file on your workstation to define the
OpenStackDataPlaneDeploymentCR to update the node set with the Compute node removed:apiVersion: dataplane.openstack.org/v1beta1 kind: OpenStackDataPlaneDeployment metadata: name: <node_set_deployment_name>-
Replace
<node_set_deployment_name>with the name of theOpenStackDataPlaneDeploymentCR. The name must be unique, must consist of lower case alphanumeric characters,-(hyphen) or.(period), and must start and end with an alphanumeric character.
작은 정보Give the definition file and the
OpenStackDataPlaneDeploymentCR unique and descriptive names that indicate the purpose of the modified node set.-
Replace
Add the
OpenStackDataPlaneNodeSetCR that you removed the node from:spec: nodeSets: - <nodeSet_name>-
Save the
OpenStackDataPlaneDeploymentCR deployment file. Deploy the
OpenStackDataPlaneDeploymentCR to delete the removed nodes:$ oc create -f openstack_data_plane_deploy.yaml -n openstackYou can view the Ansible logs while the deployment executes:
$ oc get pod -l app=openstackansibleee -w $ oc logs -l app=openstackansibleee -f --max-log-requests 10If the
oc logscommand returns an error similar to the following error, increase the--max-log-requestsvalue:error: you are attempting to follow 19 log streams, but maximum allowed concurrency is 10, use --max-log-requests to increase the limitVerify that the modified
OpenStackDataPlaneNodeSetCR is deployed:$ oc get openstackdataplanedeployment -n openstack NAME NODESETS STATUS MESSAGE openstack-data-plane ["openstack-data-plane"] True Setup Complete $ oc get openstackdataplanenodeset -n openstack NAME STATUS MESSAGE openstack-data-plane True NodeSet ReadyFor information about the meaning of the returned status, see Data plane conditions and states in Deploying Red Hat OpenStack Services on OpenShift.
If the status indicates that the data plane has not been deployed, then troubleshoot the deployment. For information, see Troubleshooting the data plane creation and deployment in Deploying Red Hat OpenStack Services on OpenShift.