Commit ae951db
authored
fix(vmbda): fix VMBDA stuck in InProgress when cloning VM with hotplug disks (#2080)
Root cause: when cloning a VM, getVirtualDisks() set AttachedToVirtualMachines
to the original VM name from vmSnapshot.Spec.VirtualMachineName. This caused
WaitForFirstConsumer logic to bypass correctly since len(AttachedToVirtualMachines)==1.
Fix:
- snapshot_resources.go: pass operation type to getVirtualDisks() and only set
AttachedToVirtualMachines for restore operation. For clone, leave it empty
so WaitForFirstConsumer logic works correctly.
- vd_restorer.go: update AttachedToVirtualMachines in Customize() method for
defense in depth.
Signed-off-by: Daniil Antoshin <daniil.antoshin@flant.com>1 parent cfe9d24 commit ae951db
File tree
2 files changed
+17
-5
lines changed- images/virtualization-artifact/pkg/controller/service/restorer
- restorers
2 files changed
+17
-5
lines changedLines changed: 5 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
70 | 70 | | |
71 | 71 | | |
72 | 72 | | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
73 | 78 | | |
74 | 79 | | |
75 | 80 | | |
| |||
Lines changed: 12 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
112 | 112 | | |
113 | 113 | | |
114 | 114 | | |
115 | | - | |
| 115 | + | |
116 | 116 | | |
117 | 117 | | |
118 | 118 | | |
| |||
329 | 329 | | |
330 | 330 | | |
331 | 331 | | |
332 | | - | |
| 332 | + | |
333 | 333 | | |
334 | 334 | | |
335 | 335 | | |
| |||
343 | 343 | | |
344 | 344 | | |
345 | 345 | | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
346 | 355 | | |
347 | 356 | | |
348 | 357 | | |
| |||
362 | 371 | | |
363 | 372 | | |
364 | 373 | | |
365 | | - | |
366 | | - | |
367 | | - | |
| 374 | + | |
368 | 375 | | |
369 | 376 | | |
370 | 377 | | |
| |||
0 commit comments