Closed bernardgut closed 3 months ago
So as it turns out : in the docs at https://velero.io/docs/main/migration-case/ some information is missing. If you want to migrate data between clusters you need to install velero using : --use-node-agent
when installing velero then creating the backup with --snapshot-move-data
. Once you add those, the migration from on cluster with a StorageClass to another with another StorageClass worked fine.
Since that information was not part of the logs on cluster migration, I wasted a couple of days. You can see the detailed process in this page: ~https://velero.io/docs/main/csi/~ https://velero.io/docs/main/csi-snapshot-data-movement/.
Sorry for your inconvenience. I will create a PR to modify the document.
Close as the document PR already merged.
What steps did you take and what happened:
Test migrating a simple workload (wordpress) from cluster A to cluster B, following instructions there : https://velero.io/docs/main/migration-case/ and there https://velero.io/docs/main/restore-reference/#changing-pvpvc-storage-classes
Cluster A
workload consists of 2 openebs-zfs-localpv volumes (mariadb+wordpress) running on RKE2 1.30.1Cluster B
has linstor and openebs-zfs-localpv (set up for the migration) running on Talos 7.2 (K8s 1.30.1)The goal is to migrate from storageClass
openebs-zfs
(Cluster A
) tosa-hdd
(which is a linstor sc) (Cluster B
). For this I created the mapper cm as described in the docs above, and I am using the CSI snapshot driverBoth have the snapshotcontroller installed from there :https://github.com/piraeusdatastore/helm-charts/tree/main/charts/snapshot-controller which at the moment pulls v7.0.2 from upstream
Cluster A
:velero backup create
:success
:Click me
``` Name: www-backup Namespace: velero Labels: velero.io/storage-location=default Annotations: velero.io/resource-timeout=10m0s velero.io/source-cluster-k8s-gitversion=v1.30.1+rke2r1 velero.io/source-cluster-k8s-major-version=1 velero.io/source-cluster-k8s-minor-version=30 Phase: Completed Namespaces: Included: www Excluded:Cluster B
:velero restore
:success
Click me
``` Name: www-backup-20240527111555 Namespace: velero Labels:However, on
Cluster B
the pods stay inpending
because thePVs
never get instantiated, on thepvc
events we see :What did you expect to happen:
The workload to be successfully created and bound to the migrated pvc/pv
The following information will help us better understand what's going on:
bundle-2024-05-27-11-45-47.tar.gz
Anything else you would like to add:
Cluster A
: Relevant Logs of the snapshot-controller onCluster A
when runningvelero backup
:Click me
``` E0527 08:02:28.641756 1 snapshot_controller.go:223] error check and add Snapshot finalizers for snapshot [velero-wordpress-fkxbx]: snapshot controller failed to update www/velero-wordpress-fkxbx on API server: Operation cannot be fulfilled on volumesnapshots.snapshot.storage.k8s.io "velero-wordpress-fkxbx": the object has been modified; please apply your changes to the latest version and try again E0527 08:02:28.641824 1 snapshot_controller_base.go:470] could not sync snapshot "www/velero-wordpress-fkxbx": snapshot controller failed to update www/velero-wordpress-fkxbx on API server: Operation cannot be fulfilled on volumesnapshots.snapshot.storage.k8s.io "velero-wordpress-fkxbx": the object has been modified; please apply your changes to the latest version and try again I0527 08:02:28.641917 1 snapshot_controller.go:660] createSnapshotContent: Creating content for snapshot www/velero-wordpress-fkxbx through the plugin ... I0527 08:02:28.642700 1 event.go:364] Event(v1.ObjectReference{Kind:"VolumeSnapshot", Namespace:"www", Name:"velero-wordpress-fkxbx", UID:"8143a8e3-8971-4805-9639-558d09c78cac", APIVersion:"snapshot.storage.k8s.io/v1", ResourceVersion:"376222151", FieldPath:""}): type: 'Warning' reason: 'SnapshotFinalizerError' Failed to check and update snapshot: snapshot controller failed to update www/velero-wordpress-fkxbx on API server: Operation cannot be fulfilled on volumesnapshots.snapshot.storage.k8s.io "velero-wordpress-fkxbx": the object has been modified; please apply your changes to the latest version and try again I0527 08:02:28.654529 1 snapshot_controller.go:941] Added protection finalizer to persistent volume claim www/wordpress I0527 08:02:28.665616 1 event.go:364] Event(v1.ObjectReference{Kind:"VolumeSnapshot", Namespace:"www", Name:"velero-wordpress-fkxbx", UID:"8143a8e3-8971-4805-9639-558d09c78cac", APIVersion:"snapshot.storage.k8s.io/v1", ResourceVersion:"376222152", FieldPath:""}): type: 'Normal' reason: 'CreatingSnapshot' Waiting for a snapshot www/velero-wordpress-fkxbx to be created by the CSI driver. I0527 08:02:30.632069 1 event.go:364] Event(v1.ObjectReference{Kind:"VolumeSnapshot", Namespace:"www", Name:"velero-wordpress-fkxbx", UID:"8143a8e3-8971-4805-9639-558d09c78cac", APIVersion:"snapshot.storage.k8s.io/v1", ResourceVersion:"376222179", FieldPath:""}): type: 'Normal' reason: 'SnapshotReady' Snapshot www/velero-wordpress-fkxbx is ready to use. E0527 08:02:31.035087 1 snapshot_controller_base.go:470] could not sync snapshot "www/velero-wordpress-fkxbx": snapshot controller failed to update www/velero-wordpress-fkxbx on API server: Operation cannot be fulfilled on volumesnapshots.snapshot.storage.k8s.io "velero-wordpress-fkxbx": the object has been modified; please apply your changes to the latest version and try again I0527 08:02:31.035226 1 event.go:364] Event(v1.ObjectReference{Kind:"VolumeSnapshot", Namespace:"", Name:"", UID:"", APIVersion:"snapshot.storage.k8s.io/v1", ResourceVersion:"", FieldPath:""}): type: 'Warning' reason: 'SnapshotStatusUpdateFailed' Snapshot status update failed, snapshot controller failed to update www/velero-wordpress-fkxbx on API server: Operation cannot be fulfilled on volumesnapshots.snapshot.storage.k8s.io "velero-wordpress-fkxbx": the object has been modified; please apply your changes to the latest version and try again E0527 08:02:33.767820 1 snapshot_controller.go:223] error check and add Snapshot finalizers for snapshot [velero-data-wordpress-mariadb-0-cwtsz]: snapshot controller failed to update www/velero-data-wordpress-mariadb-0-cwtsz on API server: Operation cannot be fulfilled on volumesnapshots.snapshot.storage.k8s.io "velero-data-wordpress-mariadb-0-cwtsz": the object has been modified; please apply your changes to the latest version and try again E0527 08:02:33.767895 1 snapshot_controller_base.go:470] could not sync snapshot "www/velero-data-wordpress-mariadb-0-cwtsz": snapshot controller failed to update www/velero-data-wordpress-mariadb-0-cwtsz on API server: Operation cannot be fulfilled on volumesnapshots.snapshot.storage.k8s.io "velero-data-wordpress-mariadb-0-cwtsz": the object has been modified; please apply your changes to the latest version and try again I0527 08:02:33.768002 1 snapshot_controller.go:660] createSnapshotContent: Creating content for snapshot www/velero-data-wordpress-mariadb-0-cwtsz through the plugin ... I0527 08:02:33.768393 1 event.go:364] Event(v1.ObjectReference{Kind:"VolumeSnapshot", Namespace:"www", Name:"velero-data-wordpress-mariadb-0-cwtsz", UID:"d9c6c57b-5f40-4fb7-a026-8f100653da16", APIVersion:"snapshot.storage.k8s.io/v1", ResourceVersion:"376222217", FieldPath:""}): type: 'Warning' reason: 'SnapshotFinalizerError' Failed to check and update snapshot: snapshot controller failed to update www/velero-data-wordpress-mariadb-0-cwtsz on API server: Operation cannot be fulfilled on volumesnapshots.snapshot.storage.k8s.io "velero-data-wordpress-mariadb-0-cwtsz": the object has been modified; please apply your changes to the latest version and try again I0527 08:02:33.777152 1 snapshot_controller.go:941] Added protection finalizer to persistent volume claim www/data-wordpress-mariadb-0 I0527 08:02:33.785423 1 event.go:364] Event(v1.ObjectReference{Kind:"VolumeSnapshot", Namespace:"www", Name:"velero-data-wordpress-mariadb-0-cwtsz", UID:"d9c6c57b-5f40-4fb7-a026-8f100653da16", APIVersion:"snapshot.storage.k8s.io/v1", ResourceVersion:"376222218", FieldPath:""}): type: 'Normal' reason: 'CreatingSnapshot' Waiting for a snapshot www/velero-data-wordpress-mariadb-0-cwtsz to be created by the CSI driver. I0527 08:02:35.758475 1 event.go:364] Event(v1.ObjectReference{Kind:"VolumeSnapshot", Namespace:"www", Name:"velero-data-wordpress-mariadb-0-cwtsz", UID:"d9c6c57b-5f40-4fb7-a026-8f100653da16", APIVersion:"snapshot.storage.k8s.io/v1", ResourceVersion:"376222244", FieldPath:""}): type: 'Normal' reason: 'SnapshotReady' Snapshot www/velero-data-wordpress-mariadb-0-cwtsz is ready to use. E0527 08:02:36.162898 1 snapshot_controller_base.go:470] could not sync snapshot "www/velero-data-wordpress-mariadb-0-cwtsz": snapshot controller failed to update www/velero-data-wordpress-mariadb-0-cwtsz on API server: Operation cannot be fulfilled on volumesnapshots.snapshot.storage.k8s.io "velero-data-wordpress-mariadb-0-cwtsz": the object has been modified; please apply your changes to the latest version and try again I0527 08:02:36.163039 1 event.go:364] Event(v1.ObjectReference{Kind:"VolumeSnapshot", Namespace:"", Name:"", UID:"", APIVersion:"snapshot.storage.k8s.io/v1", ResourceVersion:"", FieldPath:""}): type: 'Warning' reason: 'SnapshotStatusUpdateFailed' Snapshot status update failed, snapshot controller failed to update www/velero-data-wordpress-mariadb-0-cwtsz on API server: Operation cannot be fulfilled on volumesnapshots.snapshot.storage.k8s.io "velero-data-wordpress-mariadb-0-cwtsz": the object has been modified; please apply your changes to the latest version and try again E0527 08:02:40.279601 1 snapshot_controller_base.go:470] could not sync snapshot "www/velero-wordpress-fkxbx": snapshot controller failed to update velero-wordpress-fkxbx on API server: Operation cannot be fulfilled on volumesnapshots.snapshot.storage.k8s.io "velero-wordpress-fkxbx": StorageError: invalid object, Code: 4, Key: /registry/snapshot.storage.k8s.io/volumesnapshots/www/velero-wordpress-fkxbx, ResourceVersion: 0, AdditionalErrorMsg: Precondition failed: UID in precondition: 8143a8e3-8971-4805-9639-558d09c78cac, UID in object meta: E0527 08:02:41.284979 1 snapshot_controller_base.go:470] could not sync snapshot "www/velero-data-wordpress-mariadb-0-cwtsz": snapshot controller failed to update velero-data-wordpress-mariadb-0-cwtsz on API server: Operation cannot be fulfilled on volumesnapshots.snapshot.storage.k8s.io "velero-data-wordpress-mariadb-0-cwtsz": StorageError: invalid object, Code: 4, Key: /registry/snapshot.storage.k8s.io/volumesnapshots/www/velero-data-wordpress-mariadb-0-cwtsz, ResourceVersion: 0, AdditionalErrorMsg: Precondition failed: UID in precondition: d9c6c57b-5f40-4fb7-a026-8f100653da16, UID in object meta: ```Cluster A
:k get volumesnapshots
/volumesnapshotconents
NB: I created the
zfspv-snap-test
manually, by creating avolumesnapshot
to test before running the velero commands. It worked (the snapshot exists in thezfs list...
on the node), but the controller still returned the same errors as above. Note theRESTORESIZE
fieldCluster B
: Relevant Logs of the snapshot-controller onCluster B
when runningvelero restore
:Click me
``` I0526 19:02:51.950130 1 snapshot_controller.go:660] createSnapshotContent: Creating content for snapshot www/zfspv-snap-test through the plugin ... I0526 19:02:51.965987 1 snapshot_controller.go:941] Added protection finalizer to persistent volume claim www/wordpress E0526 19:02:51.966021 1 snapshot_controller.go:779] getCreateSnapshotInput failed to get PersistentVolume object [zfspv-snap-test]: Error: [&errors.errorString{s:"the PVC wordpress is not yet bound to a PV, will not attempt to take a snapshot"}] E0526 19:02:51.971025 1 snapshot_controller_base.go:470] could not sync snapshot "www/zfspv-snap-test": failed to get input parameters to create snapshot zfspv-snap-test: "the PVC wordpress is not yet bound to a PV, will not attempt to take a snapshot" I0526 19:02:51.971255 1 snapshot_controller.go:660] createSnapshotContent: Creating content for snapshot www/zfspv-snap-test through the plugin ... I0526 19:02:51.971280 1 snapshot_controller.go:925] Protection finalizer already exists for persistent volume claim www/wordpress E0526 19:02:51.971291 1 snapshot_controller.go:779] getCreateSnapshotInput failed to get PersistentVolume object [zfspv-snap-test]: Error: [&errors.errorString{s:"the PVC wordpress is not yet bound to a PV, will not attempt to take a snapshot"}] I0526 19:02:51.971698 1 event.go:364] Event(v1.ObjectReference{Kind:"VolumeSnapshot", Namespace:"", Name:"", UID:"", APIVersion:"snapshot.storage.k8s.io/v1", ResourceVersion:"", FieldPath:""}): type: 'Warning' reason: 'SnapshotContentCreationFailed' Failed to create snapshot content with error failed to get input parameters to create snapshot zfspv-snap-test: "the PVC wordpress is not yet bound to a PV, will not attempt to take a snapshot" E0526 19:02:51.979860 1 snapshot_controller_base.go:470] could not sync snapshot "www/zfspv-snap-test": failed to get input parameters to create snapshot zfspv-snap-test: "the PVC wordpress is not yet bound to a PV, will not attempt to take a snapshot" I0526 19:02:51.979918 1 event.go:364] Event(v1.ObjectReference{Kind:"VolumeSnapshot", Namespace:"www", Name:"zfspv-snap-test", UID:"a960ea68-7e59-4393-945d-b0e7d153c856", APIVersion:"snapshot.storage.k8s.io/v1", ResourceVersion:"59772", FieldPath:""}): type: 'Warning' reason: 'SnapshotContentCreationFailed' Failed to create snapshot content with error failed to get input parameters to create snapshot zfspv-snap-test: "the PVC wordpress is not yet bound to a PV, will not attempt to take a snapshot" I0526 19:02:51.980436 1 snapshot_controller.go:660] createSnapshotContent: Creating content for snapshot www/zfspv-snap-test through the plugin ... I0526 19:02:51.980455 1 snapshot_controller.go:925] Protection finalizer already exists for persistent volume claim www/wordpress E0526 19:02:51.980467 1 snapshot_controller.go:779] getCreateSnapshotInput failed to get PersistentVolume object [zfspv-snap-test]: Error: [&errors.errorString{s:"the PVC wordpress is not yet bound to a PV, will not attempt to take a snapshot"}] E0526 19:02:51.980491 1 snapshot_controller_base.go:470] could not sync snapshot "www/zfspv-snap-test": failed to get input parameters to create snapshot zfspv-snap-test: "the PVC wordpress is not yet bound to a PV, will not attempt to take a snapshot" I0526 19:02:52.971670 1 snapshot_controller.go:660] createSnapshotContent: Creating content for snapshot www/zfspv-snap-test through the plugin ... I0526 19:02:52.971714 1 snapshot_controller.go:925] Protection finalizer already exists for persistent volume claim www/wordpress E0526 19:02:52.971725 1 snapshot_controller.go:779] getCreateSnapshotInput failed to get PersistentVolume object [zfspv-snap-test]: Error: [&errors.errorString{s:"the PVC wordpress is not yet bound to a PV, will not attempt to take a snapshot"}] E0526 19:02:52.971755 1 snapshot_controller_base.go:470] could not sync snapshot "www/zfspv-snap-test": failed to get input parameters to create snapshot zfspv-snap-test: "the PVC wordpress is not yet bound to a PV, will not attempt to take a snapshot" I0526 19:03:00.972345 1 snapshot_controller.go:660] createSnapshotContent: Creating content for snapshot www/zfspv-snap-test through the plugin ... I0526 19:03:00.972369 1 snapshot_controller.go:925] Protection finalizer already exists for persistent volume claim www/wordpress E0526 19:03:00.972378 1 snapshot_controller.go:779] getCreateSnapshotInput failed to get PersistentVolume object [zfspv-snap-test]: Error: [&errors.errorString{s:"the PVC wordpress is not yet bound to a PV, will not attempt to take a snapshot"}] E0526 19:03:00.972401 1 snapshot_controller_base.go:470] could not sync snapshot "www/zfspv-snap-test": failed to get input parameters to create snapshot zfspv-snap-test: "the PVC wordpress is not yet bound to a PV, will not attempt to take a snapshot" I0526 19:03:16.972750 1 snapshot_controller.go:660] createSnapshotContent: Creating content for snapshot www/zfspv-snap-test through the plugin ... I0526 19:03:16.972778 1 snapshot_controller.go:925] Protection finalizer already exists for persistent volume claim www/wordpress E0526 19:03:16.972787 1 snapshot_controller.go:779] getCreateSnapshotInput failed to get PersistentVolume object [zfspv-snap-test]: Error: [&errors.errorString{s:"the PVC wordpress is not yet bound to a PV, will not attempt to take a snapshot"}] E0526 19:03:16.972812 1 snapshot_controller_base.go:470] could not sync snapshot "www/zfspv-snap-test": failed to get input parameters to create snapshot zfspv-snap-test: "the PVC wordpress is not yet bound to a PV, will not attempt to take a snapshot" I0526 19:03:30.817148 1 snapshot_controller.go:1020] checkandRemovePVCFinalizer[zfspv-snap-test]: Remove Finalizer for PVC wordpress as it is not used by snapshots in creation I0526 19:03:48.792116 1 snapshot_controller.go:899] isVolumeBeingCreatedFromSnapshot: volume data-wordpress-mariadb-0 is being created from snapshot velero-data-wordpress-mariadb-0-txd4s I0526 19:03:48.792254 1 event.go:364] Event(v1.ObjectReference{Kind:"VolumeSnapshot", Namespace:"www", Name:"velero-data-wordpress-mariadb-0-txd4s", UID:"3e27b8fd-6a60-42d9-89f3-ba448adebf54", APIVersion:"snapshot.storage.k8s.io/v1", ResourceVersion:"60350", FieldPath:""}): type: 'Warning' reason: 'SnapshotDeletePending' Snapshot is being used to restore a PVC I0526 19:03:48.801224 1 snapshot_controller.go:899] isVolumeBeingCreatedFromSnapshot: volume wordpress is being created from snapshot velero-wordpress-cj7tn I0526 19:03:48.801449 1 event.go:364] Event(v1.ObjectReference{Kind:"VolumeSnapshot", Namespace:"www", Name:"velero-wordpress-cj7tn", UID:"d807c56e-4bb9-4a82-ac59-c065cfd99284", APIVersion:"snapshot.storage.k8s.io/v1", ResourceVersion:"60351", FieldPath:""}): type: 'Warning' reason: 'SnapshotDeletePending' Snapshot is being used to restore a PVC I0527 09:16:02.330565 1 event.go:364] Event(v1.ObjectReference{Kind:"VolumeSnapshot", Namespace:"www", Name:"velero-data-wordpress-mariadb-0-fqsdz", UID:"612cc3fd-380e-4582-b46d-bcc670aa3f2f", APIVersion:"snapshot.storage.k8s.io/v1", ResourceVersion:"556046", FieldPath:""}): type: 'Normal' reason: 'SnapshotCreated' Snapshot www/velero-data-wordpress-mariadb-0-fqsdz was successfully created by the CSI driver. I0527 09:16:02.330631 1 event.go:364] Event(v1.ObjectReference{Kind:"VolumeSnapshot", Namespace:"www", Name:"velero-data-wordpress-mariadb-0-fqsdz", UID:"612cc3fd-380e-4582-b46d-bcc670aa3f2f", APIVersion:"snapshot.storage.k8s.io/v1", ResourceVersion:"556046", FieldPath:""}): type: 'Normal' reason: 'SnapshotReady' Snapshot www/velero-data-wordpress-mariadb-0-fqsdz is ready to use. I0527 09:16:02.730650 1 event.go:364] Event(v1.ObjectReference{Kind:"VolumeSnapshot", Namespace:"www", Name:"velero-wordpress-9krhg", UID:"5e39e4f8-7d13-4310-9526-5ccae9781e1a", APIVersion:"snapshot.storage.k8s.io/v1", ResourceVersion:"556052", FieldPath:""}): type: 'Normal' reason: 'SnapshotCreated' Snapshot www/velero-wordpress-9krhg was successfully created by the CSI driver. I0527 09:16:02.730784 1 event.go:364] Event(v1.ObjectReference{Kind:"VolumeSnapshot", Namespace:"www", Name:"velero-wordpress-9krhg", UID:"5e39e4f8-7d13-4310-9526-5ccae9781e1a", APIVersion:"snapshot.storage.k8s.io/v1", ResourceVersion:"556052", FieldPath:""}): type: 'Normal' reason: 'SnapshotReady' Snapshot www/velero-wordpress-9krhg is ready to use. I0527 09:16:02.930426 1 event.go:364] Event(v1.ObjectReference{Kind:"VolumeSnapshot", Namespace:"www", Name:"zfspv-snap-test", UID:"e1c75fca-a5bc-4d4b-9424-839ea8cd2abe", APIVersion:"snapshot.storage.k8s.io/v1", ResourceVersion:"556061", FieldPath:""}): type: 'Normal' reason: 'SnapshotCreated' Snapshot www/zfspv-snap-test was successfully created by the CSI driver. I0527 09:16:02.930448 1 event.go:364] Event(v1.ObjectReference{Kind:"VolumeSnapshot", Namespace:"www", Name:"zfspv-snap-test", UID:"e1c75fca-a5bc-4d4b-9424-839ea8cd2abe", APIVersion:"snapshot.storage.k8s.io/v1", ResourceVersion:"556061", FieldPath:""}): type: 'Normal' reason: 'SnapshotReady' Snapshot www/zfspv-snap-test is ready to use. ```Cluster B
:k get volumesnapshots
/volumesnapshotconents
NB: you can see some previous attempt to restore there. see the
AGE
columnI installed velero using the following command
Environment:
velero version
):velero client config get features
):features: EnableCSI,EnableAPIGroupVersions
kubectl version
):/etc/os-release
): see aboveVote on this issue!
This is an invitation to the Velero community to vote on issues, you can see the project's top voted issues listed here.
Use the "reaction smiley face" up to the right of this comment to vote.