Assign Multiple Network Labels to a Desktop Pool
In View 5.2 and later releases, you can configure automated desktop pools to use multiple network labels. This feature greatly expands the number of IP addresses that can be assigned to the virtual machines in a pool, making it easier to create pools with a large number of desktops.
By default, the virtual machines in a desktop pool inherit the network interface card (NIC), and its associated network label, that are on the parent virtual machine or template. (Some parent virtual machines or templates might have multiple NICs with their associated network labels.) Typically, the subnet mask of a VLAN defined by a network label has a limited range of available IP addresses. For example, a subnet mask might have a maximum of 254 IP addresses that can be assigned to the desktop virtual machines.
In View 5.2 and later releases, View PowerCLI cmdlets let you assign network labels that are available in the vCenter Server resource pool where the desktop pool is being deployed. Specifically, you take the following steps:
You can assign multiple network labels to automated full clone pools or linked clone pools.
The network labels are distributed among the virtual machines in the entire desktop pool. When View provisions desktops, network labels are assigned in alphabetical order. When the maximum number of virtual machines are provisioned with IP addresses using the first network label, View starts assigning the second label, and so on.
To assign and manage multiple network labels in a pool, perform the following tasks:
Obtain NIC and Network Label Information in a Configuration File
Before you can assign multiple network labels to a pool, you must obtain information about the NICs configured on the template or parent virtual machine and the available network labels configured on the ESXi hosts in the cluster on which the desktop pool will be deployed. This information is saved in a configuration file that you use when you create the pool.
Use the Export-NetworkLabelSpecForLinkedClone cmdlet to obtain the NICs on a parent virtual machine and snapshot used to create a linked-clone pool.
Use the Export-NetworkLabelSpecForFullClone cmdlet to obtain the NICs on a template used to create a full clone pool.
These commands also perform the following operations:
Example of Obtaining NIC and Network Label Information
The following example obtains NICs from the Win7-Parent virtual machine and Snapshot1, and network label information from Cluster1. A maximum of 239 virtual machines can be provisioned with IP addresses from each network label. The information is exported to the configuration file C:/label.txt.
Export-NetworkLabelSpecForLinkedClone -vc_id 1a2b3c4d-5e6f -clusterPath "/myresourcepool/host/Cluster1/" -parentVMPath "/myresourcepool/vm/Win7-Parent" -parentSnapshotPath "/snapshot1" -maxVMsPerNetworkLabel 244 -networkLabelConfigFile "C:/label.txt"
When you set the -maxVMsPerNetworkLabel parameter, allow a certain number of virtual machines for overhead. For example, if a network label VLAN allows a maximum of 254 IP addresses to be assigned to virtual machines, you might set the maximum to 244.
The Export-NetworkLabelSpecForFullClone cmdlet is similar to the cmdlet shown in the preceding example, but it uses the -TemplatePath parameter to specify the template from which you will generate a full clone pool.
For details about the cmdlet syntax and parameters, display the View PowerCLI help.
Contents of a Network Label Configuration File
The configuration file generated by the Export Network Label cmdlets contains the following sections. For a sample configuration file, see Example Network Label Configuration File.
Enabled flag. This flag is set to enabled=true by default. Keep the flag set to true to allow View to assign network labels to the pool.
Parameter Definition for NIC. Lists the NICs defined in vCenter Server on the template or the snapshot of the parent virtual machine. Do not edit this section.
Parameter Definition for Network. Lists the network labels defined in vCenter Server for the ESXi hosts in the cluster. Network labels are listed in alphabetical order. If a cluster uses standard network labels and distributed virtual switch network labels, use only one type of label for a pool. Do not edit this section.
Network Label Attribute Definition. Lists the network labels associated with each NIC. The network labels are commented out and the assignments are not functional. You must remove the comments (# marks) from the appropriate network labels to allow them to be assigned to a desktop pool.

The maxvm parameter defines the maximum number of IP assignments that can be made to virtual machines from the network label. The value of the maxvm parameter is generated by the -maxVMsPerNetworkLabel parameter in the Export Network Label cmdlet. You can manually edit this value in the configuration file.

If the parent virtual machine or template has two NICs, each network label discovered by the Export Network Label cmdlet is associated with both NICs. Warning messages explain that IP address assignments can become oversubscribed because the assignment function for one NIC is not aware of the assignments that are made from the same network label for the second NIC. Each NIC is only aware of its own network label assignments.
Example Network Label Configuration File
#Network Label Configuration Spec

#WARNING! Setting enabled flag to false will
#turn off the automatic network label assignment
#for newly provisioned desktops.
enabled=true

#Parameter Definition for NIC
nic1=Network adapter 1
nic2=Network adapter 2

#Parameter Definition for Network
network01=dv_2k_2004
network02=dv_2kclient_2164
network03=dv_2kdt1_2084
network04=dv_2kInfra_1924
network05=dv_vMotion
network06=desktop-auto01-230
network07=desktop-auto02-240
network08=desktop-auto03-250
network09=desktop-auto04-260
network10=desktop-auto05-270

#Network Label Attribute Definition
#Expected format:
#<nic_param>.<network_param>.maxvm=<max vm for network label>

#WARNING! Multiple NICs:(nic1,nic2) detected against network01,
#total port count against network01: 488.
#IP address might be over-subscribed.
#WARNING! Multiple NICs:(nic1,nic2) detected against network02,
#total port count against network02: 488.
#IP address might be over-subscribed.
...
...
#WARNING! Multiple NICs:(nic1,nic2) detected against network02,
#total port count against network10: 488.
#IP address might be over-subscribed.

####nic1.network01.maxvm=244
####nic1.network02.maxvm=244
####nic1.network03.maxvm=244
####nic1.network04.maxvm=244
####nic1.network05.maxvm=244
####nic1.network06.maxvm=244
####nic1.network07.maxvm=244
####nic1.network08.maxvm=244
####nic1.network09.maxvm=244
####nic1.network10.maxvm=244
####nic2.network01.maxvm=244
####nic2.network02.maxvm=244
####nic2.network03.maxvm=244
####nic2.network04.maxvm=244
####nic2.network05.maxvm=244
####nic2.network06.maxvm=244
####nic2.network07.maxvm=244
####nic2.network08.maxvm=244
####nic2.network09.maxvm=244
####nic2.network10.maxvm=244
Edit the Network Label Configuration File
To edit the network label configuration file
1
2
Verify that each network label is assigned to only one NIC. Verify that only one type of network label is used for the pool. (A NIC can be configured with a standard network switch or distributed virtual network switch.)
3
For an example, see Example of an Edited Network Label Configuration File.
Note As a best practice, do not assign a network label to more than one desktop pool. Be aware that maximum network label counts are honored only on a per-NIC, per-pool basis. For example, if you configure NIC1 on pool1 to use network06 with a maxvm of 244, and you configure NIC1 on pool2 to use the same network label, network06, with a maxvm of 244, network06 must have an actual assignable IP address space of at least 488 addresses. Otherwise, the IP assignments from the network label might become oversubscribed.
Example of an Edited Network Label Configuration File
In the following example, network01 through network05 remain commented and are not used. network06 and network07 are assigned to nic1 (Network adapter 1). network08 and network09 are assigned to nic2 (Network adapter 2). This configuration can now support a pool of up to 488 virtual machines.
#Network Label Configuration Spec
...

#Network Label Attribute Definition
#Expected format:
#<nic_param>.<network_param>.maxvm=<max vm for network label>
...

####nic1.network01.maxvm=244
####nic1.network02.maxvm=244
####nic1.network03.maxvm=244
####nic1.network04.maxvm=244
####nic1.network05.maxvm=244
nic1.network06.maxvm=244
nic1.network07.maxvm=244
####nic1.network08.maxvm=244
####nic1.network09.maxvm=244
####nic1.network10.maxvm=244
####nic2.network01.maxvm=244
####nic2.network02.maxvm=244
####nic2.network03.maxvm=244
####nic2.network04.maxvm=244
####nic2.network05.maxvm=244
####nic2.network06.maxvm=244
####nic2.network07.maxvm=244
nic2.network08.maxvm=244
nic2.network09.maxvm=244
####nic2.network10.maxvm=244
Deploy a Desktop Pool with Network Label Assignments
To create an automated desktop pool that can use multiple network labels, use the Add-AutomaticLinkedClonePool cmdlet for linked clone pools or the Add-AutomaticPool cmdlet for full clone pools.
Use the -NetworkLabelConfigFile parameter with the Add Pool cmdlet to assign the network labels in a specified configuration file to the pool. Specify the path to the configuration file with the pathargument: -NetworkLabelConfigFile “path.
The -NetworkLabelConfigFile parameter works the same way for linked clone and full clone pools.
The following example creates a linked clone pool, POOL_NAME, and assigns the network labels in the label.txt file to the pool.
Add-AutomaticLinkedClonePool -Pool_id POOL_NAME -NamePrefix NAME_PREFIX -Vc_id 2162aa44-e99c-4f1a-875d-dd295681d2ca -Persistence Persistent -VmFolderPath "/resourcepool/vm/Discovered virtual machine" -ResourcePoolPath "/resourcepool/host/Cluster1/Resources/Cluster1_pool1"
-ParentVmPath "/resourcepool/vm/Win7-Parent" -ParentSnapshotPath "/780936_agent/noServiceRestart/updatedVPListener" -DatastoreSpecs "[Conservative,replica]/resourcepool/host/Cluster1/Cluster1_Replica1;[Moderate,OS,data]/resourcepool/host/Cluster1/Desktop_FC_9;[Moderate,OS,data]/resourcepool/host/Cluster1/Desktop_FC_8;[Moderate,OS,data]/resourcepool/host/Cluster1/Desktop_FC_7” -Composer_ad_id 1a2b3c4d-5d6e-7f-1234-1234abcd -UseUserDataDisk $false -UseTempDisk $false -MinimumCount 2000 -MaximumCount 2000 -HeadroomCount 1500 -PowerPolicy AlwaysOn -SuspendProvisioningOnError $false -NetworkLabelConfigFile "C:/label.txt"
Operation of Network Label Assignments
As View provisions virtual machines in a pool, network labels are assigned to the NICs in the virtual machines. When the maximum number of virtual machines to be assigned a certain network label is reached, View begins provisioning from the next network label.
After a network label is assigned to a virtual machine, View does not change the assignment.
If virtual machines in a pool are deleted, the associated network label assignments are freed and can be assigned to any newly provisioned virtual machines in the pool.
View Composer refresh operations do not affect network label assignments. Virtual machines continue to receive the network labels that were assigned to them when they were first provisioned.
Network Label Preservation During Recompose and Rebalance Operations
During View Composer recompose and rebalance operations, a best effort is made to ensure that the network label of each NIC attached to each linked-clone desktop is preserved when a linked clone inherits new NICs from a new base image. View preserves the network label of a NIC that was in place before the recompose or rebalance operation as long as the new base image has an available NIC configured with the same type of network switch. (A NIC can be configured with a standard network switch or distributed virtual network switch.)
The following examples illustrate the rules governing network label preservation during recompose and rebalance operations:
If both the original linked-clone desktop and the new base image have one NIC configured with a standard network switch, the network label and MAC address are preserved.
If both the original linked-clone desktop and the new base image have one NIC configured with a distributed virtual network switch, the network label and MAC address are preserved.
If the original linked-clone desktop has one NIC configured with a standard network switch and the new base image has one NIC configured with a distributed virtual network switch, the network label is not preserved. The MAC address is preserved.
If the original linked-clone desktop has two NICs, both of which are configured with a standard network switch, and the new base image has one NIC configured with a standard network switch, the network label of one original NIC is preserved, but all network properties associated with the other original NIC are not preserved.
Display the Network Label Assignments for an Existing Pool or Desktop
To display the network label assignments for a pool, use the Get-Pool cmdlet. The NetworkLabelSpecs output parameter shows the network labels that are assigned to the pool. You do not have to add a parameter in the command line to display this information. It is displayed automatically with the Get-Pool cmdlet.
The NetworkLabelSpecs output displays infomation in the following format:
nl - Network label name.
nic - NIC name
enabled - A value of 1 means the label is active. A value of 0 means it is disabled.
max - Maximum number of virtual machines that can be assigned the network label
usage - Number of virtual machines currently assigned to the network label.

When the usage value equals the max value, View stops assigning that network label and starts making assignments from the next available label.
The following example displays network label assignments for the pool Pool2.
> get-pool -pool_id Pool2
...
networkLabelSpecs : [nl=desktop-auto01-230;nic=Network adapter 1;enable
d=1;max=239;usage=239];[nl=desktop-auto02-240;nic=N
etwork adapter 1;enabled=1;max=239;usage=239];[nl=vie
wscale-auto03-250;nic=Network adapter 1;enabled=1;max
=239;usage=239];[nl=desktop-auto04-260;nic=Network
adapter 1;enabled=1;max=239;usage=239];[nl=desktop-
auto05-270;nic=Network adapter 1;enabled=1;max=239;us
age=239];[nl=desktop-auto06-280;nic=Network adapter
1;enabled=1;max=239;usage=239];[nl=desktop-auto07-
290;nic=Network adapter 1;enabled=1;max=239;usage=239
];[nl=desktop-auto08-300;nic=Network adapter 1;enab
led=1;max=239;usage=239];[nl=desktop-auto09-310;nic
=Network adapter 1;enabled=1;max=239;usage=88] ...
Displaying Network Label Information for a Virtual Machine
To display the network label assignments for a virtual machine, use the Get-DesktopVM cmdlet. The netLabelAutoAssigns output parameter shows the NIC names and network labels that View has attempted to assign to the virtual machine.
You do not have to add a parameter in the command line to display this information. It is displayed automatically with the Get-DesktopVM cmdlet.
If the Enabled flag in the network label configuration file was set to 0, the netLabelAutoAssigns output shows this feature is disabled.
Note The netLabelAutoAssigns output displays the network label assignments that View Connection Server reserves for the virtual machine. To see the network labels that are actually assigned to the virtual machine in vCenter Server, use the -getNetworkLabel parameter with the Get-DesktopVM cmdlet. See Displaying Network Label Assignments Made for a Virtual Machine in vCenter Server.
The following example displays network label assignments for the virtual machine 918 in the pool pool2.
> get-desktopvm -pool_id pool2
...
vm : 918
ps_object_type : vc_vm
id : VirtualMachine-vm-47878
vc_id : 2162aa44-e99c-4f1a-875d-dd295681d2ca
Name : pool2-1811
UnescapedName : pool2-1811
Path : /resource/vm/Discovered virtual machine/pool2/pool2-1811
GuestFullName : Microsoft Windows 7 (32-bit)
GuestID : windows7Guest
HostName : POOL2-1811.vdi3.net
IPAddress : 10.143.30.205
machine_id : 56496104-bf91-4d69-8bae-fb4493608542
user_sid :
user_displayname :
isInPool : true
pool_id : pool2
isLinkedClone : true
composerTask : refresh
localState :
netLabelAutoAssigns : {Network adapter 1=desktop-auto08-300} ...
Displaying Network Label Assignments Made for a Virtual Machine in vCenter Server
The netLabelAutoAssigns output displays the network label assignments that View Connection Server reserves for the virtual machine. Additional network label assignments to other virtual machines can be made in vCenter Server that are outside the control of View.
To see the network labels that are actually assigned to the virtual machine in vCenter Server, use the -getNetworkLabel parameter with the Get-DesktopVM cmdlet.
In the command line, you must type a Boolean value of $true to enable the -getNetworkLabel parameter. For example: -getNetworkLabel $true
The output of the Get-DesktopVM cmdlet displays the networkLabels parameter, which shows the NICs and network label assignments that were made for the virtual machine.
Note As a best practice, run the Get-DesktopVM cmdlet with the -getNetworkLabel parameter during off-peak periods of vSphere utilization. The parameter is long-running.
The following example displays network label assignments made in vCenter Server for the virtual machine 1849 in the pool pool2.
> get-desktopvm -pool_id pool2 -getnetworklabel $true
...
vm : 1849
ps_object_type : vc_vm
id : VirtualMachine-vm-46148
vc_id : 2162aa44-e99c-4f1a-875d-dd295681d2ca
Name : pool2-85
UnescapedName : pool2-85
Path : /resource/vm/Discovered virtual machine/pool2/pool2-85
GuestFullName : Microsoft Windows 7 (32-bit)
GuestID : windows7Guest
HostName : POOL2-85.vdi3.net
IPAddress : 192.168.1.10
networkLabels : {Network adapter 1=desktop-auto01-230}
machine_id : be14deda-ec1b-4dd1-834a-915fcc7d51a0
user_sid :
user_displayname :
isInPool : true
pool_id : pool2
isLinkedClone : true
composerTask :
localState :
netLabelAutoAssigns : {Network adapter 1=desktop-auto01-230} ...
Disable Automatic Network Label Assigments
To disable network label assignments on an existing pool that uses automatic assigments
1
2
3
Run the Update-AutomaticLinkedClonePool or Update-AutomaticPool cmdlet with the -NetworkLabelConfigFile parameter pointing to the updated configuration file.
Result:
When View provisions new virtual machines in the pool, View uses the network labels on the parent virtual machine or template.