wasabi backup error "unable to rename"

robetus

Well-Known Member
Jul 8, 2017
54
1
48
Las Vegas, NV
I have successfully added a wasabi bucket to my proxmox server via s3sf and backups to it work with some VMs but with others I get the error:
Code:
ERROR: Backup of VM 118 failed - 
unable to rename '/mnt/wasabi-bucket/dump/vzdump-qemu-118-2020_04_26-17_23_49.vma.dat' to '/mnt/wasabi-bucket/dump/vzdump-qemu-118-2020_04_26-17_23_49.vma.lzo'
INFO: Failed at 2020-04-26 17:35:21
INFO: Backup job finished with errors
TASK ERROR: job errors
The default storage size for the wasabi bucket in proxmox is shown as 256tb so it can't be that there's not enough space in wasabi and on the VM there's also about triple what the backup file would be so it cannot be a space issue. Is there a setting inside proxmox or something else I can look at? It would be great to get this working 100% of the time. I don't see why it would work for some VMs and others not. Same OS on all VMs too.

I've tried all modes and all compression types.
 
Last edited:
Code:
unable to rename ...

Can you manually rename a (big) file in that mount point?

If Wasabi (which I have no personal experience with) cannot deal with this then a workaround would be to back up to a local storage and then have a hook move it to the wasabi mount after it is finished.

You will have to manually edit the backup job in /etc/pve/vzdump.cron and add the --script parameter. The example hook script can be found at /usr/share/doc/pve-manager/examples/vzdump-hook-script.pl

More can be found in our documentation: https://pve.proxmox.com/pve-docs/pve-admin-guide.html#chapter_vzdump
 
Would something like this work?:
Code:
#!/bin/bash

if [ "$1" == "backup-end" ]; then
  mv /var/lib/vz/dump/* /mnt/wasabi-bucket/
fi
Where would I put this script to get it to fire after the backup is finished. You stated:
You will have to manually edit the backup job in /etc/pve/vzdump.cron and add the --script parameter.
but I don't exactly know what that means, can you be more detailed please?
 
Sorry, the backup jobs are stored in /etc/pve/vzdump.cron in crontab format. Each line corresponds to a backup job by calling the vzdump CLI tool. There you can add the script parameter with the path to your script.
 
It worked, here is what I did in case anyone else is interested:

Create /etc/wasabi-backup.sh script:
Code:
#!/bin/bash

if [ "$1" == "backup-end" ]; then
  sleep 1m
  rm -rf /var/lib/vz/dump/*.tmp
  sleep 20
  mv /var/lib/vz/dump/* /mnt/wasabi-bucket/dump/
  sleep 3m
  mv /var/lib/vz/dump/*.log /mnt/wasabi-bucket/dump/
  rm -rf /var/lib/vz/dump/*.tmp
  rm -rf /var/lib/vz/dump/*.log
fi
You may have some permission problems with the script. I set permissions to 744 and it worked fine.

Edit /etc/vzdump.conf and add:
script: /etc/wasabi-backup.sh

And that's it. You obviously need to mount a wasabi bucket via s3sf first but this script will make sure all backups get to wasabi and off your local server. If you want to keep a local copy of the backup you can change mv to cp in the script. I do realize that all the pauses look a little crazy but what I've found is that proxmox takes a little time to place everything correctly and the last part of the script is just for a cleanup of the local backup dir.
 
Last edited: