Correct me if I'm wrong, but shouldn't Volume creation be (almost) instant when they are created from Snapshots (with COW supported)?
Because now I can't use Velero to create PVC Backups (Velero creates PVC referencing Snapshot), as it copies the Snapshot image (created instantly) byte-for-byte over to a new image file, which just takes too long. I thought it would just do cp --reflink=always snap.img restored.img.
See:
|
def restore_snapshot( |
|
self, volume_id: str, name: str, destination: Path, temporary: bool = False |
|
): |
|
"""Restore a snapshot""" |
|
chunk_size = 1024 * 1024 |
|
snap_path = self._get_snapshot_path(volume_id, name, temporary) |
|
with open(snap_path, "rb") as src, open(destination, "wb") as dst: |
|
while True: |
|
buf = src.read(chunk_size) |
|
if not buf: |
|
break |
|
dst.write(buf) |
|
dst.flush() |
|
fsync(dst.fileno()) |
Used here:
|
snapshot_manager.restore_snapshot( |
|
source_volume_id, |
|
snapshot_name, |
|
img_file, |
|
source_type == VolumeSource.volume, |
|
) |
Correct me if I'm wrong, but shouldn't Volume creation be (almost) instant when they are created from Snapshots (with COW supported)?
Because now I can't use Velero to create PVC Backups (Velero creates PVC referencing Snapshot), as it copies the Snapshot image (created instantly) byte-for-byte over to a new image file, which just takes too long. I thought it would just do
cp --reflink=always snap.img restored.img.See:
rawfile-localpv/rawfile/utils/snapshot_manager.py
Lines 123 to 136 in 0593b89
Used here:
rawfile-localpv/rawfile/utils/volume_manager.py
Lines 148 to 153 in 0593b89