A configuration job is a set of configuration commands that you can execute on one or more managed instances. When you execute the same configuration on multiple instances, you might want to use different values for the parameters used in your configuration. You can define variables that enable you to assign different values for these parameters or execute a job across multiple instances.
For example, consider a basic load balancing configuration where you add a load balancing virtual server, add two services, and bind the services to the virtual server. Now, you might want to have the same configuration on two instances but with different values for the virtual server and services names and IP addresses. You can use the configuration jobs feature to achieve this by using variables to define the names and IP addresses of the virtual server and services.
In this example, the following commands and variables are used:
add lb vserver servername HTTP ipaddress portnumber
add service servicename1 ipaddress1 HTTP 80
add service servicename2 ipaddress2 HTTP 80
bind lb vserver servername servicename1
bind lb vserver servername servicename2
To create a configuration job by defining variables in NetScaler MAS
1. Navigate to Infrastructure > Configuration Jobs.
2. Click Add to create a job.
3. On the Create Job page, select the custom job parameters such as the name of the job, the instance type, and the configuration type.
4. In the Configuration Editor, type in the commands to add a load balancing virtual server, two services, and bind the services to the virtual server. Select the values that you want to convert to a variable, and then click Convert to Variable. For example, select the IP address of the load balancing server ipaddress, and click Convert to Variable as shown in the image below.
5. Once you see dollar signs enclose the variable’s value, click on the variable to further specify the details of the variable such as name, display name, and type. You can also click the Advanced option if you want to further specify a default value for your variable. Click Save and then, click Next.
Type in the rest of your commands and define all the variables.
6. Select the instances you want to run the configuration job on.
7. In the Specify Variable Values tab, select the Variable Values from an Input File option and then click Download Input Key File. In our example, you will need to specify the server name on each instance, the IP addresses of the server and services, port numbers, and the service names. Save the file and upload it. If your values aren’t defined accurately, the system might throw an error.
8. The input key file is downloaded to your local system and you can edit it by specifying the variable values for each NetScaler instance you’ve selected previously and click Upload to upload the input key file to NetScaler MAS. Click Next.
9. On the Job Preview tab, you can evaluate and verify the commands to be run on each instance or instance group.
10. In the Execute tab, you can choose to execute your job now or schedule it to be executed at a later time. You can also choose what action NetScaler MAS should take it the command fails and if you’d like to send an Email notification regarding the success or failure of the job along with other details.
After configuring your jobs and executing it, you can see the job details by navigating to Infrastructure > Configuration Jobs and select the job you just configured. Click on Details and then, click on Variable Details to see the list of variables added to your job.