Skip to content

Commit b4b243c

Browse files
authored
Merge pull request #80106 from aravipra/OSDOCS-10891
OSDOCS-10891:dedicated troubleshooting section for data cleanup
2 parents 39c9db9 + 363dae5 commit b4b243c

7 files changed

+334
-0
lines changed

_topic_maps/_topic_map_ms.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -506,3 +506,5 @@ Topics:
506506
File: microshift-etcd-troubleshoot
507507
- Name: Additional information
508508
File: microshift-things-to-know
509+
- Name: Data cleanup
510+
File: microshift-cleanup-data
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
:_mod-docs-content-type: ASSEMBLY
2+
[id="microshift-cleanup-data"]
3+
= Data cleanup
4+
include::_attributes/attributes-microshift.adoc[]
5+
:context: microshift-cleanup-data
6+
7+
toc::[]
8+
9+
{microshift-short} provides the `microshift-cleanup-data` script for various troubleshooting tasks, such as deleting all data, certificates, and container images.
10+
11+
[WARNING]
12+
====
13+
Do not run this script without the guidance of product Support. Contact Support by xref:../microshift_support/microshift-getting-support.adoc#microshift-support-submitting-a-case_getting-support[Submitting a support case].
14+
====
15+
16+
include::modules/microshift-data-cleaning-overview.adoc[leveloffset=+1]
17+
include::modules/microshift-data-cleaning-full-cleanup.adoc[leveloffset=+1]
18+
include::modules/microshift-data-cleaning-container-images.adoc[leveloffset=+1]
19+
include::modules/microshift-data-cleaning-ovn-data.adoc[leveloffset=+1]
20+
include::modules/microshift-data-cleaning-certs.adoc[leveloffset=+1]
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * microshift_troubleshooting/microshift-cleanup-data.adoc
4+
5+
:_mod-docs-content-type: PROCEDURE
6+
[id="microshift-data-cleaning-certs_{context}"]
7+
= Cleaning custom certificates data
8+
9+
You can use the `microshift-cleanup-data` script to reset {microshift-short} custom certificates so that they are recreated when the {microshift-short} service restarts.
10+
11+
When you run the script with the `--cert` argument, you perform the following clean up actions:
12+
13+
* Stop all {microshift-short} services
14+
* Delete all {microshift-short} pods
15+
* Delete all {microshift-short} certificates
16+
17+
.Prerequisites
18+
* You are logged into {microshift-short} as an administrator with root-user access.
19+
* You have filed a support case.
20+
21+
.Procedure
22+
23+
. Clean up the {microshift-short} certificates by running the `microshift-cleanup-data` script with the `--cert` argument, by entering the following command:
24+
+
25+
[source,terminal]
26+
----
27+
$ sudo microshift-cleanup-data --cert
28+
----
29+
+
30+
.Example output
31+
[source,terminal]
32+
----
33+
Stopping MicroShift services
34+
Removing MicroShift pods
35+
Removing MicroShift certificates
36+
MicroShift service was stopped
37+
Cleanup succeeded
38+
----
39+
+
40+
[IMPORTANT]
41+
====
42+
The {microshift-short} service is stopped after you run the script.
43+
====
44+
45+
. Restart the {microshift-short} service by running the following command:
46+
+
47+
[source,terminal]
48+
----
49+
$ sudo systemctl start microshift
50+
----
Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * microshift_troubleshooting/microshift-cleanup-data.adoc
4+
5+
:_mod-docs-content-type: PROCEDURE
6+
[id="microshift-data-cleaning-container-images_{context}"]
7+
= Cleaning all data and keeping the container images
8+
9+
You can retain the {microshift-short} container images while cleaning all data by running the `microshift-cleanup-data` script with the `--all` and `--keep-images` arguments.
10+
11+
Keeping the container images helps speed up {microshift-short} restart after data clean up because the necessary container images are already present locally when you start the service.
12+
13+
When you run the script with the `--all` and `--keep-images` arguments, you perform the following clean up actions:
14+
15+
* Stop and disable all {microshift-short} services
16+
* Delete all {microshift-short} pods
17+
* Reset network configuration
18+
* Delete the `/var/lib/microshift` data directory
19+
* Delete OVN-K networking configuration
20+
21+
[WARNING]
22+
====
23+
This option deletes all {microshift-short} data and user workloads. Use with caution.
24+
====
25+
26+
.Prerequisites
27+
* You are logged into {microshift-short} as an administrator with root-user access.
28+
* You have filed a support case.
29+
30+
.Procedure
31+
32+
. Clean up all data and user workloads while retaining the {microshift-short} container images by running the `microshift-cleanup-data` script with the `--all` and `--keep-images` argument, by entering the following command:
33+
+
34+
[source,terminal]
35+
----
36+
$ sudo microshift-cleanup-data --all --keep-images
37+
----
38+
+
39+
.Example output
40+
[source,terminal]
41+
----
42+
DATA LOSS WARNING: Do you wish to stop and clean ALL MicroShift data AND cri-o container workloads?
43+
1) Yes
44+
2) No
45+
#? Yes
46+
Stopping MicroShift services
47+
Disabling MicroShift services
48+
Removing MicroShift pods
49+
Deleting the br-int interface
50+
Killing conmon, pause and OVN processes
51+
Removing MicroShift configuration
52+
Removing OVN configuration
53+
MicroShift service was stopped
54+
MicroShift service was disabled
55+
Cleanup succeeded
56+
----
57+
. Verify that the container images are still present by running the following command:
58+
+
59+
[source,terminal]
60+
----
61+
$ sudo crictl images | awk '{print $1}'
62+
----
63+
+
64+
.Example output
65+
[source,terminal]
66+
----
67+
IMAGE
68+
quay.io/openshift-release-dev/ocp-v4.0-art-dev
69+
quay.io/openshift-release-dev/ocp-v4.0-art-dev
70+
quay.io/openshift-release-dev/ocp-v4.0-art-dev
71+
quay.io/openshift-release-dev/ocp-v4.0-art-dev
72+
quay.io/openshift-release-dev/ocp-v4.0-art-dev
73+
quay.io/openshift-release-dev/ocp-v4.0-art-dev
74+
quay.io/openshift-release-dev/ocp-v4.0-art-dev
75+
quay.io/openshift-release-dev/ocp-v4.0-art-dev
76+
quay.io/openshift-release-dev/ocp-v4.0-art-dev
77+
quay.io/openshift-release-dev/ocp-v4.0-art-dev
78+
registry.redhat.io/lvms4/topolvm-rhel9
79+
registry.redhat.io/openshift4/ose-csi-external-provisioner
80+
registry.redhat.io/openshift4/ose-csi-external-resizer
81+
registry.redhat.io/openshift4/ose-csi-livenessprobe
82+
registry.redhat.io/openshift4/ose-csi-node-driver-registrar
83+
registry.redhat.io/ubi9
84+
----
85+
+
86+
[IMPORTANT]
87+
====
88+
The {microshift-short} service is stopped and disabled after you run the script.
89+
====
90+
. Restart the {microshift-short} service by running the following command:
91+
+
92+
[source,terminal]
93+
----
94+
$ sudo systemctl enable --now microshift
95+
----
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * microshift_troubleshooting/microshift-cleanup-data.adoc
4+
5+
:_mod-docs-content-type: PROCEDURE
6+
[id="microshift-data-cleaning-full-cleanup_{context}"]
7+
= Cleaning all data and configuration
8+
9+
You can clean up all the {microshift-short} data and configuration by running the `microshift-cleanup-data` script.
10+
11+
When you run the script with the `--all` argument, you perform the following clean up actions:
12+
13+
* Stop and disable all {microshift-short} services
14+
* Delete all {microshift-short} pods
15+
* Delete all container image storage
16+
* Reset network configuration
17+
* Delete the `/var/lib/microshift` data directory
18+
* Delete OVN-K networking configuration
19+
20+
.Prerequisites
21+
* You are logged into {microshift-short} as an administrator with root-user access.
22+
* You have filed a support case.
23+
24+
.Procedure
25+
26+
. Clean up all the {microshift-short} data and configuration by running the `microshift-cleanup-data` script with the `--all` argument, by entering the following command:
27+
+
28+
[WARNING]
29+
====
30+
This option deletes all {microshift-short} data and user workloads. Use with caution.
31+
====
32+
+
33+
[source,terminal]
34+
----
35+
$ sudo microshift-cleanup-data --all
36+
----
37+
+
38+
[TIP]
39+
====
40+
The script prompts you with a message to confirm the operation. Type 1 or Yes to continue. Any other entries cancel the clean up.
41+
====
42+
+
43+
.Example output when you continue the clean up
44+
[source,terminal]
45+
----
46+
DATA LOSS WARNING: Do you wish to stop and clean ALL MicroShift data AND cri-o container workloads?
47+
1) Yes
48+
2) No
49+
#? 1
50+
Stopping MicroShift services
51+
Disabling MicroShift services
52+
Removing MicroShift pods
53+
Removing crio image storage
54+
Deleting the br-int interface
55+
Killing conmon, pause and OVN processes
56+
Removing MicroShift configuration
57+
Removing OVN configuration
58+
MicroShift service was stopped
59+
MicroShift service was disabled
60+
Cleanup succeeded
61+
----
62+
+
63+
.Example output when you cancel the clean up
64+
[source,terminal]
65+
----
66+
DATA LOSS WARNING: Do you wish to stop and clean ALL MicroShift data AND cri-o container workloads?
67+
1) Yes
68+
2) No
69+
#? no
70+
Aborting cleanup
71+
----
72+
+
73+
[IMPORTANT]
74+
====
75+
The {microshift-short} service is stopped and disabled after you run the script.
76+
====
77+
. Restart the {microshift-short} service by running the following command:
78+
+
79+
[source,terminal]
80+
----
81+
$ sudo systemctl enable --now microshift
82+
----
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * microshift_troubleshooting/microshift-cleanup-data.adoc
4+
5+
:_mod-docs-content-type: PROCEDURE
6+
[id="microshift-data-cleaning-overview_{context}"]
7+
= Data cleanup script overview
8+
9+
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-short} service.
10+
11+
.Procedure
12+
13+
. See the usage and list the available options of the `microshift-cleanup-data` script by entering the following command:
14+
+
15+
[WARNING]
16+
====
17+
Some of the options in the following script operations are destructive and can cause data loss. See the procedure of each argument for warnings.
18+
====
19+
+
20+
[source,terminal]
21+
----
22+
$ microshift-cleanup-data
23+
----
24+
+
25+
.Example output
26+
[source,terminal]
27+
----
28+
Stop all MicroShift services, also cleaning their data
29+
30+
Usage: microshift-cleanup-data <--all [--keep-images] | --ovn | --cert>
31+
--all Clean all MicroShift and OVN data
32+
--keep-images Keep container images when cleaning all data
33+
--ovn Clean OVN data only
34+
--cert Clean certificates only
35+
----
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * microshift_troubleshooting/microshift-cleanup-data.adoc
4+
5+
:_mod-docs-content-type: PROCEDURE
6+
[id="microshift-data-cleaning-ovn-data_{context}"]
7+
= Cleaning the OVN-Kubernetes data
8+
9+
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.
10+
11+
When you run the script with the `--ovn` argument, you perform the following clean up actions:
12+
13+
* Stop all {microshift-short} services
14+
* Delete all {microshift-short} pods
15+
* Delete OVN-K networking configuration
16+
17+
.Prerequisites
18+
* You are logged into {microshift-short} as an administrator with root-user access.
19+
* You have filed a support case.
20+
21+
.Procedure
22+
23+
. Clean up the OVN-K data by running the `microshift-cleanup-data` script with the `--ovn` argument, by entering the following command:
24+
+
25+
[source,terminal]
26+
----
27+
$ sudo microshift-cleanup-data --ovn
28+
----
29+
+
30+
.Example output
31+
[source,terminal]
32+
----
33+
Stopping MicroShift services
34+
Removing MicroShift pods
35+
Killing conmon, pause and OVN processes
36+
Removing OVN configuration
37+
MicroShift service was stopped
38+
Cleanup succeeded
39+
----
40+
+
41+
[IMPORTANT]
42+
====
43+
The {microshift-short} service is stopped after you run the script.
44+
====
45+
. Restart the {microshift-short} service by running the following command:
46+
+
47+
[source,terminal]
48+
----
49+
$ sudo systemctl start microshift
50+
----

0 commit comments

Comments
 (0)