Backup error - zfs error: cannot create snapshot dataset already exists

Hugo Matos

Member
Mar 9, 2016
3
1
8
47
Hi,

Does anyone have this error?

INFO: starting new backup job: vzdump 130 --compress lzo --node local02 --storage local --mode snapshot --remove 0
INFO: filesystem type on dumpdir is 'zfs' -using /var/tmp/vzdumptmp28291 for temporary files
INFO: Starting Backup of VM 130 (lxc)
INFO: status = running
INFO: CT Name:
INFO: backup mode: snapshot
INFO: ionice priority: 7
INFO: create storage snapshot 'vzdump'
snapshot create failed: starting cleanup
no lock found trying to remove 'backup' lock
ERROR: Backup of VM 130 failed - zfs error: cannot create snapshot 'rpool/data/subvol-130-disk-2@vzdump': dataset already exists
INFO: Backup job finished with errors
TASK ERROR: job errors

I have no backup in the Backup tab but I have a vzdump in rpool/data

root@local02:~# zfs list -t snapshot
NAME USED AVAIL REFER MOUNTPOINT
rpool/data/subvol-130-disk-2@vzdump 137G - 246G -


Does anyone know how to solve this?

Thanks
 

Attachments

  • Screenshot from 2019-03-26 12-15-33.png
    Screenshot from 2019-03-26 12-15-33.png
    21.4 KB · Views: 40
You probably have an incomplete backup (something happened or you did something during a previous backup).

Just remove it with
Code:
zfs destroy rpool/data/subvol-130-disk-2@vzdump
and then try to backup again.
 
Hi,
I had the same problem on PBS and I simply solved by destroying the incomplete backup.

But the real problem is that BPS did not say anything about this problem in the log neither in report mails : I just discovered it by hand checking the PBS backup list. Is there a way to have an alert when something equivalent happened ?

Thank PROXMOX you for PBS which is a very nice piece of software and will certainly replace some of my backup scripts :)
 
the above does not fix it for me:

root@proxmox4:~# zfs list -t snapshot
NAME USED AVAIL REFER MOUNTPOINT
RAIDZ/vm-200-disk-0@__migration__ 21.5G - 80.8G -

root@proxmox4:~# zfs destroy rpool/data/RAIDZ/vm-200-disk-0@__migration__
cannot open 'rpool/data/RAIDZ/vm-200-disk-0': dataset does not exist
root@proxmox4:~#

What did I do wrong?
 
  • Like
Reactions: Moses93
the above does not fix it for me:

root@proxmox4:~# zfs list -t snapshot
NAME USED AVAIL REFER MOUNTPOINT
RAIDZ/vm-200-disk-0@__migration__ 21.5G - 80.8G -

root@proxmox4:~# zfs destroy rpool/data/RAIDZ/vm-200-disk-0@__migration__
cannot open 'rpool/data/RAIDZ/vm-200-disk-0': dataset does not exist
root@proxmox4:~#

What did I do wrong?

you need to do zfs destroy RAIDZ/vm-200-disk-0@__migration__ since the name of the pool is different
 
  • Like
Reactions: Curt Hall
I ran into this issue on a backup with multiple disks, which each had the @vzdump snapshot. I was able to delete all of them using:
Code:
zfs destroy -r tank@vzdump

Maybe there could be an option to automatically destroy any existing @vzdump snapshot prior to backup. I've had this happen several times.
 
  • Like
Reactions: Gilles
You probably have an incomplete backup (something happened or you did something during a previous backup).

Just remove it with
Code:
zfs destroy rpool/data/subvol-130-disk-2@vzdump
and then try to backup again.

can the remnants of an incomplete backup be automatically removed? Or how do I automate/script to figure out if there are any such remnants that should be removed?
 
Hi,
can the remnants of an incomplete backup be automatically removed? Or how do I automate/script to figure out if there are any such remnants that should be removed?
it should only be possible after a hard failure where cleanup couldn't complete and it will be removed when the next backup is taken.

If that is not enough, you need some script to check for the vzdump snapshot on the volumes and in container configs and remove those, making sure it doesn't belong to an active backup of course!
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!