이 콘텐츠는 선택한 언어로 제공되지 않습니다.
Chapter 9. Cleaning up data with support
MicroShift provides the microshift-cleanup-data script for various troubleshooting tasks, such as deleting all 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 링크 복사링크가 클립보드에 복사되었습니다!
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 of the options in the following script operations are destructive and can cause data loss. See the procedure of each argument for warnings.
microshift-cleanup-data
$ microshift-cleanup-dataCopy to Clipboard Copied! Toggle word wrap Toggle overflow Example output
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
9.2. Cleaning all data and configuration 링크 복사링크가 클립보드에 복사되었습니다!
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 as an administrator with root-user access.
- 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 --all
$ sudo microshift-cleanup-data --allCopy to Clipboard Copied! Toggle word wrap Toggle overflow TipThe script prompts you with a message to confirm the operation. Type 1 or Yes to continue. Any other entries cancel the clean up.
Example output when you continue the clean up
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Example output when you cancel the clean up
DATA LOSS WARNING: Do you wish to stop and clean ALL MicroShift data AND cri-o container workloads? 1) Yes 2) No #? no Aborting 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 cleanupCopy to Clipboard Copied! Toggle word wrap Toggle overflow ImportantThe MicroShift service is stopped and disabled after you run the script.
Restart the MicroShift service by running the following command:
sudo systemctl enable --now microshift
$ sudo systemctl enable --now microshiftCopy to Clipboard Copied! Toggle word wrap Toggle overflow
9.3. Cleaning all data and keeping the container images 링크 복사링크가 클립보드에 복사되었습니다!
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 as an administrator with root-user access.
- You have filed a support case.
Procedure
Clean up all data and user workloads while retaining the MicroShift container images by running the
microshift-cleanup-datascript with the--alland--keep-imagesargument, by entering the following command:sudo microshift-cleanup-data --all --keep-images
$ sudo microshift-cleanup-data --all --keep-imagesCopy to Clipboard Copied! Toggle word wrap Toggle overflow Example output
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Verify that the container images are still present by running the following command:
sudo crictl images | awk '{print $1}'$ sudo crictl images | awk '{print $1}'Copy to Clipboard Copied! Toggle word wrap Toggle overflow Example output
Copy to Clipboard Copied! Toggle word wrap Toggle overflow ImportantThe MicroShift service is stopped and disabled after you run the script.
Restart the MicroShift service by running the following command:
sudo systemctl enable --now microshift
$ sudo systemctl enable --now microshiftCopy to Clipboard Copied! Toggle word wrap Toggle overflow
9.4. Cleaning the OVN-Kubernetes data 링크 복사링크가 클립보드에 복사되었습니다!
You can clean up the OVN-Kubernetes (ONV-K) data by running the microshift-cleanup-data script. Use the script to reset OVN-K network configurations.
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 OVN-K networking configuration
Prerequisites
- You are logged into MicroShift as an administrator with root-user access.
- 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 --ovn
$ sudo microshift-cleanup-data --ovnCopy to Clipboard Copied! Toggle word wrap Toggle overflow Example output
Copy to Clipboard Copied! Toggle word wrap Toggle overflow ImportantThe MicroShift service is stopped after you run the script.
Restart the MicroShift service by running the following command:
sudo systemctl start microshift
$ sudo systemctl start microshiftCopy to Clipboard Copied! Toggle word wrap Toggle overflow
9.5. Cleaning custom certificates data 링크 복사링크가 클립보드에 복사되었습니다!
You can use the microshift-cleanup-data script to reset MicroShift custom certificates so that they are recreated when the MicroShift service restarts.
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 as an administrator with root-user access.
- 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 --cert
$ sudo microshift-cleanup-data --certCopy to Clipboard Copied! Toggle word wrap Toggle overflow Example output
Stopping MicroShift services Removing MicroShift pods Removing MicroShift certificates MicroShift service was stopped Cleanup succeeded
Stopping MicroShift services Removing MicroShift pods Removing MicroShift certificates MicroShift service was stopped Cleanup succeededCopy to Clipboard Copied! Toggle word wrap Toggle overflow ImportantThe MicroShift service is stopped after you run the script.
Restart the MicroShift service by running the following command:
sudo systemctl start microshift
$ sudo systemctl start microshiftCopy to Clipboard Copied! Toggle word wrap Toggle overflow