©XSIBackup-Free: Free Backup Software for ©VMWare ©ESXi

Forum ©XSIBackup: ©VMWare ©ESXi Backup Software


You are not logged in.

#1 Re: General matters » How to exclude VM's rather then include » 2018-05-17 16:38:02

Well, great news, thanks for sharing!

As for the REGEXP, you're right, if the names are selected with this feature in mind there is no problem but for us it's a bit of a hiccup because we're carrying a lot of legacy stuff and we only know XSIBackup for a few months (awesome tool by the way!) so we were not prepared for this naming convention.

Anyway, thanks for the info, we're looking forward to see what does version 11 can offer!

admin wrote:

but you are taking the matter to limits that are more in the custom development zone, than in the user program's

Well, as a developer myself I usually test the limits - sometimes unintentionally - of the softwares, sorry about that but hey this is how software evolves smile

XSIBackup is a great product and we really like it, just sometimes we hit a bump in the road and we're trying to figure a way around and this forum is a good place to start because people are throwing in ideas, different approaches.

I hope the community around it will grow further!

#2 Re: General matters » How to exclude VM's rather then include » 2018-05-17 15:43:20

bpreston wrote:

Apologies if you already know this, but if your VM hosts (that you want backed up) are relatively static*, you can send the entire list of VMs (which you do want backed up) in the commandline (or save it in your VMLIST value and import that).

The problem (complication) with this approach is that if you use a shell variable to do this, you can't send this variable to other host with the --host parameter. (Maybe you can, but I haven't figured it out yet)
Probably because the variable name gets to the other host not the content so you would need to maintain a list of VMs to be backed up from all your hosts in one place where the backup cron runs.
Sure, it can be done just as I wrote in my latest post

tothand wrote:

this complicates things when used with --host because then we need to gather the VM list through SSH from the remote host

The idea to prefix the "important" VMs with some string is nice but if you have a few hosts with a couple of dozen VMs already in place which doesn't follow this naming convention then you have a lot of extra work on your hands to rename them as needed.
(The problem is not the renaming but the whole administrative burden, e.g. the filenames won't match the VM name and if you have some custom scripts using the VM names for something those will have to be modified too.)

Or another approach is to have a static list of the VMs already in place and needed to be backed up AND having a unique prefix for the new VMs needed to be backed up so you end up with a command line like this:

xsibackup ... --backup-vms="vm1, vm2, vm3, REGEX(^prod_)" ...

So there are workarounds but none of them offers a clean, easily maintainable, unified solution.

Like you said:

bpreston wrote:

he "disks to backup" syntax has negative(exclusion) parameters, so it does seem odd that --backup-vms only uses positive(include) parameters.

By the way my problem is not that it can't be done but that no one willing to confirm this from the devteam and say "Sorry, it can't be done right now, maybe we will consider this in a future version" and then I won't have to bang my head against the wall how to do it or why I haven't figured it out yet smile

#3 Re: General matters » How to exclude VM's rather then include » 2018-05-15 08:44:16

admin wrote:

Off course it can be done with REGEX. You just need to create your matching expression.

Learning Regular Expressions is easy, but as everything it takes some time and a learning curve.
You can start here: Regexp tutorial

The documentation says

Select VMs using REGEXP:

Basic regular expressions are allowed to select VMs. The regexp engine in use is that of grep utility built into Busybox, in turn bundled with ESXi, thus if you want to practice expressions before you use them in your --backup-vms argument, you can just use this one-liner.

I'd like to point out the part  Basic regular expressions. In order to do an exclusion you would need a negative lookahead regex pattern e.g:

^(?!.*something)

And this is not part of the basic regular expression.

So unless all of us in the thread are missing something here the exclusion can't be done with regex since there is no argument like --exclude-vms="...."

The only solution I can think of is to create a vmlist in a wrapper shell script like this:
(offtopic: The awk filter below only works if there are no spaces in the VM names which is the case for me)

VMLIST=`vim-cmd vmsvc/getallvms | awk '!/Vmid/ && !/something/{print $2}'`

And then use it like this

xsibackup ... --backup-vms="$VMLIST" ...

This is basically the 3rd option you've mentioned in your first reply, but this complicates things when used with --host because then we need to gather the VM list through SSH from the remote host so the clean solution would be an official support for exclusion wither via a separate argument like --exclude-vms="..." or a modifier like --backup-vms="!skipthis,!skipthat,includethis".
My bet is on the former (--exclude-vms) since the exclamation mark already used in backup-vms to exclude certain disks from the backup.

So it seems that the feature request is legit because right now it's not possible to do a proper exclusion there are only workarounds which are creating further problems.

I'm not a regex guru myself so it is possible that there is a pattern which solves the issue. If you know it please share.

Thanks

On a personal note: I believe pointing someone to a regular expression tutorial site saying 'of course it can be done' when neither the documentation nor you have provided a working solution for the question is not cool even if you're right and there is a pattern which solves the issue.

Board footer