M
mihait
Guest
Hi,
I have a couple of pve boxes into a cluster and the backups(vzdumps) are going to a file server. The only problem with this setup is that is very hard to track a vm backup if you don't know the vm id ( and you need to find the dump quickly)
I have modified vzdump to append the hostname of the dumped vm to the output file. The option is called --savehostname
This is what I have modified:
proxmox_m1:/# diff /usr/sbin/vzdump /usr/sbin/alter.vzdump
52a53,55
> my $opt_savehostname;
>
>
422c425,428
< print STDERR "\t--restore FILENAME\trestore FILENAME\n";
---
> print STDERR "\t--restore FILENAME\trestore FILENAME\n\n";
>
> print STDERR "\t--savehostname \t\tappend VM hostname after the VMID\n";
>
1103c1109,1110
< 'dumpdir=s' => \$opt_dumpdir)) {
---
> 'dumpdir=s' => \$opt_dumpdir,
> 'savehostname'=> \$opt_savehostname)) {
1288c1295
<
---
>
1289a1297,1302
>
> if ($opt_savehostname) {
> $basename = $basename."-".$vmlist->{$vpsid}->{hostname};
>
> }
>
Hope that's usefull to others!
~Mihai
I have a couple of pve boxes into a cluster and the backups(vzdumps) are going to a file server. The only problem with this setup is that is very hard to track a vm backup if you don't know the vm id ( and you need to find the dump quickly)
I have modified vzdump to append the hostname of the dumped vm to the output file. The option is called --savehostname
This is what I have modified:
proxmox_m1:/# diff /usr/sbin/vzdump /usr/sbin/alter.vzdump
52a53,55
> my $opt_savehostname;
>
>
422c425,428
< print STDERR "\t--restore FILENAME\trestore FILENAME\n";
---
> print STDERR "\t--restore FILENAME\trestore FILENAME\n\n";
>
> print STDERR "\t--savehostname \t\tappend VM hostname after the VMID\n";
>
1103c1109,1110
< 'dumpdir=s' => \$opt_dumpdir)) {
---
> 'dumpdir=s' => \$opt_dumpdir,
> 'savehostname'=> \$opt_savehostname)) {
1288c1295
<
---
>
1289a1297,1302
>
> if ($opt_savehostname) {
> $basename = $basename."-".$vmlist->{$vpsid}->{hostname};
>
> }
>
Hope that's usefull to others!
~Mihai