vmware-tanzu / velero

Backup and migrate Kubernetes applications and their persistent volumes
https://velero.io
Apache License 2.0
8.78k stars 1.41k forks source link

Velero PV and PVC backup not working with local-path #5705

Closed DineshRajj closed 1 year ago

DineshRajj commented 1 year ago

velero version v1.10.0 rancher local path provisoner verison v0.0.23 Kubernetes v1.23 AWS plugin v 1.6.0

velero install \
    --provider aws \
    --plugins velero/velero-plugin-for-aws:v1.6.0 \
    --bucket backup \
    --secret-file ./credentials-velero \
    --use-volume-snapshots=false \
    --use-node-agent \
    --backup-location-config `region=minio,s3ForcePathStyle="true",s3Url=<url>

Backup command velero backup create --include-namespaces busychain --wait

Restore command

velero restore create --from-backup

PV and PVC are getting restored but no data is present inside

Velero pod logs

time="2022-12-18T18:27:31Z" level=info msg="label \"topology.kubernetes.io/zone\" is not present on PersistentVolume, checking deprecated label..." backup=velero/busychain8 logSource="pkg/backup/item_backupper.go:445" name=pvc-7815f09c-598b-4511-93b9-4a2aadeae29c namespace= persistentVolume=pvc-7815f09c-598b-4511-93b9-4a2aadeae29c resource=persistentvolumes
time="2022-12-18T18:27:31Z" level=info msg="label \"failure-domain.beta.kubernetes.io/zone\" is not present on PersistentVolume" backup=velero/busychain8 logSource="pkg/backup/item_backupper.go:449" name=pvc-7815f09c-598b-4511-93b9-4a2aadeae29c namespace= persistentVolume=pvc-7815f09c-598b-4511-93b9-4a2aadeae29c resource=persistentvolumes
time="2022-12-18T18:27:31Z" level=info msg="zone info not available in nodeAffinity requirements" backup=velero/busychain8 logSource="pkg/backup/item_backupper.go:454" name=pvc-7815f09c-598b-4511-93b9-4a2aadeae29c namespace= persistentVolume=pvc-7815f09c-598b-4511-93b9-4a2aadeae29c resource=persistentvolumes
time="2022-12-18T18:27:31Z" level=info msg="Persistent volume is not a supported volume type for snapshots, skipping." backup=velero/busychain8 logSource="pkg/backup/item_backupper.go:489" name=pvc-7815f09c-598b-4511-93b9-4a2aadeae29c namespace= persistentVolume=pvc-7815f09c-598b-4511-93b9-4a2aadeae29c resource=persistentvolumes

I am seeing the above in the logs Persistent volume is not a supported volume type for snapshots, skipping.. Every thing looks fine. Don't know what I am missing

reasonerjt commented 1 year ago

@DineshRajj I believe you don't wanna take snapshot for the PV. In this case, could you try setting --default-volumes-to-fs-backup when creating the backup?

more details please refer to velero backup create --help

cdrage commented 1 year ago

@reasonerjt Having the same issue too.

In my case i'm using:

velero install --use-node-agent --default-volumes-to-fs-backup --use-volume-snapshots=false --provider aws --plugins velero/velero-plugin-for-aws:v1.6.0 --secret-file creds --bucket velero --backup-location-config region=minio,s3ForcePathStyle="true",s3Url=http://192.168.1.190:9000

Then:

velero backup create valheim-test --selector app.kubernetes.io/name=valheim --default-volumes-to-fs-backup

Which results in the logs showing:

time="2023-01-03T16:29:22Z" level=info msg="label \"failure-domain.beta.kubernetes.io/zone\" is not present on PersistentVolume" backup=vel/valheim-1 logSource="pkg/backup/item_backupper.go:449" name=pvc-57956c9e-ea7d-4d6a-a300-ff3e87143628 namespace= persistentVolume=pvc-57956c9e-ea7d-4d6a-a300-ff3e87143628 resource=persistentvolumes
time="2023-01-03T16:29:22Z" level=info msg="zone info not available in nodeAffinity requirements" backup=vel/valheim-1 logSource="pkg/backup/item_backupper.go:454" name=pvc-57956c9e-ea7d-4d6a-a300-ff3e87143628 namespace= persistentVolume=pvc-57956c9e-ea7d-4d6a-a300-ff3e87143628 resource=persistentvolumes
time="2023-01-03T16:29:22Z" level=info msg="Persistent volume is not a supported volume type for snapshots, skipping." backup=vel/valheim-1 logSource="pkg/backup/item_backupper.go:489" name=pvc-57956c9e-ea7d-4d6a-a300-ff3e87143628 namespace= persistentVolume=pvc-57956c9e-ea7d-4d6a-a300-ff3e87143628 resource=persistentvolumes

Any ideas?

Lyndon-Li commented 1 year ago

@cdrage Below message doesn't indicate an error, it is expected when file system backup is enabled: Persistent volume is not a supported volume type for snapshots, skipping.

Could you check if the backup has completed and you are able to restore all the data?

cdrage commented 1 year ago

@Lyndon-Li Ended up being a configuration issue that I had with minio which was causing the issue.

Lyndon-Li commented 1 year ago

OK, thanks for the update. Then I will close the issue since it is a configuration problem, if needed, feel free to reopen it.