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:

  1. Navigate to Templates > Scripts > DataScripts and click Create.

  2. Specify the name for the datascript.

  3. Select the AWCM pool from the Pools drop-down menu and specify the other details.

  4. Click the Events tab and click Add under the Events sub-section.

  5. 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:

  1. Application Profile: AWCM Application Profile created in the previous section.

  2. Service Port: 443 and 2001 (SSL).

  3. Pool: AWCM pool created in the previous section.

  4. Click Next to navigate to the DataScript tab.

  5. Click Add DataScript.

  6. Select the AWCM DataScript created in the previous section from the Script To Execute drop-down menu.

  7. Click Save DataScript.