Updating NSX-T Load Balancer Server Pool Membership

Page last updated:

Warning: Pivotal Cloud Foundry (PCF) v2.4 is no longer supported because it has reached the End of General Support (EOGS) phase as defined by the Support Lifecycle Policy. To stay up to date with the latest software and security updates, upgrade to a supported version.

This topic describes how to update load balancer server pool membership for Pivotal Cloud Foundry (PCF) deployments using NSX-T on vSphere. To update this information, you must use the Ops Manager API.

See the Ops Manager API documentation for more information about the API.

Note: This procedure requires NSX-T v2.2 or later.

Authenticate

To use the Ops Manager API, you must authenticate and retrieve a token from the Ops Manager User Account and Authentication (UAA) server. For instructions, see the Using Ops Manager API topic.

Update Load Balancer Server Pool Membership

To update load balancer server pool membership, do the following:

  1. Create VM Extensions
  2. Stage and Associate VM Extensions
  3. Apply Changes

Create VM Extensions

To create VM extensions, do the following:

  1. Create a file named web.json and paste the following. This is the VM extension for the VMs that serve as the HTTP or HTTPS endpoint of the foundation. The BOSH instance group router serves as the HTTP or HTTPS endpoint.

    {
        "name": "pas_web_vm_extension",
        "cloud_properties": {
            "nsxt": {
                "lb": {
                    "server_pools": [
                        {
                            "name": "pas-web-pool"
                        }
                    ]
                }
            }
        }
    }
    
  2. Create a file named ssh.json and paste the following. This is the VM extension for the VMs that serve as the SSH endpoint of the foundation. The BOSH instance group diego_brain serves as the SSH endpoint. On Small Footprint PAS the instance group is called control.

    {
        "name": "pas_ssh_vm_extension",
        "cloud_properties": {
            "nsxt": {
                "lb": {
                    "server_pools": [
                        {
                            "name": "pas-ssh-pool"
                        }
                    ]
                }
            }
        }
    }
    
  3. Create a file named tcp.json. This is the VM extension for the VMs that serve as the endpoint of apps that require custom TCP ports. The BOSH instance group tcp_router serves as the custom TCP port endpoint On Small Footprint PAS this instance group is not deployed by default.

    {
        "name": "pas_tcp_vm_extension",
        "cloud_properties": {
            "nsxt": {
                "lb": {
                    "server_pools": [
                        {
                            "name": "pas-tcp-pool"
                        }
                    ]
                }
            }
        }
    }
    

Stage and Associate VM Extensions

To stage and associate VM extensions with the load balancer, do the following:

  1. Run the following command to stage the web.json VM extension:

    curl "https://OPS-MAN-FQDN/api/v0/staged/vm_extensions" \
    -X POST \
    -H "Authorization: Bearer UAA-ACCESS-TOKEN" \
    -H "Content-Type: application/json" \
    -d "$(cat $VM_EXTENSION_FILE_PATH)"
    

    Where:

    • OPS-MAN-FQDN is the fully qualified domain name of your Ops Manager installation.
    • UAA-ACCESS-TOKEN is the access token you retrieved when authenticating with the Ops Manager API.
    • VM_EXTENSION_FILE_PATH is the path to the VM extension file.
  2. Repeat the previous step for the ssh.json and tcp.json VM extensions.

  3. Run the following command to retrieve a list of staged products:

    curl 'https://OPS-MAN-FQDN/api/v0/staged/products' \
    -H "Authorization: Bearer UAA-ACCESS-TOKEN"
    
  4. Record the GUID of the cf product. In the following example output, the GUID is cf-01222ab1111111aaa1a.

        [
       {
          "product_version" : "1.10.6.0",
          "guid" : "p-bosh-dee11e111e1111ee1e1a",
          "installation_name" : "p-bosh",
          "type" : "p-bosh"
       },
       {
          "type" : "cf",
          "product_version" : "1.10.8-build.7",
          "installation_name" : "cf-01222ab1111111aaa1a",
          "guid" : "cf-01222ab1111111aaa1a"
       }
    ]

  5. Retrieve the list of jobs for cf:

    curl 'https://OPS-MAN-FQDN/api/v0/staged/products/PRODUCT-GUID/jobs' \
    -H 'Authorization: Bearer UAA-ACCESS-TOKEN'
    
  6. Record the value of guid for the router, tcp_router, and diego_brain jobs. See the following example output:

    {
    "jobs" : [
      {
         "name" : "router",
         "guid" : "router-9c37cf48ae7412f2afd1" 
      },
      {
         "name" : "tcp_router",
         "guid" : "tcp_router-6af18efdd18d198edee9"
      },
      {
         "name" : "diego_brain",
         "guid" : "diego_brain-b49b0b2aed247302c0e1"
      },
      ...
      
  7. To associate your job with its appropriate VM extension, run the following command:

    curl "https://OPS-MAN-FQDN/api/v0/staged/products/PRODUCT-GUID/jobs/JOB-GUID/resource_config" \
      -X PUT \
      -H "Content-Type: application/json" \
      -H "Authorization: Bearer UAA-ACCESS-TOKEN" \
      -d '{"instance_type": {"id": "INSTANCE-TYPE"},
     "instances": INSTANCE-COUNT,
     "additional_vm_extensions": ["VM-EXTENSION-NAME"]
       }'
    

    Warning: Do not use the resource config fields for nsx_lbs and nsx_security_groups. These fields are only for NSX-V.

    Where:

    • PRODUCT-GUID is the GUID you recorded for the cf product.
    • JOB-GUID is the GUID you recorded for the router job.
    • INSTANCE-TYPE is the instance type for the job. For the default instance type, use "automatic".
    • INSTANCE-COUNT is the number of instances for the job. The default number for each job is visible in the Resource Config section of the Ops Manager UI.
    • VM-EXTENSION-NAME is pas_web_vm_extension.
  8. Run the previous command again.

    Where:

    • JOB-GUID is the GUID you recorded for the tcp_router job.
    • VM-EXTENSION-NAME is pas_tcp_vm_extension.
  9. Run the previous command again.

    Where:

    • JOB-GUID is the GUID you recorded for the diego_brain job.
    • VM-EXTENSION-NAME is pas_ssh_vm_extension.

Apply Changes

To apply changes, do the following:

  1. Log in to the Ops Manager Installation Dashboard.

  2. Click Review Pending Changes, then Apply Changes to redeploy.