kubevirt / kubevirt-velero-plugin

Plugin to Velero which automates backing up and restoring KubeVirt/CDI objects
Apache License 2.0
29 stars 28 forks source link

Backup fail if specify includeResources #132

Closed lxs137 closed 1 year ago

lxs137 commented 1 year ago

Is this a BUG REPORT or FEATURE REQUEST?:

/kind bug

What happened:

versions:

Create backup with specific vm-related resources (we don't want to backup resources managed by other operator)

spec:
  includedNamespaces:
  - vm-n1
  includedResources:
  - virtualmachines.kubevirt.io
  - virtualmachineinstances.kubevirt.io
  - pods
  - datavolumes.cdi.kubevirt.io
  - persistentvolumeclaims
  - persistentvolumes

but backup failed with exceptions "VMI owned by a VM and the VM is not included in the backup"

time="2023-02-03T08:49:06Z" level=info msg="1 errors encountered backup up item" backup=acs-dr/vm-backup-zd2gx logSource="pkg/backup/backup.go:413" name=n1-kk
time="2023-02-03T08:49:06Z" level=error msg="Error backing up item" backup=acs-dr/vm-backup-zd2gx error="error executing custom action (groupResource=virtualmachineinstances.kubevirt.io, namespace=vm-n1, name=n1-kk): rpc error: code = Unknown desc = VMI owned by a VM and the VM is not included in the backup" error.file="/go/src/github.com/vmware-tanzu/velero/pkg/backup/item_backupper.go:316" error.function="github.com/vmware-tanzu/velero/pkg/backup.(*itemBackupper).executeActions" logSource="pkg/backup/backup.go:417" name=n1-kk
time="2023-02-03T08:49:06Z" level=info msg="1 errors encountered backup up item" backup=acs-dr/vm-backup-zd2gx logSource="pkg/backup/backup.go:413" name=n1-kk
time="2023-02-03T08:49:06Z" level=error msg="Error backing up item" backup=acs-dr/vm-backup-zd2gx error="error executing custom action (groupResource=virtualmachines.kubevirt.io, namespace=vm-n1, name=n1-kk): rpc error: code = Unknown desc = VM cannot be safely backed up" error.file="/go/src/github.com/vmware-tanzu/velero/pkg/backup/item_backupper.go:316" error.function="github.com/vmware-tanzu/velero/pkg/backup.(*itemBackupper).executeActions" logSource="pkg/backup/backup.go:417" name=n1-kk

What you expected to happen:

How to reproduce it (as minimally and precisely as possible):

Anything else we need to know?:

Environment: