Commit 3365cd6
authored
Plan: Add pvc_name_template parameter support (#2547)
Add support for the pvcNameTemplate field in the Plan resource, which
allows customization of PVC names during VM migrations.
The pvcNameTemplate field enables users to define custom naming patterns
for Persistent Volume Claims using Go template syntax. This is especially
important for copy-offload migrations where the volume populator framework
requires explicit PVC naming templates.
Changes:
- Add pvc_name_template parameter to Plan.__init__()
- Store pvc_name_template as instance variable
- Add pvcNameTemplate to Plan spec in to_dict()
- Update docstring with parameter documentation
The template supports variables like:
- .VmName: source VM name
- .TargetVmName: target VM name
- .DiskIndex: disk index
- .PlanName: plan name
Example usage:
plan = Plan(
...
pvc_name_template="{{.TargetVmName}}-disk-{{.DiskIndex}}",
pvc_name_template_use_generate_name=False,
)
This feature is part of the Forklift Plan API and works with both
standard and copy-offload migrations.
Signed-off-by: smiron <smiron@redhat.com>1 parent 6bac9ea commit 3365cd6
1 file changed
+6
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| 25 | + | |
25 | 26 | | |
26 | 27 | | |
27 | 28 | | |
| |||
52 | 53 | | |
53 | 54 | | |
54 | 55 | | |
| 56 | + | |
55 | 57 | | |
56 | 58 | | |
57 | 59 | | |
| |||
77 | 79 | | |
78 | 80 | | |
79 | 81 | | |
| 82 | + | |
80 | 83 | | |
81 | 84 | | |
82 | 85 | | |
| |||
144 | 147 | | |
145 | 148 | | |
146 | 149 | | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
147 | 153 | | |
148 | 154 | | |
149 | 155 | | |
| |||
0 commit comments