Skip to content

Conversation

@amastbau
Copy link

@amastbau amastbau commented Apr 9, 2025

https://issues.redhat.com/browse/OADP-5608
https://issues.redhat.com/browse/OADP-5939
OADP-5608
OADP-5939

Summary of Changes:

  1. Move PVC Request Size Patch to Backup CSI Action
    Shifted the logic that patches the PVC request size (to match the corresponding VolumeSnapshot size) from the CSI Restore action to the CSI Backup action.
    ✅ This enables restoring a PVC independently using label selectors, without requiring the VolumeSnapshot to be restored first.

  2. Include VolumeSnapshot in CSI Additional Items for PVC
    Added VolumeSnapshot as an additional item in the PVC CSI backup logic to ensure necessary metadata is available during restore.

  3. Include VolumeSnapshotContent in CSI Restore Additional Items
    Added VolumeSnapshotContent to the additional items in the CSI restore action to support a more complete restore workflow.
    ✅ This to make sure those resources are restored even if filters out by label from the resources list to restore

Does your change fix a particular issue?

vmware-tanzu#8816*
*temporary fix until the 1.17 refactor for resources depende\Summary of Changes:

Please indicate you've done the following:

@openshift-ci openshift-ci bot requested review from eemcmullan and sseago April 9, 2025 08:05
@amastbau amastbau changed the title Enable selective PVC restore by moving size patch to backup action and updating CSI additional items Draft: Enable selective PVC restore by moving size patch to backup action and updating CSI additional items Apr 9, 2025
@amastbau amastbau force-pushed the support-selector-restore-vms branch from 42f4a1d to f47d28a Compare April 9, 2025 08:29
@amastbau amastbau changed the title Draft: Enable selective PVC restore by moving size patch to backup action and updating CSI additional items Enable selective PVC restore by moving size patch to backup action and updating CSI additional items Apr 9, 2025
@weshayutin
Copy link

/retest

@weshayutin
Copy link

@mpryc FYI

@weshayutin
Copy link

weshayutin commented Apr 15, 2025

test container based vm's restore via selector

All passed

Setup

BACKUP 3 cirros vm's

e.g. from vm-1

apiVersion: kubevirt.io/v1
kind: VirtualMachine
metadata:
  annotations:
  generation: 1
  labels:
    app: cirros-test-cont-1
  name: cirros-test-cont-1
  namespace: cirros-test-cont
spec:
  dataVolumeTemplates:
  - metadata:
      annotations:
        cdi.kubevirt.io/storage.deleteAfterCompletion: "false"
      creationTimestamp: null
      name: cirros-test-cont-1-dv
    spec:
      pvc:
        accessModes:
        - ReadWriteOnce
        resources:
          requests:
            storage: 150Mi
        volumeMode: Block
      source:
        registry:
          pullMethod: node
          url: docker://quay.io/kubevirt/cirros-container-disk-demo
  running: true
  template:
    metadata:
      creationTimestamp: null
      name: cirros-test-cont-1
    spec:
      architecture: amd64
      domain:
        devices:
          disks:
          - disk:
              bus: virtio
            name: volume0
          interfaces:
          - masquerade: {}
            name: default
          rng: {}
        machine:
          type: q35
        resources:
          requests:
            memory: 256M
      networks:
      - name: default
        pod: {}
      terminationGracePeriodSeconds: 0
      volumes:
      - dataVolume:
          name: cirros-test-cont-1-dv
        name: volume0

backup results

backup describe https://termbin.com/ma7l

Nuke the vm's from orbit

oc delete -f cirros-test-1.yaml -f cirros-test-2.yaml -f cirros-test-3.yaml

Restore ALL

https://termbin.com/utox

Nuke all, restore 1 vm via selector

https://termbin.com/21vg

Nuke all, restore 1 vm ( second vm) via selector

https://termbin.com/shi2

@amastbau amastbau force-pushed the support-selector-restore-vms branch 7 times, most recently from 15b28f4 to 71c11f1 Compare April 16, 2025 13:06
@openshift-merge-robot openshift-merge-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Apr 16, 2025
@amastbau amastbau force-pushed the support-selector-restore-vms branch 3 times, most recently from 1cfda00 to 0b67c2d Compare April 16, 2025 13:09
@openshift-merge-robot openshift-merge-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Apr 16, 2025
@amastbau amastbau force-pushed the support-selector-restore-vms branch from 0b67c2d to 1e5226b Compare April 16, 2025 13:12
@weshayutin
Copy link

/retest

@weshayutin
Copy link

weshayutin commented Apr 16, 2025

@amastbau RUUUUUUN make update and push PLEASE!
These tests are defined here:
https://github.com/openshift/release/blob/master/ci-operator/config/openshift/velero/openshift-velero-konveyor-dev.yaml#L29-L52

@amastbau amastbau force-pushed the support-selector-restore-vms branch 2 times, most recently from 2618367 to 89e4028 Compare April 16, 2025 17:10
@amastbau amastbau force-pushed the support-selector-restore-vms branch from effa263 to 13f3e2b Compare April 17, 2025 05:49
@amastbau
Copy link
Author

/retest

@amastbau
Copy link
Author

lint should be fine now

@mpryc
Copy link

mpryc commented Apr 17, 2025

/retest

2 similar comments
@mpryc
Copy link

mpryc commented Apr 17, 2025

/retest

@amastbau
Copy link
Author

/retest

@amastbau amastbau force-pushed the support-selector-restore-vms branch 3 times, most recently from 8931320 to 6a3095e Compare April 29, 2025 10:02
@amastbau amastbau force-pushed the support-selector-restore-vms branch from 7071499 to a18da3f Compare April 29, 2025 14:21
Move PVC Request Size Patch to Backup CSI Action
Shifted the logic that patches the PVC request size (to match the corresponding VolumeSnapshot size) from the CSI Restore action to the CSI Backup action.
✅ This enables restoring a PVC independently using label selectors, without requiring the VolumeSnapshot to be restored first.

Include VolumeSnapshot in CSI Additional Items for PVC
Added VolumeSnapshot as an additional item in the PVC CSI backup logic to ensure necessary metadata is available during restore.

Include VolumeSnapshotContent in CSI Restore Additional Items
Added VolumeSnapshotContent to the additional items in the CSI restore action to support a more complete restore workflow.
✅ This to make sure those resources are restored even if filters out by label from the resources list to restore

Author:    Amos Mastbaum <[email protected]>
Signed-off-by: Amos Mastbaum <[email protected]>

fixing-after-michal

wait-for-vsc.Status.RestoreSize

wait-for-vsc.Status.RestoreSize

Update pkg/util/csi/volume_snapshot.go

Update pkg/util/csi/volume_snapshot.go

Update pkg/util/csi/volume_snapshot.go
@amastbau amastbau force-pushed the support-selector-restore-vms branch from a18da3f to e1ec4c8 Compare April 29, 2025 14:31
@openshift-ci
Copy link

openshift-ci bot commented Apr 29, 2025

@amastbau: all tests passed!

Full PR test history. Your PR dashboard.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

@weshayutin
Copy link

WOOOT!

@sseago
Copy link

sseago commented Apr 29, 2025

/lgtm

@openshift-ci
Copy link

openshift-ci bot commented Apr 29, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: amastbau, sseago, weshayutin

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Apr 29, 2025
@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Apr 29, 2025
@openshift-merge-bot openshift-merge-bot bot merged commit 56ba9c6 into openshift:konveyor-dev Apr 29, 2025
4 checks passed
@weshayutin
Copy link

/cherry-pick oadp-1.5

@openshift-cherrypick-robot

@weshayutin: new pull request created: #381

Details

In response to this:

/cherry-pick oadp-1.5

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

oadp-rebasebot-cloner bot pushed a commit to oadp-rebasebot/velero that referenced this pull request Sep 4, 2025
Move PVC Request Size Patch to Backup CSI Action
Shifted the logic that patches the PVC request size (to match the corresponding VolumeSnapshot size) from the CSI Restore action to the CSI Backup action.
✅ This enables restoring a PVC independently using label selectors, without requiring the VolumeSnapshot to be restored first.

Include VolumeSnapshot in CSI Additional Items for PVC
Added VolumeSnapshot as an additional item in the PVC CSI backup logic to ensure necessary metadata is available during restore.

Include VolumeSnapshotContent in CSI Restore Additional Items
Added VolumeSnapshotContent to the additional items in the CSI restore action to support a more complete restore workflow.
✅ This to make sure those resources are restored even if filters out by label from the resources list to restore

Author:    Amos Mastbaum <[email protected]>
Signed-off-by: Amos Mastbaum <[email protected]>

fixing-after-michal

wait-for-vsc.Status.RestoreSize

wait-for-vsc.Status.RestoreSize

Update pkg/util/csi/volume_snapshot.go

Update pkg/util/csi/volume_snapshot.go

Update pkg/util/csi/volume_snapshot.go

Co-authored-by: Scott Seago <[email protected]>
oadp-rebasebot-cloner bot pushed a commit to oadp-rebasebot/velero that referenced this pull request Sep 5, 2025
Move PVC Request Size Patch to Backup CSI Action
Shifted the logic that patches the PVC request size (to match the corresponding VolumeSnapshot size) from the CSI Restore action to the CSI Backup action.
✅ This enables restoring a PVC independently using label selectors, without requiring the VolumeSnapshot to be restored first.

Include VolumeSnapshot in CSI Additional Items for PVC
Added VolumeSnapshot as an additional item in the PVC CSI backup logic to ensure necessary metadata is available during restore.

Include VolumeSnapshotContent in CSI Restore Additional Items
Added VolumeSnapshotContent to the additional items in the CSI restore action to support a more complete restore workflow.
✅ This to make sure those resources are restored even if filters out by label from the resources list to restore

Author:    Amos Mastbaum <[email protected]>
Signed-off-by: Amos Mastbaum <[email protected]>

fixing-after-michal

wait-for-vsc.Status.RestoreSize

wait-for-vsc.Status.RestoreSize

Update pkg/util/csi/volume_snapshot.go

Update pkg/util/csi/volume_snapshot.go

Update pkg/util/csi/volume_snapshot.go

Co-authored-by: Scott Seago <[email protected]>
oadp-rebasebot-cloner bot pushed a commit to oadp-rebasebot/velero that referenced this pull request Sep 11, 2025
Move PVC Request Size Patch to Backup CSI Action
Shifted the logic that patches the PVC request size (to match the corresponding VolumeSnapshot size) from the CSI Restore action to the CSI Backup action.
✅ This enables restoring a PVC independently using label selectors, without requiring the VolumeSnapshot to be restored first.

Include VolumeSnapshot in CSI Additional Items for PVC
Added VolumeSnapshot as an additional item in the PVC CSI backup logic to ensure necessary metadata is available during restore.

Include VolumeSnapshotContent in CSI Restore Additional Items
Added VolumeSnapshotContent to the additional items in the CSI restore action to support a more complete restore workflow.
✅ This to make sure those resources are restored even if filters out by label from the resources list to restore

Author:    Amos Mastbaum <[email protected]>
Signed-off-by: Amos Mastbaum <[email protected]>

fixing-after-michal

wait-for-vsc.Status.RestoreSize

wait-for-vsc.Status.RestoreSize

Update pkg/util/csi/volume_snapshot.go

Update pkg/util/csi/volume_snapshot.go

Update pkg/util/csi/volume_snapshot.go

Co-authored-by: Scott Seago <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants