Skip to content

Commit 5271673

Browse files
authored
Merge pull request #33758 from apinnick/mig686-pv-resize
MIG-686: PV resize
2 parents 960b11a + 9de0257 commit 5271673

File tree

3 files changed

+66
-0
lines changed

3 files changed

+66
-0
lines changed

migrating_from_ocp_3_to_4/advanced-migration-options-3-4.adoc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,5 +42,6 @@ include::modules/migration-writing-ansible-playbook-hook.adoc[leveloffset=+2]
4242

4343
include::modules/migration-changing-migration-plan-limits.adoc[leveloffset=+1]
4444
include::modules/migration-excluding-resources.adoc[leveloffset=+1]
45+
include::modules/migration-enabling-pv-resizing-dvm.adoc[leveloffset=+1]
4546

4647
:advanced-migration-options-3-4!:

migration-toolkit-for-containers/advanced-migration-options-mtc.adoc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,3 +41,4 @@ include::modules/migration-writing-ansible-playbook-hook.adoc[leveloffset=+2]
4141

4242
include::modules/migration-changing-migration-plan-limits.adoc[leveloffset=+1]
4343
include::modules/migration-excluding-resources.adoc[leveloffset=+1]
44+
include::modules/migration-enabling-pv-resizing-dvm.adoc[leveloffset=+1]
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * migrating_from_ocp_3_to_4/advanced-migration-options-3-4.adoc
4+
// * migration-toolkit-for-containers/advanced-migration-options-mtc.adoc
5+
6+
[id="migration-enabling-pv-resizing-dvm_{context}"]
7+
= Enabling persistent volume resizing for direct volume migration
8+
9+
You can enable persistent volume (PV) resizing for direct volume migration to avoid running out of disk space on the destination cluster.
10+
11+
When the disk usage of a PV reaches a configured level, the `MigrationController` custom resource (CR) compares the requested storage capacity of a persistent volume claim (PVC) to its actual provisioned capacity. Then, it calculates the space required on the destination cluster.
12+
13+
A `pv_resizing_threshold` parameter determines when PV resizing is used. The default threshold is `3%`. This means that PV resizing occurs when the disk usage of a PV is more than `97%`. You can increase this threshold so that PV resizing occurs at a lower disk usage level.
14+
15+
PVC capacity is calculated according to the following criteria:
16+
17+
* If the requested storage capacity (`spec.resources.requests.storage`) of the PVC is not equal to its actual provisioned capacity (`status.capacity.storage`), the greater value is used.
18+
* If a PV is provisioned through a PVC and then subsequently changed so that its PV and PVC capacities no longer match, the greater value is used.
19+
20+
.Prerequisites
21+
22+
* The PVCs must be attached to one or more running pods so that the `MigrationController` CR can execute commands.
23+
24+
.Procedure
25+
26+
. Log in to the host cluster.
27+
. Enable PV resizing by patching the `MigrationController` CR:
28+
+
29+
[source,terminal]
30+
----
31+
$ oc patch migrationcontroller migration-controller -p '{"spec":{"enable_dvm_pv_resizing":true}}' \ <1>
32+
--type='merge' -n openshift-migration
33+
----
34+
<1> Set the value to `false` to disable PV resizing.
35+
36+
. Optional: Update the `pv_resizing_threshold` parameter to increase the threshold:
37+
+
38+
[source,terminal]
39+
----
40+
$ oc patch migrationcontroller migration-controller -p '{"spec":{"pv_resizing_threshold":41}}' \ <1>
41+
--type='merge' -n openshift-migration
42+
----
43+
<1> The default value is `3`.
44+
+
45+
When the threshold is exceeded, the following status message is displayed in the `MigPlan` CR status:
46+
+
47+
[source,yaml]
48+
----
49+
status:
50+
conditions:
51+
...
52+
- category: Warn
53+
durable: true
54+
lastTransitionTime: "2021-06-17T08:57:01Z"
55+
message: 'Capacity of the following volumes will be automatically adjusted to avoid disk capacity issues in the target cluster: [pvc-b800eb7b-cf3b-11eb-a3f7-0eae3e0555f3]'
56+
reason: Done
57+
status: "False"
58+
type: PvCapacityAdjustmentRequired
59+
----
60+
+
61+
[NOTE]
62+
====
63+
For AWS gp2 storage, this message does not appear unless the `pv_resizing_threshold` is 42% or greater because of the way gp2 calculates volume usage and size. (link:https://bugzilla.redhat.com/show_bug.cgi?id=1973148[*BZ#1973148*])
64+
====

0 commit comments

Comments
 (0)