Fix regression where multiple existing snaps on source prevented full copies to run.

This commit is contained in:
2022-10-26 13:05:42 +02:00
parent bc2f6f34fc
commit 512f7d664f
3 changed files with 3 additions and 2 deletions

View File

@@ -88,7 +88,7 @@ it's not aware of that paramter.
## Installation of prerequisites ## Installation of prerequisites
```apt install git pv gawk ```apt install git pv gawk jq
## Install the Script somewhere, eg to /opt ## Install the Script somewhere, eg to /opt

View File

@@ -387,7 +387,7 @@ function mirror() {
if [ -z $basets ]; then if [ -z $basets ]; then
log debug "No matching Snapshot found on destination - Full Copy $src_image_pool/$src_image_name$snapshot_name to $dst_image_pool/$dst_image_name" log debug "No matching Snapshot found on destination - Full Copy $src_image_pool/$src_image_name$snapshot_name to $dst_image_pool/$dst_image_name"
snapts=$(echo $currentlocal | sed -r -e 's/.*@mirror-(.*)/\1/') snapts=$(echo $currentlocal | sed -r -e 's/.*@mirror-(.*)/\1/')
snapshotsize=$(rbd du --pretty-format --format json $src_image_pool/$src_image_name|jq '.images[] | select (.snapshot_id == null) | {provisioned_size}.provisioned_size') snapshotsize=$(rbd du --pretty-format --format json $src_image_pool/$src_image_name|jq '.images[] | select (.snapshot_id == null) | {provisioned_size}.provisioned_size'|tail -1)
log debug "snapsize $snapname: $snapshotsize " log debug "snapsize $snapname: $snapshotsize "
xmitjob="rbd export --rbd-concurrent-management-ops 8 $src_image_pool/$src_image_name$snapshot_name --no-progress - | pv -s $snapshotsize -F \"VM $vm_id - Full xmit: $PVFORMAT_FULL\" | ssh $opt_destination rbd import --image-format 2 - $dst_image_pool/$dst_image_name" xmitjob="rbd export --rbd-concurrent-management-ops 8 $src_image_pool/$src_image_name$snapshot_name --no-progress - | pv -s $snapshotsize -F \"VM $vm_id - Full xmit: $PVFORMAT_FULL\" | ssh $opt_destination rbd import --image-format 2 - $dst_image_pool/$dst_image_name"
# create initial snapshot on destination # create initial snapshot on destination

1
eve4pve-barc Symbolic link
View File

@@ -0,0 +1 @@
../cv4pve-barc/eve4pve-barc