Naming of backups

tsumaru720

Well-Known Member
May 1, 2016
66
2
48
44
Hi

I'd just like to put my two cents in here.

When managing a large estate of KVM and LXC containers (or OpenVZ if you're on Promox 3 still), the backup feature is really useful but I find its naming awkward sometimes. Lets say I have some backups of a few containers and then I remove the containers from production, some new different containers go in their place that now use their old container ID. A few months later when I'm looking at my backups I have no idea what these backups are for as I cant remember what each container does by just CTID.

It'd be nice if the backup tool also included current hostname in the filename (or even support custom naming and still having them show up in the backup UI)

Something like : vzdump-lxc-120-redis.example.com-2016_06_12-15_00_00.tar.lzo

I'd find managing my backups a lot easier If i have some kind of meaningful name in the filename.

Do you have any plans to implement something like this any time soon? :)
 
Doesnt appear to be ... :)

I see no hostname here

Code:
Jun 12 15:06:45 INFO: Starting Backup of VM 111 (lxc)
Jun 12 15:06:45 INFO: status = running
Jun 12 15:06:45 INFO: backup mode: suspend
Jun 12 15:06:45 INFO: ionice priority: 7
Jun 12 15:06:45 INFO: starting first sync /proc/16103/root// to /var/lib/vz/sync/dump/vzdump-lxc-111-2016_06_12-15_06_44.tmp
Jun 12 15:08:46 INFO: Number of files: 71,651 (reg: 59,602, dir: 8,030, link: 4,019)
Jun 12 15:08:46 INFO: Number of created files: 71,650 (reg: 59,602, dir: 8,029, link: 4,019)
Jun 12 15:08:46 INFO: Number of deleted files: 0
Jun 12 15:08:46 INFO: Number of regular files transferred: 59,593
Jun 12 15:08:46 INFO: Total file size: 1,728,664,602 bytes
Jun 12 15:08:46 INFO: Total transferred file size: 1,724,181,643 bytes
Jun 12 15:08:46 INFO: Literal data: 1,724,181,643 bytes
Jun 12 15:08:46 INFO: Matched data: 0 bytes
Jun 12 15:08:46 INFO: File list size: 2,359,119
Jun 12 15:08:46 INFO: File list generation time: 0.001 seconds
Jun 12 15:08:46 INFO: File list transfer time: 0.000 seconds
Jun 12 15:08:46 INFO: Total bytes sent: 1,728,940,122
Jun 12 15:08:46 INFO: Total bytes received: 1,191,026
Jun 12 15:08:46 INFO: sent 1,728,940,122 bytes  received 1,191,026 bytes  14,239,762.53 bytes/sec
Jun 12 15:08:46 INFO: total size is 1,728,664,602  speedup is 1.00
Jun 12 15:08:46 INFO: first sync finished (121 seconds)
Jun 12 15:08:46 INFO: suspend vm
Jun 12 15:08:46 INFO: starting final sync /proc/16103/root// to /var/lib/vz/sync/dump/vzdump-lxc-111-2016_06_12-15_06_44.tmp
Jun 12 15:08:51 INFO: Number of files: 71,651 (reg: 59,602, dir: 8,030, link: 4,019)
Jun 12 15:08:51 INFO: Number of created files: 0
Jun 12 15:08:51 INFO: Number of deleted files: 0
Jun 12 15:08:51 INFO: Number of regular files transferred: 0
Jun 12 15:08:51 INFO: Total file size: 1,728,664,602 bytes
Jun 12 15:08:51 INFO: Total transferred file size: 0 bytes
Jun 12 15:08:51 INFO: Literal data: 0 bytes
Jun 12 15:08:51 INFO: Matched data: 0 bytes
Jun 12 15:08:51 INFO: File list size: 131,069
Jun 12 15:08:51 INFO: File list generation time: 0.001 seconds
Jun 12 15:08:51 INFO: File list transfer time: 0.000 seconds
Jun 12 15:08:51 INFO: Total bytes sent: 1,799,949
Jun 12 15:08:51 INFO: Total bytes received: 8,520
Jun 12 15:08:51 INFO: sent 1,799,949 bytes  received 8,520 bytes  328,812.55 bytes/sec
Jun 12 15:08:51 INFO: total size is 1,728,664,602  speedup is 955.87
Jun 12 15:08:51 INFO: final sync finished (5 seconds)
Jun 12 15:08:51 INFO: resume vm
Jun 12 15:08:51 INFO: vm is online again after 5 seconds
Jun 12 15:08:51 INFO: creating archive '/var/lib/vz/sync/dump/vzdump-lxc-111-2016_06_12-15_06_44.tar.lzo'
Jun 12 15:10:37 INFO: Total bytes written: 1850296320 (1.8GiB, 17MiB/s)
Jun 12 15:10:37 INFO: archive file size: 1.08GB
Jun 12 15:10:41 INFO: Finished Backup of VM 111 (00:03:57)
 
hehe no problem

I still think it'd be more useful to have it in the filename but in the logs is a good start!

I'll keep an eye on the issue tracker - thanks
 
you can also use the recently introduced "pvesm extractconfig" feature to display the backed up configuration (which should include the hostname). note that for very very old backup archives, it might be a tad inefficient because it has to seek through the archive to find the config file.
 
@fabian

Am I doing something wrong here? :)

Code:
root@utsushi:/var/lib/vz/sync/dump# pveversion
pve-manager/4.4-5/c43015a5 (running kernel: 4.4.35-2-pve)
root@utsushi:/var/lib/vz/sync/dump# pvesm extractconfig vzdump-lxc-119-2017_01_20-01_16_40.tar.gz
cannot determine backup guest type for backup archive 'vzdump-lxc-119-2017_01_20-01_16_40.tar.gz'

I'd still very very much like backups to (automatically) be named like:

vzdump-lxc-119-some.example.hostname-2017_01_20-01_16_40.tar.gz or even to define a custom value which supports substitutions for various container config values etc...
 
pvesm extractconfig has an erroneous "/" in the regexp, so you need to use "/var/lib/vz/sync/dump/vzdump-....", or "./vzdump-..." if you are in the correct directory. it also supports "storage:dumpname", but in your case that probably won't work ;)

I'll send a patch to the list later, thanks for the reminder..
 
try:
Code:
pvesm extractconfig ./vzdump-lxc-119-2017_01_20-01_16_40.tar.gz
 

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!