cancel
Showing results for 
Search instead for 
Did you mean: 

How to Remove Client from VMware Query Based Policy via CLI

backup-botw
Level 6

I am curious if this holds true for even a VMware query based policy when it comes to removing a client from a policy via CLI...

Delete client from policy
/usr/openv/netbackup/bin/admincmd/bpplclients POLICYNAME -delete CLIENTNAME

2 ACCEPTED SOLUTIONS

Accepted Solutions

Systems_Team
Moderator
Moderator
   VIP   

Hi Mike,

I did a little bit of digging regarding this, as I'd never thought about doing this via command line.  I stumbled across this link:

Populating VMware Intelligent Policy Query

http://engineering.skybettingandgaming.com/2016/06/24/scripting-veritas-netbackup/

If you scroll down to the section titled "Populating VMware Intelligent Policy Query", you can see they used the bpplinclude command to add VM's to a VMware policy like this:

bpplinclude ${policy} -add vmware:/?filter=(Displayname Contains "nms0" OR Displayname Contains "nmsdb0") AND NOT Powerstate Equal poweredOff AND NOT Displayname Contains "stg" AND NOT Displayname Contains "tst"

I had a look at the options for bpplinclude, and as it also has the "-delete" option I'm wondering if this might work?  I haven't got time to try it at the moment to see if it does, and I don't have a need to do this via command line - but interested if it does work.

Steve

View solution in original post

Mike_Gavrilov
Moderator
Moderator
Partner    VIP    Accredited Certified

Oh. you'd like to go that deep. Ok. You can modify query via CLI https://www.veritas.com/support/en_US/article.v85982076_v118238945 and add exception but it's quite hard to write it just from scratch. It might be extremely long and complicated. If you just want to remove one client it's better to do it via GUI if you're going to script something you can run jnbSA, exclude unwanted client from the Query and  check jnbSA's log to see how NetBackup translated you query into command.

View solution in original post

10 REPLIES 10

P_Kesavan
Level 4
Certified

Hi ,

To remove the client from backup , just edit your Vmware backup query mentioned in the backup policy and exclude that particular client form the backup.

Please refer this Guide : NetBackup7.6_Admin.Guide_VMware

Page Number : 92 

 

Kesavan.P

Marianne
Moderator
Moderator
Partner    VIP    Accredited Certified
You did not create your query based policy via cli, right?
So why would you use cli to modify it?

Because I would like to. I quite honestly wasnt looking for a condescending remark, but just a simple answer. You have no idea what is occuring on the backend which is the reason for the question nor do you really need to know in order to give a more respectable answer. Quite rude on your part.

Thank you for your reply...I will investigate my question elsewhere as this has apparently turned into quite the hostile forum as of late.

Mike_Gavrilov
Moderator
Moderator
Partner    VIP    Accredited Certified

Simple answer is: There's no supported way to do so.

 

Systems_Team
Moderator
Moderator
   VIP   

Hi Mike,

I did a little bit of digging regarding this, as I'd never thought about doing this via command line.  I stumbled across this link:

Populating VMware Intelligent Policy Query

http://engineering.skybettingandgaming.com/2016/06/24/scripting-veritas-netbackup/

If you scroll down to the section titled "Populating VMware Intelligent Policy Query", you can see they used the bpplinclude command to add VM's to a VMware policy like this:

bpplinclude ${policy} -add vmware:/?filter=(Displayname Contains "nms0" OR Displayname Contains "nmsdb0") AND NOT Powerstate Equal poweredOff AND NOT Displayname Contains "stg" AND NOT Displayname Contains "tst"

I had a look at the options for bpplinclude, and as it also has the "-delete" option I'm wondering if this might work?  I haven't got time to try it at the moment to see if it does, and I don't have a need to do this via command line - but interested if it does work.

Steve

Mike_Gavrilov
Moderator
Moderator
Partner    VIP    Accredited Certified

Oh. you'd like to go that deep. Ok. You can modify query via CLI https://www.veritas.com/support/en_US/article.v85982076_v118238945 and add exception but it's quite hard to write it just from scratch. It might be extremely long and complicated. If you just want to remove one client it's better to do it via GUI if you're going to script something you can run jnbSA, exclude unwanted client from the Query and  check jnbSA's log to see how NetBackup translated you query into command.

Systems_Team
Moderator
Moderator
   VIP   

Thanks Mike Smiley Happy

I don't have a need for this (I do all mine with VIP's in the GUI), but I think we've proved to the original poster that there are ways to do this - just not sure if he'll be back based on his last post Smiley Wink

Steve

Thank you both for the kind and respectful responses. That is exactly what I was looking for...A) is it possible and B) if it is how can it be accomplished.

Systems_Team
Moderator
Moderator
   VIP   

Hi Backup-botw,

No problems.  Don't forget (C) - if you try it and it works, pop back and let us know for future refernce Smiley Wink

Steve

X2
Moderator
Moderator
   VIP   

Old thread but just for the record, for those looking to exclude some VMs from a VIP - easier way is to make the VIP better to accomodate exceptions.

@Marianne- your reply was on the same lines that I was thinking.

Both above solutions are in-elegent in my view. A better one: add the following to your query -

AND NOT Annotation Contains "BACKUP_DISABLED"

This will not include any VM from vSphere which have the string "BACKUP_DISABLED" in their Notes section. How you want to add/remove the string in the Notes section in vSphere depends on you: manual edit, PowerShell, API call, etc.

I use this in my environment. I also have a powershell script sending me a daily list of VMs not backed up via a VIP.