For load balancing AirWatch Cloud Messaging (AWCM), the requirement is to persist the connections based on awcmsessionid
present in the cookie, URI, or HTTP header.
Connection Persistence can be done using the following methods:
Consistent Hash.
Using DataScript to maintain persistence tables.
Creating a Custom Health Monitor
Follow the same navigation steps mentioned in Creating a Custom Health Monitor section in Workspace ONE UEM Admin Console. Provide the AWCM request data(header and body as required) and click Save.
Creating Pool
Follow the same navigation steps mentioned in Creating Pool section in Workspace ONE UEM Admin Console.
For instance, since AWCM needs persistence based on parameter awcmsessionid
in either the URI or header, Consistent Hash based on the custom string can be used. The custom string is defined in the following steps using DataScript.
Creating an Application Profile
Follow the same navigation steps mentioned in Creating Application Profile section in Workspace ONE UEM Admin Console.
For AWCM, it is required to keep the front-end connection for 2 minutes. Navigate to the DDoS tab and change the HTTP Keep-Alive Timeout to 120000 ms (120 seconds).
Creating a DataScript
The following are the steps to create a DataScript and associate it with the AWCM pool:
Navigate to Create.
and clickSpecify the name for the datascript.
Select the AWCM pool from the Pools drop-down menu and specify the other details.
Click the Events tab and click Add under the Events sub-section.
Add the following DataScript to bind the AWCM Pool to the Datascript.
<br<default_pool = "AWCM-Pool" query = avi.http.get_query("awcmsessionid") header = avi.http.get_header("awcmsessionid") cookie = avi.http.get_cookie("awcmsessionid") if query ~= nil and query ~= "true" then avi.vs.log('QUERY HASH: '.. query) avi.pool.select("AWCM-Pool") avi.pool.chash(query) elseif header ~= nil then avi.vs.log('HEADER HASH: '.. header) avi.pool.select("AWCM-Pool") avi.pool.chash(header) else if cookie ~= nil then avi.vs.log('COOKIE HASH: '..cookie) avi.pool.select("AWCM-Pool") avi.pool.chash(cookie) else avi.vs.log('NIL HASH') avi.pool.select("AWCM-Pool") end end
Creating an L7 Virtual Service
Follow the same navigation steps mentioned in Creating an L7 Virtual Service section in Workspace ONE UEM Admin Console.
Select the following for creating a virtual service for AWCM:
Application Profile: AWCM Application Profile created in the previous section.
Service Port: 443 and 2001 (SSL).
Pool: AWCM pool created in the previous section.
Click Next to navigate to the DataScript tab.
Click Add DataScript.
Select the AWCM DataScript created in the previous section from the Script To Execute drop-down menu.
Click Save DataScript.