Question

Automate Commvault agent installation and Configuration

  • 6 December 2022
  • 12 replies
  • 2176 views

Userlevel 3
Badge +11

We are looking to automate Commvault IDA agents Installation and client settings configuration such as encryption, dedupe , storage policy , filters , schedules , database subclient settings such as oracle home, path etc. .

Does anyone has custom workflows deployed for agent installation and client configuration ? if yes please share .

Also , what is recommended way of achieving this ?

Is it possible to achieve 100% configuration for client through RestAPI ? 


12 replies

Userlevel 5
Badge +16

I don’t know if there is a recommended way to do the is to use a combination of a custom installer xml and configuration group. 

 

For example:

You can have a group that does default SQL setting, and group that does applies a subclient policy and have multiple customized installers that will add the appropriate group. 

You can probably simplify this with plans. 

I do not suggest using workflows to do with unless there are extenuating circumstances that require it.

This installer approach requires strategic deployment of software caches, and I don’t bother with doing customized packages as that in itself can before a full time job.

Rather I create multiple answer files and utilizing calling the installer with reference to an appropriate xml answer file. 

 

This is really a broad topic.

Userlevel 3
Badge +11

 

Using InstallClient API with JSON https://documentation.commvault.com/2022e/assets/features/rest_api/json/install_client_template.json for Linux client installation 

API call is successful but only file system core agent is installed . Do we have separate JSONs for Linux and Windows Client installation ? 

Has anyone tried successful Linux agent installation using InstallClient API . If yes , please share working JSON. 

 

API Call : {{ServerUrl}}/InstallClient

 

Body which iam using  :

{

    "rebootClient": false,

    "createPseudoClientRequest": {

        "registerClient": true,

        "clientInfo": {

            "clientType": 1,

            "plan": {

                "planId": 1

            },

            "subclientInfo": {

                "fsSubClientProp": {

                    "useGlobalFilters": "ON",

                    "backupSystemState": true

                },

                "useLocalContent": true,

                "contentOperationType": 1,

                "content": [

                ]

            }

        }

    },

    "packages": [

        {

            "packageId": 1101,

            "packageName": "UNIX File System"

        }

    ],

    "clientAuthForJob": {

        "userName": "XXXXXX",

        "password": "XXXXXXXXXXX"

    },

    "entities": [

        {

            "clientId": 0,

            "clientName": "Test",

            "hostName": "Test"

        }

    ]

}

Userlevel 2
Badge +10

What you actually need is documentation of the parameters on the install elements.

 

I would bet dollars to pesos that this json is indentical in content to install.xml that is used for automated installs and that consequently the same parameters would work. 
 

I will double check that.
 

 

Userlevel 4
Badge +10

I think the parameters and how to install difference client types is covered off in here?

https://documentation.commvault.com/v11/expert/130184_rest_api_post_install_client_associations.html

Almost everything else you have mentioned how to achieve would be covered by the use of plans. They will create a subclient policy which can set encryption and various other settings. I would try keeping it simple first using plans and see if you need to do anything more glamorous via the workflows after you have looked at that.

Badge +2

I agree with @christopherlecky ‘s statement about installer files, and yes it can be time-consuming. I have limited API experience, look at the link below for a starter. First  get your CVLT environment working so you can easily associate a plan to your clients, with all the settings there. Then tweak the installer packages to get you closer to your goal. API’s might be a way, I’ve done this process below. 

Look in Docs online on how to build a custom client install. You’ll have the option to automate and customize your install, including assigning Plans. This will give you an install.xml file you can start learning from. I am still using Storage Policies (pre-”Plans” config), so I can’t provide a direct example. 


Once you have your first install.xml file, you can customize it, and assign some tweaks. From there, you can create one install package that has all your needed IDA’s (AD, SQL, Windows FS, etc) and create install.xml files that for individual installs (just SQL server, just AD, etc). The process is same for *nix agent installs, just uses tar files and shell scripts. 
Take a look at my entry here, at the bottom, and I’ve shared what I learned. There is some digging in the API Sandbox, as you’ll probably need to get your individual Plan identifiers to insert into the xml file. I figured this out from examining the xml file and docs. 
 

Once you figure that out you’d run the installer with **something like** setup.exe /silent /wait /install /play custom-install.xml (the syntax is from memory, so I might be wrong). 

You could also run a post-install script that executes qcommands, logs on to the commserve and sets some desired things. Another rabbit hole to venture into. 
As we’ve said this is a time-consuming detail. Balance how often you’ll configure clients vs. how much automation is truly worthwhile for your environment. Best wishes!

Userlevel 7
Badge +19

I would recommend looking into a procedure which is based on a single installation who install the base-agent on the system. You can very easily create the base agent using: https://cloud.commvault.com/commandcenter/#/customPackage

Before deploying the package I would recommend to look into server plan rules. These allow dynamic assignment of plans to clients. Next step is to enable application discovery which can be set on CommCell level or on a specific server group level see → https://documentation.commvault.com/2022e/essential/114928_automatic_discovery_of_applications.html

Now there are stil a few things which I hope are going to be fixed by Commvault which is the actual configuration and for example assignment of credentials for AD, SQL and other client agents who require some form or a service account to work correctly. These can be set via a script through the API as well. 

Userlevel 3
Badge +10

I keep getting mixed messages about using plans from different people.

Is plans only supposed to serve as an off the shelf solution for low skill staff, or is it expected to replace the existing para-dig-m of schedule policies and subclient policies?

Userlevel 3
Badge +10

 

Using InstallClient API with JSON https://documentation.commvault.com/2022e/assets/features/rest_api/json/install_client_template.json for Linux client installation 

API call is successful but only file system core agent is installed . Do we have separate JSONs for Linux and Windows Client installation ? 

Has anyone tried successful Linux agent installation using InstallClient API . If yes , please share working JSON. 

 

API Call : {{ServerUrl}}/InstallClient

 

Body which iam using  :

{

    "rebootClient": false,

    "createPseudoClientRequest": {

        "registerClient": true,

        "clientInfo": {

            "clientType": 1,

            "plan": {

                "planId": 1

            },

            "subclientInfo": {

                "fsSubClientProp": {

                    "useGlobalFilters": "ON",

                    "backupSystemState": true

                },

                "useLocalContent": true,

                "contentOperationType": 1,

                "content": [

                ]

            }

        }

    },

    "packages": [

        {

            "packageId": 1101,

            "packageName": "UNIX File System"

        }

    ],

    "clientAuthForJob": {

        "userName": "XXXXXX",

        "password": "XXXXXXXXXXX"

    },

    "entities": [

        {

            "clientId": 0,

            "clientName": "Test",

            "hostName": "Test"

        }

    ]

}

 

I don’t 

I think the parameters and how to install difference client types is covered off in here?

https://documentation.commvault.com/v11/expert/130184_rest_api_post_install_client_associations.html

Almost everything else you have mentioned how to achieve would be covered by the use of plans. They will create a subclient policy which can set encryption and various other settings. I would try keeping it simple first using plans and see if you need to do anything more glamorous via the workflows after you have looked at that.

I think the link you posted is either incomplete or mislabelled, for example clients like DB2 have mandatory options that have to be set at install time.

This template doesn’t include, those agent options or any of the oracle agent options.

Don’t get me wrong, I believe this link shows a subset of the json needed for an install, but its clearly incomplete.

Since the OP is complaining about installs failing that is almost certainly the issue, as I noted earlier quite a few of the rest apis appear to use the the same xml/json payload as the old qoperation method.

Meaning he could just do an install/save as script. Take the XML generated and convert it to json, then do a rest api qoperation post, I said I would take a look but never got around to it.

Userlevel 7
Badge +23

 

Meaning he could just do an install/save as script. Take the XML generated and convert it to json, then do a rest api qoperation post, I said I would take a look but never got around to it.

Completely true - often the ‘save as script’ output is all that you need - put that in a qoperation and away you go. I don’t do a lot of automation but when I do I use this method often. Its quite easy to decipher the XML and make a template from it.

Userlevel 7
Badge +19

I keep getting mixed messages about using plans from different people.

Is plans only supposed to serve as an off the shelf solution for low skill staff, or is it expected to replace the existing para-dig-m of schedule policies and subclient policies?

I would encourage you to look into it and give it a try, because especially as of FR26 they implemented a lot of additional customization capabilities to address the desire from customer to have more control. There are also options currently available who cannot be used when using separate schedule policies and storage policies. I really hope they will make steps soon to focus on one implementation and migrate all customers to plans as this should decrease the chance of hitting bugs. because right now they have to maintain both methods. 

Userlevel 5
Badge +16

I keep getting mixed messages about using plans from different people.

Is plans only supposed to serve as an off the shelf solution for low skill staff, or is it expected to replace the existing para-dig-m of schedule policies and subclient policies?

I would encourage you to look into it and give it a try, because especially as of FR26 they implemented a lot of additional customization capabilities to address the desire from customer to have more control. There are also options currently available who cannot be used when using separate schedule policies and storage policies. I really hope they will make steps soon to focus on one implementation and migrate all customers to plans as this should decrease the chance of hitting bugs. because right now they have to maintain both methods. 

I agree completely, I love the idea of plans but up until recently there has been a lack of parity between plans and the alternative, but with the command center implementation and Java becoming increasingly divergent there needs to be some kind of stated goal of what customers should be using. 

 

I do understand the constraints because some large customers have built huge custom solutions around the original configuration but the past is starting to impinge on the present.

Userlevel 7
Badge +19

Indeed! I must admit than I still have a whish list when it comes to plans and also Command Center from a usability point of view. But as we all know things take time and requires input from us through CMRs and conversation here on the community. We ourselves moved a lot of existing customers to plans already and every new customer is onboarded with plans. Yes, we had to make some tickets to address some issues and a lot of what was missing was added. 

To give some insights and what I'm missing:

  • Full randomization when you configure the plan to schedule the job based on hours e.g. true RPO based scheduling.
  • More AM/ML smartness to increase/decrease load on the client in case app level backup is used by reducing readers and/or CPU affinity as it monitor the effect of the backup on the CPU and IO performance. E.g. it automatically measures both without running a job and while running a job and starts to make sure it adopts. If it can't adjust it gives back an alert/flag within Command Center so the user/admin can adjust the compute offering or look into making adjustments
  • In case you have multiple agents running on a systems it should not start the backup of all of them at the same time. This kills the performance of the system

Apart from that with FR28 and the latest maintenance release in place it's running pretty smooth. 

Reply