F5Networks / f5-appsvcs-templates

F5 BIG-IP Application Service Templates (FAST)
Apache License 2.0
32 stars 13 forks source link

Task response ambiguous when submitting multiple applications #126

Open simonkowallik opened 1 year ago

simonkowallik commented 1 year ago

Environment

Summary

A clear and concise description of what the bug is. Include information about the reproducibility and the severity/impact of the issue.

Steps To Reproduce

List the steps to reproduce the behavior:

  1. Create two applications

POST https://{{host}}/mgmt/shared/fast/applications

[
    {
        "name": "examples/simple_http",
        "parameters": {
            "tenant_name": "tenant1",
            "application_name": "appA",
            "virtual_port": 80,
            "virtual_address": "192.168.0.1",
            "server_port": 80,
            "server_addresses": [
                "192.168.1.1"
            ]
        }
    },
    {
        "name": "examples/simple_http",
        "parameters": {
            "tenant_name": "tenant1",
            "application_name": "appB",
            "virtual_port": 80,
            "virtual_address": "192.168.0.2",
            "server_port": 80,
            "server_addresses": [
                "192.168.1.2"
            ]
        }
    }
]
  1. Try creating 3 additional applications (two will have a conflict with the existing two applications created in Step 1)
[
    {
        "name": "examples/simple_http",
        "parameters": {
            "tenant_name": "tenant1",
            "application_name": "appC",
            "virtual_port": 80,
            "virtual_address": "192.168.0.1",
            "server_port": 80,
            "server_addresses": [
                "192.168.1.1"
            ]
        }
    },
    {
        "name": "examples/simple_http",
        "parameters": {
            "tenant_name": "tenant1",
            "application_name": "appD",
            "virtual_port": 80,
            "virtual_address": "192.168.0.99",
            "server_port": 80,
            "server_addresses": [
                "192.168.1.2"
            ]
        }
    },
    {
        "name": "examples/simple_http",
        "parameters": {
            "tenant_name": "tenant1",
            "application_name": "appE",
            "virtual_port": 80,
            "virtual_address": "192.168.0.2",
            "server_port": 80,
            "server_addresses": [
                "192.168.1.2"
            ]
        }
    }
]

Response:

{
    "code": 202,
    "requestId": 73,
    "message": [
        {
            "id": "7650566e-a079-498d-9403-95105d2a8da2",
            "name": "examples/simple_http",
            "parameters": {
                "tenant_name": "tenant1",
                "application_name": "appC",
                "virtual_port": 80,
                "virtual_address": "192.168.0.1",
                "server_port": 80,
                "server_addresses": [
                    "192.168.1.1"
                ]
            }
        },
        {
            "id": "7650566e-a079-498d-9403-95105d2a8da2",
            "name": "examples/simple_http",
            "parameters": {
                "tenant_name": "tenant1",
                "application_name": "appD",
                "virtual_port": 80,
                "virtual_address": "192.168.0.99",
                "server_port": 80,
                "server_addresses": [
                    "192.168.1.2"
                ]
            }
        },
        {
            "id": "7650566e-a079-498d-9403-95105d2a8da2",
            "name": "examples/simple_http",
            "parameters": {
                "tenant_name": "tenant1",
                "application_name": "appE",
                "virtual_port": 80,
                "virtual_address": "192.168.0.2",
                "server_port": 80,
                "server_addresses": [
                    "192.168.1.2"
                ]
            }
        }
    ],
    "_links": {
        "self": "/mgmt/shared/fast/applications",
        "task": "/mgmt/shared/fast/tasks/7650566e-a079-498d-9403-95105d2a8da2"
    }
}
  1. Fetch Task status
{
    "id": "7650566e-a079-498d-9403-95105d2a8da2",
    "code": 422,
    "message": "declaration failed\n01070333:3: Virtual Server /tenant1/appC/serviceMain illegally shares destination address, source address, service port, ip-protocol, and vlan with Virtual Server /tenant1/appA/serviceMain.",
    "name": "",
    "parameters": {},
    "tenant": "tenant1",
    "application": "appE",
    "operation": "create",
    "timestamp": "2023-03-23T15:24:18.455Z",
    "host": "localhost",
    "_links": {
        "self": "/mgmt/shared/fast/tasks/7650566e-a079-498d-9403-95105d2a8da2"
    }
}

While the general result is clear, it is unclear what happend to appD and appE.

Expected Behavior

Clear information about the status of all submitted applications.

Actual Behavior

shyawnkarim commented 1 year ago

Both appC and appE have the same virtual addresses and same virtual ports as both appA and AppB do respectively. Changing either the ip or port to something unique will deploy successfully.

simonkowallik commented 1 year ago

@shyawnkarim this error was intentional to demonstrate the actual problem. The API response provides a single task id, when fetching the status of this task id a single status is returned while multiple applications where submitted. In case of the above error it isn't clear whether the other two declarations where successful.

shyawnkarim commented 1 year ago

Thanks for the additional clarity. I understand your issue now and it is being tracked internally with ID, EC-193.

joelkeener commented 1 year ago

Aren't all applications are submitted within a single declaration? If so, I believe that nothing gets deployed because of the error. Isn't that what is happening here?

joelkeener commented 1 year ago

The batch option is going to stitch all of your applications together into one declaration, completing the bulk update/create more quickly.

If one fails, they all fail.

simonkowallik commented 1 year ago

@joelkeener Thanks for the clarification. This is not clear from the documentation nor from the API response. If the behaviour is expected then an update to the documentation would be a great solution. This helps an implementor, which might not be familiar with the internal details of AS3 and FAST, to understand and work with the response.

joelkeener commented 1 year ago

Good point; thank you for providing your valuable feedback, helping us improve our product.

joelkeener commented 1 year ago

Our documentation will be updated to explain this; it is being tracked internally with ID EC-202