Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to set clientInfo logFilesLocation and clientGroupName? #106

Closed
aka17034 opened this issue Aug 27, 2020 · 9 comments
Closed

How to set clientInfo logFilesLocation and clientGroupName? #106

aka17034 opened this issue Aug 27, 2020 · 9 comments

Comments

@aka17034
Copy link

Hello. Regarding "clientInfo" in install.py:

"clientInfo": {
"client": {
"evmgrcPort": 0,
"cvdPort": 0
}
}

Is it possible to customize the following during install?

  • logFilesLocation
  • clientGroupName

When using XML response file for customization, these appear to be nested under clientInfo:

                <clientInfo>
                  <client>
                    <jobResulsDir>
                      <path></path>
                    </jobResulsDir>
                    <cvdPort>0</cvdPort>
                  </client>
                  <clientProps>
                    <logFilesLocation>/opt/commvault</logFilesLocation>
                  </clientProps>
                  <clientGroups>
                    <clientGroupName>AIX Servers</clientGroupName>
                  </clientGroups>
                </clientInfo>

Thanks.

@aka17034
Copy link
Author

Hello.
So far, I've been able to set logFilesLocation during install, by defining "log_file_location" in commcell.py and install.py, then using it in "clientProps" in install.py. Stiil no luck setting clientGroupName, however.

@Sachu23
Copy link

Sachu23 commented Sep 1, 2020

Hi G Dale,
Its good hear that the logFilesLocation worked but for the clientgroups you have to make sure there is a existing client group on the Commserve/ Comcell Console or you would have to create one. You can use the json format is this manner on install.py at https://github.com/Commvault/cvpysdk/blob/master/cvpysdk/deployment/install.py#L359 :
"clientInfo": {
"client": {
"evmgrcPort": 0,
"cvdPort": 0,
"installDirectory": install_path if install_path else ""
},
"clientGroups": {
"clientGroupName": client_group_name"
},
"clientProps": {
"logFilesLocation": log_file_loc

                                                }

}

Thanks,
Sachin S

@Sachu23
Copy link

Sachu23 commented Sep 1, 2020

Hi G Dale,
The local changes made will be overridden during updates, this needs changes in our library code we shall add support for this in the coming service pack.

Thanks,
Sachin S

@aka17034
Copy link
Author

aka17034 commented Sep 1, 2020

Hi, Sachin S. Thanks for the update.

I've tried the following code in install.py, and the "installDirectory" and "logFilesLocation" work OK.

However, the "clientGroups" seems to create an error:

                                                "clientInfo": {
                                                    "client": {
                                                        "evmgrcPort": 0,
                                                        "cvdPort": 0,
                                                        "installDirectory": "/opt/commvault"
                                                    },
                                                    "clientGroups": {
                                                       "clientGroupName": "AIX Servers"
                                                    },
                                                    "clientProps": {
                                                        "logFilesLocation": "/opt/commvault"
                                                    }
                                                }

As I'm calling this from Ansible, here is a sample of the error message:

The full traceback is:
Traceback (most recent call last):
  File "/home/k17034/.ansible/tmp/ansible-tmp-1598987947.5553548-172342813852709/AnsiballZ_commvault.py", line 102, in <module>
    _ansiballz_main()
  File "/home/k17034/.ansible/tmp/ansible-tmp-1598987947.5553548-172342813852709/AnsiballZ_commvault.py", line 94, in _ansiballz_main
    invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)
  File "/home/k17034/.ansible/tmp/ansible-tmp-1598987947.5553548-172342813852709/AnsiballZ_commvault.py", line 40, in invoke_module
    runpy.run_module(mod_name='ansible.modules.commvault', init_globals=None, run_name='__main__', alter_sys=True)
  File "/usr/lib64/python3.6/runpy.py", line 205, in run_module
    return _run_module_code(code, init_globals, run_name, mod_spec)
  File "/usr/lib64/python3.6/runpy.py", line 96, in _run_module_code
    mod_name, mod_spec, pkg_name, script_name)
  File "/usr/lib64/python3.6/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/tmp/ansible_commvault_payload_x4cqxhn4/ansible_commvault_payload.zip/ansible/modules/commvault.py", line 345, in <module>
  File "/tmp/ansible_commvault_payload_x4cqxhn4/ansible_commvault_payload.zip/ansible/modules/commvault.py", line 332, in main
  File "<string>", line 1, in <module>
  File "/usr/local/lib/python3.6/site-packages/cvpysdk/commcell.py", line 2020, in install_software
    password=password)
  File "/usr/local/lib/python3.6/site-packages/cvpysdk/deployment/install.py", line 405, in install_software
    raise SDKException('Response', '101')
cvpysdk.exception.SDKException: Response was not success

fatal: [localhost]: FAILED! => {
    "changed": false,
    "module_stderr": "Traceback (most recent call last):\n  File \"/home/k17034/.ansible/tmp/ansible-tmp-1598987947.5553548-172342813852709/AnsiballZ_commvault.py\", line 102, in <module>\n    _ansiballz_main()\n  File \"/home/k17034/.ansible/tmp/ansible-tmp-1598987947.5553548-172342813852709/AnsiballZ_commvault.py\", line 94, in _ansiballz_main\n    invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)\n  File \"/home/k17034/.ansible/tmp/ansible-tmp-1598987947.5553548-172342813852709/AnsiballZ_commvault.py\", line 40, in invoke_module\n    runpy.run_module(mod_name='ansible.modules.commvault', init_globals=None, run_name='__main__', alter_sys=True)\n  File \"/usr/lib64/python3.6/runpy.py\", line 205, in run_module\n    return _run_module_code(code, init_globals, run_name, mod_spec)\n  File \"/usr/lib64/python3.6/runpy.py\", line 96, in _run_module_code\n    mod_name, mod_spec, pkg_name, script_name)\n  File \"/usr/lib64/python3.6/runpy.py\", line 85, in _run_code\n    exec(code, run_globals)\n  File \"/tmp/ansible_commvault_payload_x4cqxhn4/ansible_commvault_payload.zip/ansible/modules/commvault.py\", line 345, in <module>\n  File \"/tmp/ansible_commvault_payload_x4cqxhn4/ansible_commvault_payload.zip/ansible/modules/commvault.py\", line 332, in main\n  File \"<string>\", line 1, in <module>\n  File \"/usr/local/lib/python3.6/site-packages/cvpysdk/commcell.py\", line 2020, in install_software\n    password=password)\n  File \"/usr/local/lib/python3.6/site-packages/cvpysdk/deployment/install.py\", line 405, in install_software\n    raise SDKException('Response', '101')\ncvpysdk.exception.SDKException: Response was not success\n",
    "module_stdout": "",
    "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error",
    "rc": 1
}

Interestingly, if I change the spelling of clientGroups, I no longer receive an error message.

Example:

                                                "clientInfo": {
                                                    "client": {
                                                        "evmgrcPort": 0,
                                                        "cvdPort": 0,
                                                        "installDirectory": "/opt/commvault"
                                                    },
                                                    "XlientGroups": {
                                                       "clientGroupName": "AIX Servers"
                                                    },
                                                    "clientProps": {
                                                        "logFilesLocation": "/opt/commvault"
                                                    }
                                                }

Simply by changing the spelling, the install runs, although "XlientGroups" appears to be ignored, as I do not see that in the Job logs in CommVault.

Let me know if any suggestions for additional debugging.

Thanks.

@Sachu23
Copy link

Sachu23 commented Sep 4, 2020

Hi G Dale,
Sorry for the delayed response. ITs good to know the log location works fine. Here is are the changes on the JSON which you could use. The client can be added to multiple groups by appending the following list.

"clientInfo": {
"clientGroups": [
{
"clientGroupName": "example"
}
],
"client": {
"evmgrcPort": 0,
"cvdPort": 0,
"installDirectory": install_path if install_path else ""
}
}
Thanks,
Sachin S

@aka17034 aka17034 closed this as completed Sep 8, 2020
@aka17034
Copy link
Author

aka17034 commented Sep 8, 2020

Hi, Sachin S. That change for client group worked for me. Thank you. This issue is now resolved for me.

@aka17034 aka17034 reopened this Sep 9, 2020
@aka17034
Copy link
Author

aka17034 commented Sep 9, 2020

Should I submit PR for these changes against dev branch? I have only tested these changes with current master branch. Thanks.

@Sachu23
Copy link

Sachu23 commented Sep 14, 2020

Hi G Dale,
You can please proceed with submitting a PR. We will review it right after you have submitted.

Thanks,
Sachin S

@spakhare
Copy link
Member

spakhare commented Nov 2, 2020

Requested changes are included in the latest development branch by the Commvault development team. Closing this issue.

@spakhare spakhare closed this as completed Nov 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants