Este conteúdo não está disponível no idioma selecionado.
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:Warning- Some 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-data- Copy 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:Warning- This option deletes all MicroShift data and user workloads. Use with caution. - sudo microshift-cleanup-data --all - $ sudo microshift-cleanup-data --all- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow Tip- The 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 cleanup- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow Important- The 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 microshift- Copy 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-images- Copy 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 Important- The 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 microshift- Copy 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 --ovn- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - Example output - Copy to Clipboard Copied! - Toggle word wrap Toggle overflow Important- The 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 microshift- Copy 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 --cert- Copy 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 succeeded- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow Important- The 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 microshift- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow