I have a question and or rather willing to have a discussion and sharing information about how we can minimize our efforts of clicking. Possibly share scripts that we have developed and help each other out on daily tasks. We all know that Java GUI has a lot of ways to do the same and it also involves a lot of clicking.
For example, I was able to find and adapt qscripts, qoperations and API for quite a few good daily ops in my scripts, automation:
Get clients associated to specific Client Group;
Get Client Group to which specific server belongs;
Add / Remove client from specific Client Group
Start / Stop media agents maintenance mode
DIP’s operations (enable/disable/remove/add)
Commcell activity (Enable/Disable)
Finding duplicate clients between our commcells
And sure, all of it depends on the level of competence in automating, but Commvault being ‘old dinosaur’ can still be automated a bit.
Now, for example I cannot find a way to write a script which switches preffered media agent from one to another in Storage Policy. Maybe someone has already done that? :)
Page 1 / 1
https://api.commvault.com/ this is the post man interface and rest Api documentation to interface with commvault using this you should be able to automate commvault using restapi.
https://api.commvault.com/ this is the post man interface and rest Api documentation to interface with commvault using this you should be able to automate commvault using restapi.
I do know this API page - and I am using it :)
This reminds me of another great thread:
Great place to share tricks and tips!
Hi folks,
I have a question and or rather willing to have a discussion and sharing information about how we can minimize our efforts of clicking. Possibly share scripts that we have developed and help each other out on daily tasks. We all know that Java GUI has a lot of ways to do the same and it also involves a lot of clicking.
For example, I was able to find and adapt qscripts, qoperations and API for quite a few good daily ops in my scripts, automation:
Get clients associated to specific Client Group;
Get Client Group to which specific server belongs;
Add / Remove client from specific Client Group
Start / Stop media agents maintenance mode
DIP’s operations (enable/disable/remove/add)
Commcell activity (Enable/Disable)
Finding duplicate clients between our commcells
And sure, all of it depends on the level of competence in automating, but Commvault being ‘old dinosaur’ can still be automated a bit.
Now, for example I cannot find a way to write a script which switches preffered media agent from one to another in Storage Policy. Maybe someone has already done that? :)
Great topic… Use Command Center and entity search bar… as an example:
“Disable commcell activity” requires 5 keystrokes and 1 click:
type “comm” in the entity search bar > tab
Click “activity control”
Get Client Group to which specific server belongs 4ish keystrokes and 1 click
type partial machine name until the hit shows > click hit
All server groups the machine is listed under is displayed
Your #7 is an interesting one. For the same clients to be in multiple commcells, you are looking for multi-instanced machines?
Hi folks,
I have a question and or rather willing to have a discussion and sharing information about how we can minimize our efforts of clicking. Possibly share scripts that we have developed and help each other out on daily tasks. We all know that Java GUI has a lot of ways to do the same and it also involves a lot of clicking.
For example, I was able to find and adapt qscripts, qoperations and API for quite a few good daily ops in my scripts, automation:
Get clients associated to specific Client Group;
Get Client Group to which specific server belongs;
Add / Remove client from specific Client Group
Start / Stop media agents maintenance mode
DIP’s operations (enable/disable/remove/add)
Commcell activity (Enable/Disable)
Finding duplicate clients between our commcells
And sure, all of it depends on the level of competence in automating, but Commvault being ‘old dinosaur’ can still be automated a bit.
Now, for example I cannot find a way to write a script which switches preffered media agent from one to another in Storage Policy. Maybe someone has already done that? :)
Great topic… Use Command Center and entity search bar… as an example:
“Disable commcell activity” requires 5 keystrokes and 1 click:
type “comm” in the entity search bar > tab
Click “activity control”
Get Client Group to which specific server belongs 4ish keystrokes and 1 click
type partial machine name until the hit shows > click hit
All server groups the machine is listed under is displayed
Your #7 is an interesting one. For the same clients to be in multiple commcells, you are looking for multi-instanced machines?
Since we have multiple commcells, one for agent based clients, one for vcenter snapshots. When you have ~15K servers to manage, you are bound to have cases where the same client will be backed up in both commcells…
Also - we are not yet using command center, kind of prefer Java GUI.
Hi folks,
I have a question and or rather willing to have a discussion and sharing information about how we can minimize our efforts of clicking. Possibly share scripts that we have developed and help each other out on daily tasks. We all know that Java GUI has a lot of ways to do the same and it also involves a lot of clicking.
For example, I was able to find and adapt qscripts, qoperations and API for quite a few good daily ops in my scripts, automation:
Get clients associated to specific Client Group;
Get Client Group to which specific server belongs;
Add / Remove client from specific Client Group
Start / Stop media agents maintenance mode
DIP’s operations (enable/disable/remove/add)
Commcell activity (Enable/Disable)
Finding duplicate clients between our commcells
And sure, all of it depends on the level of competence in automating, but Commvault being ‘old dinosaur’ can still be automated a bit.
Now, for example I cannot find a way to write a script which switches preffered media agent from one to another in Storage Policy. Maybe someone has already done that? :)
Great topic… Use Command Center and entity search bar… as an example:
“Disable commcell activity” requires 5 keystrokes and 1 click:
type “comm” in the entity search bar > tab
Click “activity control”
Get Client Group to which specific server belongs 4ish keystrokes and 1 click
type partial machine name until the hit shows > click hit
All server groups the machine is listed under is displayed
Your #7 is an interesting one. For the same clients to be in multiple commcells, you are looking for multi-instanced machines?
Since we have multiple commcells, one for agent based clients, one for vcenter snapshots. When you have ~15K servers to manage, you are bound to have cases where the same client will be backed up in both commcells…
Also - we are not yet using command center, kind of prefer Java GUI.
I assume there are reasons this is stretched across commcells. I’m not sure we can unpack that on the forums, but my guess is we would need to see where VM backup VS physical agent backup is being done across different CCIDs. Interesting scenario, let me think about this.
Here are some possible solutions for your mentioned topics:
1. Get clients associated to specific Client Group; https://documentation.commvault.com/commvault/v11/article?p=45844.htm 2. Get Client Group to which specific server belongs; https://documentation.commvault.com/commvault/v11/article?p=45898.htm 3. Add / Remove client from specific Client Group https://documentation.commvault.com/commvault/v11/article?p=45864.htm 4. Start / Stop media agents maintenance mode Don't know if this is documented but it's a
Set commCellName to the client name of your Commserve (the name of the top level node in the Commcell Browser) enableActivityType would be 0 to disable, 1 to enable activityType would be one of: BACKUP=1, RESTORE=2, AUXCOP=4, DRBACKUP=8, ARCHIVEPRUNE=16, MEDIARECYCLE=32, SYNTHETICFULL=64, ALLACTIVITY=128, SCHEDULE=256, ONLINECI=512, OFFLINECI=1024, DDBACTIVITY=2048, DATAVERIFICATION=8192
7. Finding duplicate clients between our commcells
That's probably easiest to do with a metrics report that just looks for same client or net_hostname across the App_client tables of your attached Commcells - there is no API that goes across multiple Commcells
"Now, for example I cannot find a way to write a script which switches preffered media agent from one to another in Storage Policy"
Happy to help you with any automation questions :)
Maybe I have not been fully clear :)
When we do have patching - we patch odd/even media agents so we could stay operational - but this introduces us to the point where we have to go to ~8 Storage Policies and change from one media agent to other one to be preferable AND also to remove round robin and set it to ‘use preffered’.
Is this XML capable of doing it for multiple storage policies?
Hi Benjis,
the XML alone only does it for a single storage policy - I would just integrate this into some programmatic course of actions that a) determines the relevant storage policy copies b) runs a loop to switch them all.
A simple workflow with a ForEach Loop could do that.With a Commserve DB Query to determine all Storage Policy Copies having a default data path of “Media Agent 1” to switch them to “Media Agent 2” and then back again when run the next time.
A query like this (probably still al little rough around the edges but a good start) could give you all Storage Policies and their default Media Agent:
SELECT SP.name as StoragePolicy, SP.id as StoragePolicyID, SPC.name as StoragePolicyCopy, SPC.id as StoragePolicyCopyID, C.name as MAForDefaultDataPath from archGroup SP WITH(NOLOCK) INNER JOIN archGroupCopy SPC WITH(NOLOCK) on SPC.archGroupId = SP.id INNER JOIN MMDataPath DP WITH(NOLOCK) on DP.CopyId = SPC.archGroupId INNER JOIN App_Client C WITH(NOLOCK) on DP.HostClientId = C.id WHERE SP.id > 1 -- Do not show "CV_DEFAULT" Storage Policy (no SP assigned dummy object) AND SP.type = 1 -- Do not show DR Storage Policies AND (SP.flags & 8388608) = 0 -- Do not show Global Storage Policies AND DP.flag & 1 > 0 -- Default Data Path
So you could then just use a Media Agent name (or ID) as Input Parameter for the Workflow and just switch all of the determined storage policies in a loop.