Very grateful for clone script! Two observations (sorry can't update on Git right now) when using MDS
It calls this method with wrong arguments so it fails to log into CMA..
def handle_local_domain(client_domain, domain, username, password, orig_host_ip, cloned_host_name, cloned_host_ip😞
gets called as (thus passing server IP address as username and cloned IP is missing)
handle_local_domain(client_domain, domain, server, username, password, orig_host_ip, cloned_host_name)
Secondly API session with default 10min timer was not sufficient, so I had to add keepalive in CMA loop
for domain in domains.data:
log("\n\tChecking on Local Domain {}".format(domain["name"]))
handle_local_domain(client_domain, domain, username, password, orig_host_ip,
cloned_host_name, cloned_host_ip)
client.api_call("keepalive", {}, login_res.data["sid"])
I haven't had time to fix these yet as script seems to complete OK and correct updates are made
Traceback (most recent call last):
File "clone_host.py", line 794, in <module>
main(sys.argv[1:])
File "clone_host.py", line 787, in main
client_domain.save_debug_data()
File "/home/kasparsz/cp_mgmt_api_python_sdk-master/cp_mgmt_api_python_sdk-master/lib/mgmt_api.py", line 128, in save_debug_data
out_file.write(json.dumps(self.api_calls, indent=4, sort_keys=True))
File "/opt/CPsuite-R80/fw1/Python/lib/python2.7/json/__init__.py", line 251, in dumps
sort_keys=sort_keys, **kw).encode(obj)
File "/opt/CPsuite-R80/fw1/Python/lib/python2.7/json/encoder.py", line 209, in encode
chunks = list(chunks)
MemoryError