Chapter 9. Cleaning up data with support
You can use the microshift-cleanup-data script for troubleshooting tasks such as deleting data, certificates, and container images.
Do not run this script without the guidance of product Support. Contact Support by Submitting a support case.
9.1. Data cleanup script overview Copy linkLink copied to clipboard!
You can see the usage and list available options of the microshift-cleanup-data script by running the script without arguments. Running the script without arguments does not delete any data or stop the MicroShift service.
Procedure
See the usage and list the available options of the
microshift-cleanup-datascript by entering the following command:WarningSome script operations are destructive and can cause data loss. Review the specific procedure for each argument for detailed warnings.
$ microshift-cleanup-dataExample output
Stop all MicroShift services, also cleaning their data Usage: microshift-cleanup-data <--all [--keep-images] | --ovn | --cert> --all Clean all MicroShift and OVN data --keep-images Keep container images when cleaning all data --ovn Clean OVN data only --cert Clean certificates only
9.2. Cleaning all data and configuration Copy linkLink copied to clipboard!
You can clean up all the MicroShift data and configuration by running the microshift-cleanup-data script.
When you run the script with the --all argument, you perform the following clean up actions:
- Stop and disable all MicroShift services
- Delete all MicroShift pods
- Delete all container image storage
- Reset network configuration
-
Delete the
/var/lib/microshiftdata directory - Delete OVN-K networking configuration
Prerequisites
- You are logged into MicroShift.
- You have filed a support case.
Procedure
Clean up all the MicroShift data and configuration by running the
microshift-cleanup-datascript with the--allargument, by entering the following command:WarningThis option deletes all MicroShift data and user workloads. Use with caution.
$ sudo microshift-cleanup-data --allTipThe script prompts you to confirm the operation. Enter
1orYesto continue. Any other entry cancels the cleanup.Example output when you continue the cleanup
DATA LOSS WARNING: Do you wish to stop and clean ALL MicroShift data AND cri-o container workloads? 1) Yes 2) No #? 1 Stopping MicroShift services Disabling MicroShift services Removing MicroShift pods Removing crio image storage Deleting the br-int interface Killing conmon, pause and OVN processes Removing MicroShift configuration Removing OVN configuration MicroShift service was stopped MicroShift service was disabled Cleanup succeededExample output when you cancel the cleanup
DATA LOSS WARNING: Do you wish to stop and clean ALL MicroShift data AND cri-o container workloads? 1) Yes 2) No #? no Aborting cleanupImportantThe
microshift-cleanup-datascript stops and disables the MicroShift service.Restart the MicroShift service by running the following command:
$ sudo systemctl enable --now microshift
9.3. Cleaning all data and keeping the container images Copy linkLink copied to clipboard!
You can retain the MicroShift container images while cleaning all data by running the microshift-cleanup-data script with the --all and --keep-images arguments.
Keeping the container images helps speed up MicroShift restart after data clean up because the necessary container images are already present locally when you start the service.
When you run the script with the --all and --keep-images arguments, you perform the following clean up actions:
- Stop and disable all MicroShift services
- Delete all MicroShift pods
- Reset network configuration
-
Delete the
/var/lib/microshiftdata directory - Delete OVN-K networking configuration
This option deletes all MicroShift data and user workloads. Use with caution.
Prerequisites
- You are logged into MicroShift.
- You have filed a support case.
Procedure
Clean up all data and user workloads when retaining the MicroShift container images by running the following command:
$ sudo microshift-cleanup-data --all --keep-imagesExample output
DATA LOSS WARNING: Do you wish to stop and clean ALL MicroShift data AND cri-o container workloads? 1) Yes 2) No #? Yes Stopping MicroShift services Disabling MicroShift services Removing MicroShift pods Deleting the br-int interface Killing conmon, pause and OVN processes Removing MicroShift configuration Removing OVN configuration MicroShift service was stopped MicroShift service was disabled Cleanup succeededVerify that the container images are still present by running the following command:
$ sudo crictl images | awk '{print $1}'Example output
IMAGE quay.io/openshift-release-dev/ocp-v4.0-art-dev quay.io/openshift-release-dev/ocp-v4.0-art-dev quay.io/openshift-release-dev/ocp-v4.0-art-dev quay.io/openshift-release-dev/ocp-v4.0-art-dev quay.io/openshift-release-dev/ocp-v4.0-art-dev quay.io/openshift-release-dev/ocp-v4.0-art-dev quay.io/openshift-release-dev/ocp-v4.0-art-dev quay.io/openshift-release-dev/ocp-v4.0-art-dev quay.io/openshift-release-dev/ocp-v4.0-art-dev quay.io/openshift-release-dev/ocp-v4.0-art-dev registry.redhat.io/lvms4/topolvm-rhel9 registry.redhat.io/openshift4/ose-csi-external-provisioner registry.redhat.io/openshift4/ose-csi-external-resizer registry.redhat.io/openshift4/ose-csi-livenessprobe registry.redhat.io/openshift4/ose-csi-node-driver-registrar registry.redhat.io/ubi9ImportantThe
microshift-cleanup-datascript stops and disables the MicroShift service.Restart the MicroShift service by running the following command:
$ sudo systemctl enable --now microshift
9.4. Cleaning the OVN-Kubernetes data Copy linkLink copied to clipboard!
Reset OVN-Kubernetes (OVN-K) network configurations by running the microshift-cleanup-data script.
When you run the script with the --ovn argument, you perform the following clean up actions:
- Stop all MicroShift services
- Delete all MicroShift pods
- Delete the OVN-K networking configuration
Prerequisites
- You are logged into MicroShift.
- You have filed a support case.
Procedure
Clean up the OVN-K data by running the
microshift-cleanup-datascript with the--ovnargument, by entering the following command:$ sudo microshift-cleanup-data --ovnExample output
Stopping MicroShift services Removing MicroShift pods Killing conmon, pause and OVN processes Removing OVN configuration MicroShift service was stopped Cleanup succeededImportantThe
microshift-cleanup-datascript stops the MicroShift service.Restart the MicroShift service by running the following command:
$ sudo systemctl start microshift
9.5. Cleaning custom certificates data Copy linkLink copied to clipboard!
To recreate MicroShift custom certificates upon service restart, reset them by using the microshift-cleanup-data script.
When you run the script with the --cert argument, you perform the following clean up actions:
- Stop all MicroShift services
- Delete all MicroShift pods
- Delete all MicroShift certificates
Prerequisites
- You are logged into MicroShift.
- You have filed a support case.
Procedure
Clean up the MicroShift certificates by running the
microshift-cleanup-datascript with the--certargument, by entering the following command:$ sudo microshift-cleanup-data --certExample output
Stopping MicroShift services Removing MicroShift pods Removing MicroShift certificates MicroShift service was stopped Cleanup succeededImportantRunning the script stops the MicroShift service.
Restart the MicroShift service by running the following command:
$ sudo systemctl start microshift