Load Balancer as a Service – Part 1

Creation of a Load Balancer service in the Simplified UI

The Load Balancer service need to be initialized only once for each T1.
->This call doesn’t need to be automated.

PUT https://<nsx-mgr>/policy/api/v1/infra/lb-services/LB-ITSERVICES-PROD
{
"resource_type" : "LbService",
"display_name" : "LB-ITSERVICES-PROD",
"path": "/infra/lb-services/LB-ITSERVICES-PROD",
"parent_path": "/infra",
"size" : "SMALL",
"connectivity_path" : "/infra/tier-1s/T1-ITSERVICES-PROD-01",
"description" : "LB-ITSERVICES-PROD for Virtual Server (VIP)",
"tags" : [
{
"scope": "lb",
"tag": "st.prod"
}
],
"marked_for_delete": false,
"enabled" : true
}


Creation of a Server POOL Members (group)

In this step, we create a matching criteria for our new group.
In our case, we defined that all the VMs tagged with st.lb.its_mysql.prod.01 will automatically join the group POOL-LB-ITS_MYSQL-Prod-01-Members.

PATCH https://<nsx-mgr>/policy/api/v1/infra/domains/default/groups/POOL-LB-ITS_MYSQL-Prod-01-Members
{
"expression": [
{
"member_type": "VirtualMachine",
"key": "Tag",
"operator": "EQUALS",
"value": "lb|st.lb.its_mysql.prod.01",
"resource_type": "Condition",
"marked_for_delete": false
}
],
"resource_type": "Group",
"display_name": "POOL-LB-ITS_MYSQL-Prod-01-Members",
"tags": [
{
"scope": "lb",
"tag": "st.prod"
},
{
"scope": "lb",
"tag": "st.its_mysql"
}
],
"marked_for_delete": false
}


Creation of a Server POOL

In this step, we create a new server POOL and link the previously created group members to it.

PUT https://<nsx-mgr>/policy/api/v1/infra/lb-pools/POOL-LB-ITSERVICES-Prod-1
{
"algorithm": "ROUND_ROBIN",
"member_group": {
"group_path": "/infra/domains/default/groups/POOL-LB-ITS_MYSQL-Prod-01-Members",
"ip_revision_filter": "IPV4"
},
"active_monitor_paths": [
"/infra/lb-monitor-profiles/default-icmp-lb-monitor"
],
"snat_translation": {
"type": "LBSnatDisabled"
},
"tcp_multiplexing_enabled": false,
"tcp_multiplexing_number": 6,
"min_active_members": 1,
"resource_type": "LBPool",
"id": "POOL-LB-ITSERVICES-Prod-1",
"display_name": "POOL-LB-ITS_MYSQL-Prod-01",
"description": "LB ITSERVICES PROD - its_mysql",
"tags": [
{
"scope": "lb",
"tag": "st.its_mysql"
},
{
"scope": "lb",
"tag": "st.prod"
}
]
}

Leave a Comment