Integrate NetScaler CPX Instances with Mesos, Marathon, InfoBlox, and Nuage by Using NetScaler MAS

As a network administrater, you can use Marathon scheduler to deploy your applications in Mesos cluster and provision multiple NetScaler CPX instances and load balance the traffic to the applications. You can use Nuage VSP solution to provide network connectivity to every application and NetScaler CPX instance in your deployment and also use the InfoBlox solution to set up DNS services in your deployment.

Using NetScaler MAS you can manage, monitor, and gain visibility into your NetScaler CPX instances and applications.

For this deployment, perform the following tasks:

  1. Set up a Mesos and Marathon master-slave cluster. Every application and NetScaler CPX instance must be configured on an Ubuntu host and these hosts must be configured as Mesos slaves. You must configure an Ubuntu host as a Mesos master and install Marathon on the Mesos master. For more information, see
  2. You must store the images of your applications and NetScaler CPX instances on all the Mesos slaves.
  3. You can then launch your applications and NetScaler CPX instances by using the Marathon CLI or Marathon GUI. Note that Marathon launches a NetScaler CPX instance as an application. For more information about running applications on Marathon, see
  4. Set up a VIP subnet on the Nuage VSP solution. The VIP subnet must be large enough to accommodate the VIP needs for all Mesos applications in the future. The VIP subnet must not be used by any Mesos applications and no Nuage endpoints (vports) must be created on it.
  5. Set up a DNS server on the InfoBlox solution for DNS resolution.
  6. Register the applications, Marathon scheduler, Nuage, and InfoBlox details with NetScaler MAS.
  7. Add the NetScaler CPX instances to NetScaler MAS.

Points to Note:

  1. The NetScaler CPX IP address (management IP address) must be fully routable within the Mesos cluster.
  2. When you provision the NetScaler CPX instance on a Mesos slave, you must specify the following details:
    • NetScaler MAS host name or IP address
    • NetScaler MAS administrator user name and password
    • The DNS server name that you will configure on the NetScaler CPX instance for DNS resolution
  3. There must be a one-to-one mapping between an application and a Nuage subnet.
  4. NetScaler CPX must be connected to the network using the Nuage Docker monitor running on the Mesos slave.
  5. Only the Marathon application tasks (IP:port members of the application’s VIP address) must be present on the subnet associated with it.
  6. Marathon application port must be specified in one of the Marathon labels.

Launching Applications and NetScaler CPX instances by using the Marathon GUI

You can access the Marathon GUI by typing the Marathon IP address and port in a browser. By default, the Marathon port is 8080.

To launch an application and NetScaler CPX instance:

1. Log on to the Marathon GUI.

2. On the Applications tab, in the top-left pane, click Create.

3. In the New Application screen, specify the parameters in the Docker container settings, Environment variables, Labels, Health checks, and Optional settings sections.


In a Mesos and Marathon environment, support is available to run the NetScaler CPX instance in only the host networking mode. Therefore, if you are launching a NetScaler CPX instance, in the Docker container settings section, in the Network list, select *Hosts*.

localized image

4. Click + Create.

5. The applications that you have launched are displayed under Applications.

localized image

Registering the applications, Marathon scheduler, Nuage, and InfoBlox details with NetScaler MAS

You must register the details of your applications, Marathon scheduler, Nuage and InfoBlox solutions with NetScaler MAS, to successfully deploy the NetScaler CPX instance.

You must configure your network in a way that the NetScaler CPX instance can open connections to NetScaler MAS. Once the NetScaler CPX container starts up and acquires a management IP address from the Nuage environment, it sends a registration request to NetScaler MAS using a secure connection.

As part of the registration process, NetScaler MAS learns about the NetScaler CPX instance and the IP address or the port on which it can reach it for configuration using NITRO REST APIs. Then, NetScaler MAS starts monitoring its health.

To register details with NetScaler MAS

  1. Log on to NetScaler MAS.
  2. Navigate to Orchestration > Container Orchestration > Mesos Configuration, and then click Add.
  3. Under Application Settings, specify the following parameters:
    • App Default Domain Suffix. Domain suffix that is used to create a DNS name for an application to be configured in InfoBlox.
    • VIP Subnet Name. Name of the Nuage subnet used by NetScaler MAS to allocate VIPs for applications. You must create this subnet beforehand on the Nuage system and then register it with NetScaler MAS.
  4. Under Marathon Scheduler Details, specify the Marathon URL, user name and password.
  5. Under Nuage Details, specify the VSD URL, user name, password, and the VSD enterprise ID.
  6. Under InfoBlox, specify the InfoBlox URL, user name, and password.
  7. In the /etc/resolv.conf file, add the InfoBlox DNS IP address and the domain search path.
    Note: When you restart the NetScaler Management and Analytics System, to retain the InfoBlox DNS IP address and the domain search path in the /etc/resolv.conf file, update the following in the /mpsconfig/svm.conf file: /mps/ <DNS IP address1> <DNS IP address2> echo “search <domain name>” >> /etc/resolv.conf
  8. Launch the NetScaler CPX Instace using a JSON script file. The following is sample JSON script file:
    Note: Make sure that you include the following lines in your JSON script file: "cmd" : "cd /var/netscaler/bins/ ; sed -i 's/\# Creating NSPPE startup conf, Read By PE/\# Creating NSPPE startup conf, Read By PE\\\\necho \\"$NSIP $HOSTNAME\\" \>\> \\\\\\/etc\\\\\\/hosts/' ./docker\ ; bash -C ./docker\ ; bash",

Sample JSON script:

    curl -X POST http://10.xx.xx.62:8080/v2/apps -d @cpx_nuage_custom_etchostcorrection.json -H "Content-type: application/json"

          "id": "cpx-host3",
          "cpus": 1,
          "mem": 1024,
          "instances": 2,
          "cmd" : "cd /var/netscaler/bins/ ; sed -i 's/# Creating NSPPE startup conf, Read By PE/# Creating NSPPE startup conf, Read By PE\\necho \"$NSIP $HOSTNAME\" >> \\\/etc\\\/hosts/' ./ ; bash -C ./ ; bash",
          "constraints": [["hostname", "UNIQUE"]],
          "container": {
               "type": "DOCKER",
               "docker": {
                        "image": “cpx:",
                        "network": "NONE",
                        "privileged": true,
                        "parameters": [
                            { "key": "tty", "value": "true" }
          "env": {
           "NUAGE-ENTERPRISE": "<nuage_enterprise>",
           "NUAGE-DOMAIN" : "<nuage_domain>",
          "labels": {
                     "NETSCALER_AS_APP": "true"


  • <nuage_enterprise> is the Nuage enterprise name.
  • <nuage_domain> is the Nuage domain name.
  • <nuage_zone> is the Nuage zone name.
  • <nuage_network> is the Nuage network details.
  • <nuage_user> is the Nuage admin username.
  • <NMAS_server_IP> is the NetScaler MAS server IP address.