Skip to content

Commit 65de9ec

Browse files
committed
wip
Signed-off-by: Daniil Loktev <[email protected]>
1 parent 1f8249d commit 65de9ec

File tree

1 file changed

+13
-0
lines changed
  • images/virtualization-artifact/pkg/controller/vm/internal/state

1 file changed

+13
-0
lines changed

images/virtualization-artifact/pkg/controller/vm/internal/state/state.go

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -359,6 +359,10 @@ func (s *state) ReadWriteOnceVirtualDisks(ctx context.Context) ([]*v1alpha2.Virt
359359
var nonMigratableVirtualDisks []*v1alpha2.VirtualDisk
360360

361361
for _, vd := range vdByName {
362+
if s.isHotpluggedDisk(vd.Name) {
363+
continue
364+
}
365+
362366
pvcKey := types.NamespacedName{Name: vd.Status.Target.PersistentVolumeClaim, Namespace: vd.Namespace}
363367
pvc, err := object.FetchObject(ctx, pvcKey, s.client, &corev1.PersistentVolumeClaim{})
364368
if err != nil {
@@ -383,3 +387,12 @@ func (s *state) ReadWriteOnceVirtualDisks(ctx context.Context) ([]*v1alpha2.Virt
383387

384388
return nonMigratableVirtualDisks, nil
385389
}
390+
391+
func (s *state) isHotpluggedDisk(diskName string) bool {
392+
for _, bdRef := range s.vm.Current().Status.BlockDeviceRefs {
393+
if bdRef.Kind == v1alpha2.VirtualDiskKind && bdRef.Name == diskName && bdRef.Hotplugged {
394+
return true
395+
}
396+
}
397+
return false
398+
}

0 commit comments

Comments
 (0)