Product Documentation

Configuring Admin Partitions

Jun 14, 2016

To create an admin partition, you must perform a set of operations on the default partition. To understand this procedure, let us consider a company that has two departments each of which has an application that requires the NetScaler functionality. The NetScaler admin wants to have a different partition for each department so that there is isolation of users and configurations. The NetScaler admin must do the following (the sample shows configurations only for a single admin partition):

Note: For detailed information and best practices, see Admin Partitions.

Creating an Admin Partition

While creating an admin partition, you must also specify the system resources that must be allocated to that partition.

The following sample code creates an admin partition named "partition-dept1".

Java - Sample code to create an admin partition 複製

nspartition nspartitionObject = new nspartition();
nspartitionObject.set_partitionname("partition-dept1");
nspartitionObject.set_maxbandwidth(10240);
nspartitionObject.set_maxconn(1024);
nspartitionObject.set_maxmemlimit(10);
nspartitionObject.set_minbandwidth(1240);
base_response result = nspartition.add(nitroService, nspartitionObject);

.NET - Sample code to create an admin partition 複製

nspartition nspartitionObject = new nspartition();
nspartitionObject.partitionname = "partition-dept1";
nspartitionObject.maxbandwidth = 10240;
nspartitionObject.maxconn = 1024;
nspartitionObject.maxmemlimit = 10;
nspartitionObject.minbandwidth = 1240;
base_response result = nspartition.add(nitroService, nspartitionObject);

Python - Sample code to create an admin partition 複製

nspartitionObject = nspartition()
nspartitionObject.partitionname = "partition-dept1"
nspartitionObject.maxbandwidth = 10240
nspartitionObject.maxconn = 1024
nspartitionObject.maxmemlimit = 10
nspartitionObject.minbandwidth = 1240
result = nspartition.add(nitroService, nspartitionObject)

Associating Users with Partitions

Associate the appropriate users with the partition.

The following sample code associates "user1" to a partition named "partition-dept1".

Java - Sample code for associating user with partition 複製

systemuser_nspartition_binding systemuser_nspartition_binding_object = new systemuser_nspartition_binding();
systemuser_nspartition_binding_object.set_partitionname("partition-dept1");
systemuser_nspartition_binding_object.set_username("user1");
base_response result = systemuser_nspartition_binding.add(nitroService, systemuser_nspartition_binding_object);

.NET - Sample code for associating user with partition 複製

systemuser_nspartition_binding systemuser_nspartition_binding_object = new systemuser_nspartition_binding();
systemuser_nspartition_binding_object.partitionname = "partition-dept1";
systemuser_nspartition_binding_object.username = "user1";
base_response result = systemuser_nspartition_binding.add(nitroService, systemuser_nspartition_binding_object);

Python - Sample code for associating user with partition 複製

systemuser_nspartition_binding_object =  systemuser_nspartition_binding()
systemuser_nspartition_binding_object.partitionname = "partition-dept1"
systemuser_nspartition_binding_object.username = "user1"
result = systemuser_nspartition_binding.add(nitroService, systemuser_nspartition_binding_object)

Specifying Command Policy for Partition Users

Associate an appropriate command policy to the admin partition user.

The following sample code associates the command policy "partition-admin" to "user1".

Java - Sample code to specify command policy for partition user 複製

systemuser_systemcmdpolicy_binding binding_object = new systemuser_systemcmdpolicy_binding();
binding_object.set_username("user1");
binding_object.set_policyname("partition-admin");
binding_object.set_priority(1);
base_response result = systemuser_systemcmdpolicy_binding.add(nitroService,binding_object);

.NET - Sample code to specify command policy for partition user 複製

systemuser_systemcmdpolicy_binding binding_object = new systemuser_systemcmdpolicy_binding();
binding_object.username = "user1";
binding_object.policyname = "partition-admin";
binding_object.priority = 1;
base_response result = systemuser_systemcmdpolicy_binding.add(nitroService,binding_object);

Python - Sample code to specify command policy for partition user 複製

binding_object = systemuser_systemcmdpolicy_binding()
binding_object.username = "user1"
binding_object.policyname = "partition-admin"
binding_object.priority = 1
result = systemuser_systemcmdpolicy_binding.add(nitroService,binding_object)

Specifying the Admin Partition VLAN or Bridgegroup

Specify the VLANs or bridgegroups to be associated with the partition. This step ensures network isolation of the traffic. Traffic received on the interfaces of the VLAN or bridgegroup is isolated from the traffic of other partitions.

The following sample code specifies a VLAN for an admin partition.

Java - Sample Code to specify the VLAN 複製

nspartition_vlan_binding nspartition_vlan_binding_object = new nspartition_vlan_binding();
nspartition_vlan_binding_object.set_vlan(2);
nspartition_vlan_binding_object.set_partitionname("partition-dept1");
base_response result = nspartition_vlan_binding.add(nitroService, nspartition_vlan_binding_object);

.NET - Sample code to specify the VLAN 複製

nspartition_vlan_binding nspartition_vlan_binding_object = new nspartition_vlan_binding();
nspartition_vlan_binding_object.vlan = 2;
nspartition_vlan_binding_object.partitionname = "partition-dept1";
base_response result = nspartition_vlan_binding.add(nitroService, nspartition_vlan_binding_object);

Python - Sample code to specify the VLAN 複製

nspartition_vlan_binding_object = nspartition_vlan_binding()
nspartition_vlan_binding_object.vlan = 2
nspartition_vlan_binding_object.partitionname = "partition-dept1"
result = nspartition_vlan_binding.add(nitroService, nspartition_vlan_binding_object)

Switching Partitions

If you are associated with multiple admin partitions, you can switch to the required partition.

The following sample code switches from current partition to a partition named "partition-dept2".

Java - Sample code to switch partitions 複製

nspartition nspartitionObject = new nspartition();
vnspartitionObject.set_partitionname("partition-dept2");
base_response result = nspartition.Switch(nitroService, nspartitionObject);

.NET - Sample code to switch partitions 複製

nspartition nspartitionObject = new nspartition();
nspartitionObject.partitionname = "partition-dept2";
base_response result = nspartition.Switch(nitroService, nspartitionObject);

Python - Sample code to switch partitions 複製

nspartitionObject = nspartition()
nspartitionObject.partitionname = "partition-dept2"
result = nspartition.Switch(nitroService, nspartitionObject)