From GUI to REST API calls
In these following parts, we worked in collaboration with my colleague @ekrejci.
We want to automate the creation of NSX Load Balancer using the REST API calls of NSX-T via vRealize Automation and vRealize Orchestrator.
Note: We did not choose the native Blueprint from vRA because of is limited possibilities, scalability and flexibility.
- Part 1: From GUI to REST API calls
- Part 2: Work in progress 😉
In this first part, we are going to see how to create a basic Load Balancer via REST API calls. We will verify that we got the right results in the NSX-T GUI. These calls are going to be used later by vRO.
Note: In our infrastructure we are running NSX-T 2.5.1.
We have a cluster of actif-actif T0 connected to a cluster of T1 called “T1-ITSERVICES-PROD-01”.
We will focus on the “mysql” business group in the “ITSERVICES” tenant in the “production” environment.
Below, the steps we will pass-trough in order to create a basic Load Balancer:
The steps in italic are done only once and don’t need to be automated.
- Create 1 Load Balancer service on each T1
- Create 1 server pool members
- Create a group (name “POOL-LB-ITS_MYSQL-Prod-01-Members”)
- Add the VMs matching criteria (create TAG per Server Pool -> st.lb.its_mysql.prod.01)
- Scope LB Tags (st.prod, st.its_mysql)
- Create 1 Server Pool per deployment (name “Pool-LB-its_mysql-Prod-01”)
- Choose algorithm (RR)
- Description (LB ITSERVICES PROD – its_mysql)
- Active Monitor (ICMP)
- SNAT Translation -> disable
- Min Active Member -> 1
- Scope LB Tags (st.prod, st.its_mysql)
- Prepare an IP Address POOL for the Virtual IP (VIP)
- Create 1 or more IP Address Blocks (10.110.1.0/24)
- Create 1 IP Address POOL and link it to the IP Address Blocks
- Add the virtual server (name “VS-LB-its_mysql-Prod-01”)
- Type of the Load Balancer (L7 HTTP)
- Allocate one IP dynamically for the VIP from the previously created IP Address POOL
- Port (80)
- Choice of the Load Balancer service (will depend of the Tenant and the Environment)
- Server Pool
- Description (Virtual Server ITServices – Prod – its_mysql)
- Application profile (default)
- Persistence (disable)
- Load-Balancer Rules (default)
- Additional Properties
- Default
- Admin state -> off
- Scope LB Tags (st.prod, st.its_mysql)
- Tag VMs (st.lb.its_mysql.prod.01 scope lb)