Skip to content

After successful device.task_start, we get an exception. #4

@ictabc

Description

@ictabc

Same code as issue with the timeout addition #3

Code

get data from old BIG-IQ

data = get_realtime_bigiq_data_partition(device, url)

Itterate through data and replace the IP for target value "address" to the new BIG-IP IP address.

for data_element in data:
data_element.properties["body"]["target"]["address"] = big_ip_new

# Print debug output for visual inspection
print(json.dumps(data_element.properties["body"], indent=4))

# Open connection to new BIG-IQ
device_az2, token_bigiq_az2, token_creation_az2 = connect_to_big_iq(bigiq_device_az2,username,password,login_provider, timeout)

# Start a task, with the AS3 data 
task = device_az2.task_start("/mgmt/shared/appsvcs/declare",json.dumps(data_element.properties["body"]))

# Check if task is finished
device_az2.task_wait(task)

# If task completed print task info
if device_az2.task_completed(task):
        print("Task "+ bigiq_partition + " completed.")

We are getting an exception on a successful POST/task_start:

Traceback (most recent call last):
File "//migrate-f5-scripts/big-iq-migrate.py", line 279, in
main()
File "//migrate-f5-scripts/big-iq-migrate.py", line 271, in main
process_bigiq_config(args.test, args.savedata,args.big_iq_partition,args.bigiq_address,args.bigiq_user,args.bigiq_password,args.action)
File "//migrate-f5-scripts/big-iq-migrate.py", line 151, in process_bigiq_config
task = device_az2.task_start("/mgmt/shared/appsvcs/declare",json.dumps(data_element.properties["body"]))
File "//migrate-f5-scripts/py39/lib64/python3.9/site-packages/bigrest/bigiq.py", line 58, in task_start
raise RESTAPIError(response, self.debug)
bigrest.common.exceptions.RESTAPIError:
Status:
200
Response Body:
{
"results": [
{
"message": "success",
"dryRun": false,
"host": "localhost",
"tenant": "TENANT",
"runTime": 15646,
"code": 200
}
],
"declaration": {
"VIP-NAME": {
"class": "Tenant",
"remark": "Managed by Self-Service",
"testapp-az2": {
"class": "Application",
"template": "generic",
"schemaOverlay": "default",
"pool-testapp-80": {
"class": "Pool",
"label": "Managed by Self-Service",
"remark": "Managed by Self-Service",
"members": [
{
"label": "Managed by Self-Service",
"ratio": 1,
"remark": "Managed by Self-Service",
"servers": [
{
"name": "test1",
"address": ""
}
],
"servicePort": 80
}
],
"monitors": [
{
"use": "/TENANT/testapp-az2/monitor-testapp-80"
}
],
"minimumMonitors": "all",
"loadBalancingMode": "round-robin"
},
"sa-": {
"class": "Service_Address",
"label": "Managed by Self-Service",
"remark": "Managed by Self-Service",
"icmpEcho": "enable",
"arpEnabled": true,
"trafficGroup": "/Common/tg-az2-1",
"virtualAddress": "",
"routeAdvertisement": "selective"
},
"monitor-testapp-80": {
"class": "Monitor",
"label": "Managed by Self-Service",
"remark": "Managed by Self-Service",
"monitorType": "tcp"
},
"clientssl-testapp-443": {
"class": "TLS_Server",
"label": "Managed by Self-Service",
"remark": "Managed by Self-Service",
"cipherGroup": {
"bigip": "/Common/ciphergroup-Approved"
},
"certificates": [
{
"certificate": "/TENANT/testapp-az2/cert_localhost.localdomain"
}
],
"namingScheme": "certificate",
"tls1_0Enabled": false,
"tls1_1Enabled": false,
"tls1_2Enabled": true,
"tls1_3Enabled": true,
"renegotiationEnabled": false
},
"snatpool-": {
"class": "SNAT_Pool",
"label": "Managed by Self-Service",
"remark": "Managed by Self-Service",
"snatAddresses": [
""
]
},
"cert_localhost.localdomain": {
"class": "Certificate",
"label": "Managed by Self-Service",
"remark": "Managed by Self-Service",
"chainCA": {
"bigip": "/Common/ca-bundle.crt"
},
"privateKey": {
"bigip": "/Common/localhost.localdomain"
},
"certificate": {
"bigip": "/Common/localhost.localdomain"
}
},
"vs-testapp-443-": {
"pool": {
"use": "/TENANT/testapp-az2/pool-testapp-80"
},
"snat": {
"use": "/TENANT/testapp-az2/snatpool-"
},
"class": "Service_TCP",
"label": "Managed by Self-Service",
"enable": true,
"iRules": [],
"remark": "Managed by Self-Service",
"serverTLS": "/TENANT/testapp-az2/clientssl-testapp-443",
"virtualPort": 443,
"policyEndpoint": [],
"virtualAddresses": [
{
"use": "/TENANT/testapp-az2/sa-"
}
],
"persistenceMethods": [
{
"bigip": "/Common/ssl_session"
}
]
}
}
},
"id": "autogen_8a6be3f1-2091-4c6e-ba28-2c424ae4b6a6",
"class": "ADC",
"target": {
"address": ""
},
"controls": {
"class": "Controls",
"userAgent": "BIG-IQ/8.2 Configured by API",
"archiveTimestamp": "2024-03-18T09:35:00.624Z"
},
"updateMode": "selective",
"schemaVersion": "3.36.0"
}
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions