How to: Restore application services to a new instance

Use this procedure to restore the application services from a BIG-IP Next instance that has become unusable to a new instance.

Prerequisites

  • IP address and log in credentials for the failed instance

  • Instance ID for the failed instance

  • Template for instantiating the new instance

Get the onboarding manifest for the failed instance

Use this procedure to get the onboarding manifest that BIG-IP Next Central Manager will use to onboard the failed instance.

  1. Authenticate with the BIG-IP Next Central Manager API. For details refer to How to: Authenticate with the BIG-IP Next Central Manager API.

  2. Get the instance_id of the failed instance by sending a Get to the /api/v1/spaces/default/instances?filter=address eq '<big-ip-next-mgmt-ip>' endpoint.

    The API response contains the instance_id. In the following sample response, the instance_id is: bf2ad52c-9ead-4fe1-9800-76d8d8ff49af.

    {
     "_embedded": {
         "devices": [
             {
                 "_links": {
                     "self": {
                         "href": "/api/v1/spaces/default/instances?filter=address%20eq%20%2710.146.165.62%27/bf2ad52c-9ead-4fe1-9800-76d8d8ff49af""
                     }
                 },
                 "address": "10.146.165.62",
                 "certificate_validated": "2023-09-26T19:38:47.94049Z",
                 "certificate_validation_error": "tls: failed to verify certificate: x509: cannot validate certificate for 10.146.165.62 because it doesn't contain any IP SANs",
                 "certificate_validity": false,
                 "hostname": "esxi2-01.f5.com",
                 "id": "**bf2ad52c-9ead-4fe1-9800-76d8d8ff49af**",
                 "mode": "STANDALONE",
                 "platform_type": "ve",
                 "port": 5443,
                 "version": "20.0.0-2.94.0+0.0.26"
             }
         ]
     },
     "_links": {
         "self": {
             "href": "/api/v1/spaces/default/instances?filter=address%20eq%20%2710.146.165.62%27"
         }
     },
     "count": 1,
     "total": 1
    }
    
  3. Get the manifest by sending a Get to the /api/v1/spaces/default/instances/{{instance_id}}/onboarding-manifest endpoint.

    POST https://<big-ip_next_cm_mgmt_ip>/api/v1/spaces/default/instances/{{instance_id}}/onboarding-manifest
    

    The API response contains the manifest for the failed instance and should look similar to the following example:

    {
     "_links": {
         "self": {
             "href": "/api/v1/spaces/default/instances/bf2ad52c-9ead-4fe1-9800-76d8d8ff49af/onboarding-manifest"
         }
     },
     "id": "159e3f66-9d74-4fed-8f30-ca10c1524655",
     "mode": "STANDALONE",
     "payload": {
         "mode": "STANDALONE",
         "nodes": [
             {
                 "hostname": "esxi-sa-1-3.f5.com",
                 "managementAddress": "10.146.164.67"
             }
         ],
         "siteInfo": {
             "dnsServers": [
                 "128.95.112.1"
             ],
             "ntpServers": [
                 "0.north-america.pool.ntp.org",
                 "1.north-america.pool.ntp.org"
             ]
         },
         "l1Networks": [
             {
                 "id": "24c388a1-a847-4dae-a4f6-2484eeee0184",
                 "name": "LocalTestVLAN-114",
                 "vlans": [
                     {
                         "id": "ab4ca517-2603-4e5e-8fe2-0b37b2104da7",
                         "name": "internal",
                         "selfIps": [
                             {
                                 "address": "10.30.123.10/16"
                             }
                         ]
                     }
                 ],
                 "l1Link": {
                     "name": "1.1",
                     "linkType": "Interface"
                 }
             },
             {
                 "id": "6651fe88-2ecb-4ef4-bfa0-95eb5fa5037e",
                 "name": "LocalTestVLAN-115",
                 "vlans": [
                     {
                         "id": "797b095c-4e92-4ac6-a372-cac3d8ab507e",
                         "name": "external",
                         "selfIps": [
                             {
                                 "address": "10.31.123.10/16"
                             }
                         ]
                     }
                 ],
                 "l1Link": {
                     "name": "1.2",
                     "linkType": "Interface"
                 }
             }
         ],
         "platformType": "VE"
     },
     "platform_type": "VE",
     "stage": "DEPLOYED"
    }
    

Determine whether the application services were deployed with AS3 and/or FAST templates

The steps for getting the application services that are deployed to the failed instance depend on whether the application service is an AS3 application or a FAST template application. There are two API calls used to determine how the application services on the failed instance were created.

To determine whether application services were deployed with AS3

Post an API call to the /api/v1/spaces/default/appsvcs/documents?expand=deployments&filter=deployments/target/instance_ip eq '<big-ip-next-mgmt-ip>' endpoint. If you get a list of application services, then the applications were created using AS3.

  1. Get the application service information by sending a Get to the /api/v1/spaces/default/appsvcs/documents?expand=deployments&filter=deployments/target/instance_ip eq '<big-ip-next-mgmt-ip>' endpoint.

    GET https://<big-ip_next_cm_mgmt_ip>/api/v1/spaces/default/appsvcs/documents?expand=deployments&filter=deployments/target/instance_ip eq '<big-ip-next-mgmt-ip>'
    

    If BIG-IP Next Central Manager returns a list of application services, then AS3 was used to create the application services on the failed instance.

To determine whether application services were created using FAST

Post an API call to the /api/v1/spaces/default/appsvcs/blueprints?expand=deployments&filter=deployments/target/address eq '<big-ip-next-mgmt-ip>' endpoint. If you get a list of application services, then the applications were created using AS3.

  1. Get the application service information by sending a Get to the /api/v1/spaces/default/appsvcs/blueprints?expand=deployments&filter=deployments/target/address eq '<big-ip-next-mgmt-ip>' endpoint.

    GET https://<big-ip_next_cm_mgmt_ip>/api/v1/spaces/default/appsvcs/blueprints?expand=deployments&filter=deployments/target/address eq '<big-ip-next-mgmt-ip>'
    

If BIG-IP Next Central Manager returns a list of application services, then a FAST template was used to create the application services on the failed instance.

Get the application services that are deployed to the failed instance

The steps for getting the application services that are deployed to the failed instance depend on whether the application service is an AS3 application or a FAST template application. Use the procedure that corresponds to the type of application services that were deployed to the failed instance. If both types of application services are deployed to the failed instance, perform both procedures.

Get the FAST template application services that are deployed to the failed instance

To get the application services that are deployed to the failed instance, you send a Get to the /api/v1/spaces/default/appsvcs/blueprints?expand=deployments&filter=deployments/target/address eq '<big-ip-next-mgmt-ip>' endpoint. Then you can find the deployment information from the API response by searching for the hostname and IP address of the failed instance.

  1. Get the application service information by sending a Get to the /api/v1/spaces/default/appsvcs/blueprints?expand=deployments&filter=deployments/target/address eq '<big-ip-next-mgmt-ip>' endpoint.

    GET https://<big-ip_next_cm_mgmt_ip>/api/v1/spaces/default/appsvcs/blueprints?expand=deployments&filter=deployments/target/address eq '<big-ip-next-mgmt-ip>'
    

    The reponse you get should look similar to the following example:

    {
                         "id": "09b5d990-47c5-4a2c-9c6f-b1a96d112872",
                         "instance_id": "a36939b3-6e8a-4dd5-a818-9642bb3af4e2",
                         "target": {
                             "address": "10.146.164.67"
                         },
                         "parameters": {
                             "pools": [
                                 {
                                     "poolMembers": [
                                         {
                                             "address": "10.20.1.1",
                                             "name": "n1"
                                         },
                                         {
                                             "address": "10.20.1.2",
                                             "name": "n2"
                                         }
                                     ],
                                     "poolName": "p-sa1"
                                 }
                             ],
                             "virtuals": [
                                 {
                                     "virtualAddress": "10.21.200.50",
                                     "virtualName": "vs-sa1"
                                 }
                             ]
                         },
                         "last_successful_deploy_time": "2023-09-14T19:34:03.833611Z",
                         "modified": "2023-09-14T19:34:03.833611Z",
                         "last_record": {
                             "id": "23cf7c95-ac4f-4694-ad4b-440733f893b2",
                             "task_id": "cc3eb72d-123a-4005-9065-8d553c8f6ae6",
                             "created_application_path": "/applications/tenantCU3PUHreQwGPbpfngpxYGA/app-http-sa1",
                             "start_time": "2023-09-14T19:33:50.265393Z",
                             "end_time": "2023-09-14T19:34:03.833611Z",
                             "status": "completed"
                         }
     }
    

Get the AS3 application services that are deployed to the failed instance

To get the application services that are deployed to the failed instance, you send a Get to the /api/v1/spaces/default/appsvcs/documents?expand=deployments&filter=deployments/target/instance_ip eq '<big-ip-next-mgmt-ip>' endpoint.

  1. Get the application service information by sending a Get to the /api/v1/spaces/default/appsvcs/documents?expand=deployments&filter=deployments/target/instance_ip eq '<big-ip-next-mgmt-ip>' endpoint.

GET http://{{big-ip_next_cm_mgmt_ip}}/api/v1/spaces/default/appsvcs/documents?expand=deployments&filter=deployments/target/instance_ip eq ‘

The reponse you get should look similar to the following example:

{
 "_embedded": {
     "appsvcs": [
         {
             "_links": {
                 "self": {
                     "href": "/api/v1/spaces/default/appsvcs/documents/0ed08eda-deb4-4d74-9b8c-c9443fc2cef4"
                 }
             },
             "created": "2023-09-22T16:04:21.417447Z",
             "deployments": [
                 {
                     "id": "3b9373af-9b6c-4f11-a9fa-9685cc960a08",
                     "instance_id": "43876108-d9bc-4faa-b98f-62d72623c72a",
                     "target": {
                         "instance_ip": "10.146.17.18"
                     },
                     "last_successful_deploy_time": "0001-01-01T00:00:00Z",
                     "modified": "2023-09-26T22:17:21.992291Z",
                     "last_record": {
                         "id": "c39fbadf-a42a-450c-b400-414b1f195436",
                         "task_id": "cc98aefd-6bc5-42e6-86ad-8b7c0d8bda47",
                         "start_time": "2023-09-26T22:17:21.963195Z",
                         "status": "failed",
                         "failure_reason": "AS3-0004: AS3 Unknown Error : Failed with unknown error: {\"_errors\":[{\"id\":\"211165d5-9321-4487-9a66-4e75b89f38f5\",\"code\":\"13158-00326\",\"title\":\"\",\"detail\":\"Standby cluster member does not process requests; use the cluster VIP.\",\"status\":\"421\"}]}\n. "
                     }
                 }
             ],
             "deployments_count": {
                 "total": 1,
                 "failed": 1
             },
             "id": "0ed08eda-deb4-4d74-9b8c-c9443fc2cef4",
             "name": "TestApp",
             "tenant_name": "DemoTenant",
             "type": "AS3"
         }
     ]
 },
 "_links": {
     "self": {
         "href": "/api/v1/spaces/default/appsvcs/documents"
     }
 },
 "count": 1,
 "total": 1
}

Delete the failed instance

To delete a BIG-IP Next instance using the API, you send a Delete to the /api/v1/spaces/default/instances/{{InstanceId}} endpoint.

  1. Delete the instance by sending a Delete to the /api/v1/spaces/default/instances/{{InstanceId}} endpoint. You must include the deviceId in your post.

    DELETE https://<big-ip_next_cm_mgmt_ip>/api/v1/spaces/default/instances/{{InstanceId}}
    

    Use the following API body for this post.

    {
     "save_backup": false
    }
    

Create a new instance using the manifest from the failed instance

To create a new instance you send a Post to the /api/device/v1/instances endpoint modifying the API payload based on values you got when you got the application service information earlier in this workflow.

Before you can create an instance, you need a vSphere template. For details on creating a new template refer to Deploy OVF template.

  1. Create the new instance by sending a Post to the /api/v1/spaces/default/instances/initialization endpoint. You must include the manifest from the failed instance in your post.

    POST https://<big-ip_next_cm_mgmt_ip>/api/v1/spaces/default/instances/initialization
    

    For the API body, use the manifest that you retrieved earlier in this workflow. It should look similar to the following example:

    {
     "template_name": "default-standalone-ve",
     "parameters": {
         "hostname": "hostname-iod",
         "instantiation_provider": [
             {
                 "id": "578bddf8-5369-4fea-9ec1-cb4105855405",
                 "type": "vsphere"
             }
         ],
         "vSphere_properties": [
             {
                 "cluster_name": "vSAN Cluster",
                 "datacenter_name": "mbip-7.0",
                 "resource_pool_name": "Mandalore",
                 "datastore_name": "vsanDatastore",
                 "vsphere_content_library": "CM-IOD",
                 "vm_template_name": "CM-IOD-template-BIG-IP-Next-20.0.1-2.139.10+0.0.97",
                 "num_cpus": 8,
                 "memory": 16384
             }
         ],
         "management_address": "10.146.194.81",
         "management_network_width": 24,
         "default_gateway": "10.146.167.254",
         "vsphere_network_adapter_settings": [
             {
                 "mgmt_network_name": "VM-mgmt",
                 "external_network_name": "LocalTestVLAN-114",
                 "internal_network_name": "LocalTestVLAN-115"
             }
         ],
         "dns_servers": [
             "128.95.112.1"
         ],
         "ntp_servers": [
             "0.north-america.pool.ntp.org",
             "1.north-america.pool.ntp.org"
         ],
         "l1Networks": [
             {
                 "name": "LocalTestVLAN-114",
                 "vlans": [
                     {
                         "name": "internal",
                         "selfIps": [
                             {
                                 "address": "10.30.123.10/16"
                             }
                         ]
                     }
                 ],
                 "l1Link": {
                     "name": "1.1",
                     "linkType": "Interface"
                 }
             },
             {
                 "name": "LocalTestVLAN-115",
                 "vlans": [
                     {
                         "name": "external",
                         "selfIps": [
                             {
                                 "address": "10.31.123.10/16"
                             }
                         ]
                     }
                 ],
                 "l1Link": {
                     "name": "1.2",
                     "linkType": "Interface"
                 }
             }
         ],
         "management_credentials_username": "admin-cm",
         "management_credentials_password": "password"
     }
    }
    

Deploy the application services to the new instance

The steps for deploying the application services that were deployed to the failed instance depend on whether the application service is an AS3 application or a FAST template application. Use the procedure that corresponds to the type of application services that were deployed to the failed instance.

Deploy FAST template application services to the new instance

To deploy the application services, you send a Post to the /api/v1/spaces/default/appsvcs/blueprints/{{appsvcsid}}/deployments endpoint. Use the appsvcesID that is contained in the response from creating the application services as part of your post.

  1. Create the application services by sending a Post to the /api/v1/spaces/default/appsvcs/blueprints endpoint. For the API body, use the following, substituting values appropriate for the application services you want to deploy:

{
    "name": "app-http-sa1",
    "template_name": "http",
    "set_name": "Examples",
    "parameters": {
        "pools": [
            {
                "loadBalancingMode": "round-robin",
                "loadBalancingRatio": 10,
                "monitorType": [
                    "http"
                ],
                "servicePort": 80,
                "application_name": "app-http-sa1",
                "poolName": "p-sa1"
            }
        ],
        "virtuals": [
            {
                "virtualName": "vs-sa1",
                "pool": "p-sa1",
                "enable_Access": false,
                "enable_HTTP2_Profile": false,
                "enable_TLS_Client": false,
                "enable_TLS_Server": false,
                "enable_WAF": false,
                "enable_iRules": false,
                "enable_snat": true,
                "loadBalancingMode": "round-robin",
                "monitorType": "http",
                "servicePort": 80,
                "enable_FastL4": false,
                "enable_TCP_Profile": false,
                "enable_UDP_Profile": false,
                "accessAdditionalConfigurations": " ",
                "snat_automap": true,
                "snat_addresses": [],
                "iRulesContent": [],
                "iRulesList": [],
                "UDP_idle_timeout": 60,
                "TCP_idle_timeout": 60,
                "FastL4_idleTimeout": 600,
                "FastL4_looseClose": true,
                "FastL4_looseInitialization": true,
                "FastL4_resetOnTimeout": true,
                "FastL4_tcpCloseTimeout": 43200,
                "FastL4_tcpHandshakeTimeout": 43200
            }
        ],
        "application_name": "app-http-sa1",
        "application_description": ""
    },
    "allowOverwrite": true
   }
  1. Scan the API response for the ID value. This is the appsvcs ID needed for the next step.

  2. Deploy the application services by sending a Post to the /api/v1/spaces/default/appsvcs/blueprints/{{appsvcsid}}/deployments endpoint. Use the appsvcesID that was returned from the previous step.

    POST https://<big-ip_next_cm_mgmt_ip>/api/v1/spaces/default/appsvcs/blueprints/{{appsvcsid}}/deployments
    

    For the API body, use the following, substituting values appropriate for the application services you want to deploy:

    {
     "deployments": [
         {
             "parameters": {
                 "pools": [
                     {
                         "poolName": "p-sa1",
                         "poolMembers": [
                             {
                                 "address": "10.20.1.1",
                                 "name": "n1"
                             },
                             {
                                 "address": "10.20.1.2",
                                 "name": "n2"
                             }
                         ]
                     }
                 ],
                 "virtuals": [
                     {
                         "virtualAddress": "10.21.200.50",
                         "virtualName": "vs-sa1"
                     }
                 ]
             },
             "target": {
                 "address": "10.146.164.223"
             },
             "allow_overwrite":  true
         }
     ]
    }
    

Deploy AS3 application services to the new instance

To deploy the AS3 application services, first you deploy the application service, then you deploy the application. Send a Post to POST http:/<big-ip_next_cm_mgmt_ip>/api/v1/spaces/default/appsvcs/documents/{{appsvcsid}}/deployments. { “target”: “<big_ip_next_mgmt_ip>” }

  1. Deploy the application services by sending a Post to the http:/<big-ip_next_cm_mgmt_ip>/api/v1/spaces/default/appsvcs/documents/{{appsvcsid}}/deployments endpoint.

    POST https:///<big-ip_next_cm_mgmt_ip>/api/v1/spaces/default/appsvcs/documents/{{appsvcsid}}/deployments
    {
    
     "target": "<big_ip_next_mgmt_ip>"
    }