PowerShell script exchange
Post Reply
0a80105
Lurker
Posts: 1
Liked: never
Joined: Oct 03, 2019 7:02 pm
Contact:

Exclude VM Hosts from Start Job by tag

Post by 0a80105 »

I'm using the community edition

I've been using a powershell script to start a VBRZIP backup of all my VM's pretty happily for a while.

I've found myself in a situation where I'd like to start running two seperate jobs. One with quiescence enabled and one without.
Currently I'm filling in entities by automatically listing all VM's on my host using:

$AllVMs = Find-VBRViEntity -Name * | Where-Object {($_.Type -eq "VM") -and ($_.PowerState -eq "PoweredOn")} | Sort-Object Name

and then running:
Start-VBRZip -Folder $BackupFolder -Entity $AllVms - Compression 5 -Autodelete 1Month -NetworkCredentials $Cred

I'm still a powershell noob but is it possible to exclude or include VM's based on VCenter tags?

Ideally I'd like one job that will backup everything without a specific tag, and another that will backup anything with a specific tag (with quiescence turned off).
I'd like to avoid listing each VM i'm backing up in a script if possible.. I like that as I create VM's I know they'll be automatically backed up every week without any input from me.

If using tags is over complicated in this scenario, my list of VM's that need quiescence is small, I'd be okay manually excluding those by host name if that's easier?

Thanks!
jhoughes
Veeam Vanguard
Posts: 282
Liked: 113 times
Joined: Apr 20, 2017 4:19 pm
Full Name: Joe Houghes
Location: Castle Rock, CO
Contact:

Re: Exclude VM Hosts from Start Job by tag

Post by jhoughes »

VeeamZIP doesn't allow for exclusions. You should be able to target the tags as the entity though.
Husband, Father, Solutions Architect, Geek | @DenverVMUG & @DenverPSUG leader | International Speaker | Veeam Vanguard | vExpert (PRO) | Cisco Champion
veremin
Product Manager
Posts: 20415
Liked: 2302 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Exclude VM Hosts from Start Job by tag

Post by veremin »

However, you can find VMs that have a specific tag assigned, using the one-liner mentioned here (check the last example). Then, you can add those VMs to VeeamZIP task. Thanks!
Post Reply

Who is online

Users browsing this forum: No registered users and 8 guests