This article describes how to change the Network Interface detail in an existing Hosting connection.
Logon to one of the Delivery Controller and open PowerShell.
Import PowerShell modules by executing Add-PSSnapin Citrix*.
Execute dir XDHyp:\HostingUnits to get Host connection details.
The following is an example of the output for the preceding commands:
PSPath : Citrix.Host.Admin.V1\Citrix.Hypervisor::XDHyp:\Hosting Units\XENSERVERXD01 PSParentPath : Citrix.Host.Admin.V1\Citrix.Hypervisor::XDHyp:\Hosting Units PSChildName: XENSERVERXD01 PSDrive : XDHyp PSProvider : Citrix.Host.Admin.V1\Citrix.Hypervisor PSIsContainer : True HostingUnitUid : 9b0ee1f0-2b45-45d5-9664-8cad350130f8 HostingUnitName : XENSERVERXD01 HypervisorConnection : XSG7Pool RootPath : XDHyp:\Connections\XSG7Pool\ RootId : NetworkPath: XDHyp:\Connections\XSG7Pool\network1.network NetworkId : d8f21da0-6697-4fce-925b-99c19d4bae70 Storage : {XDHyp:\Connections\XSG7Pool\iSCSI 500GB.storage} VMTaggingEnabled : True UseLocalStorageCaching : False Metadata : {}
Set-Item -Path XDHyp:\HostingUnits\<PSChildName> -NetworkPath <New NetworkPath>
For Example :
Set-Item -Path "XDHyp:\HostingUnits\XENSERVERXD01" -NetworkPath "XDHyp:\Connections\XSG7Pool\network2.network"
New network interface is Network2 for the host XENSERVERXD01
To change the network to a new location for existing VMs, it is recommended to use the hypervisor console, MCS (XenDesktop) because the changes made would be saved.
If you want it to be on all new machine, the best way will be to create a new hosting unit with that network, and then a new MCS catalog, and mix the two machines (old and new) together at the DesktopGroup level.
Disclaimer: The steps described above will reconfigure the NetworkId and NetworkPath parameters on the hosting Connection. This will only be effective for new Machine Catalogs that are created afterwards. Existing Machine Catalogs in the environment that make use of the modified hosting connection will no longer be able to connect to the hosting environment. The error message below will be generated when creating new machines on existing Machine Catalogs.
Terminating Error:
An unknown error occurred while creating the virtual machines.
Stack Trace:
DesktopStudio_ErrorId : UnknownError
ErrorCategory : NotSpecified
ErrorID : NetworkNotPermitted
TaskErrorInformation : A NIC device is tied to a disallowed network.
InternalErrorMessage : A NIC device is tied to a disallowed network.
Machine Failures:
: Failed to create the virtual machine; .
Inner Error:
A NIC device is tied to a disallowed network.
This is because the Provisioning Scheme attached to the Machine Catalog is not updated using this method. Affected Machine Catalogs will need to be recreated and hosting resources reassigned. Care must be taken when changing objects such as Datacenter, Cluster and Network resource names. After the environment has been provisioned, XenDesktop will depend on these names to locate resources.
Note : You might not get Network path on pressing "hyphen" in PowerShell command for "Xenserver only" however just the run the command as it is, this will work and you will be able to change the path.