How to change network interface in an existing Hosting connection

How to change network interface in an existing Hosting connection

book

Article ID: CTX139460

calendar_today

Updated On:

Description

This article describes how to change the Network Interface detail in an existing Hosting connection.


Instructions

  1. Logon to one of the Delivery Controller and open PowerShell.

  2. Import PowerShell modules by executing Add-PSSnapin Citrix*.

  3. 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 : {}
  1. Copy the value of PSChildName and NetworkPath from the output.
  2. Prepare your command as follows and execute it.

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
​​​​​​​

Note: Sometimes even after updating the Provscheme to the new Network all the existing machines would not be updated to the new settings. This is because when a machine is created via MCS it settings are all fixed.

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.

Environment

The above mentioned sample code is provided to you as is with no representations, warranties or conditions of any kind. You may use, modify and distribute it at your own risk. CITRIX DISCLAIMS ALL WARRANTIES WHATSOEVER, EXPRESS, IMPLIED, WRITTEN, ORAL OR STATUTORY, INCLUDING WITHOUT LIMITATION WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NONINFRINGEMENT. Without limiting the generality of the foregoing, you acknowledge and agree that (a) the sample code may exhibit errors, design flaws or other problems, possibly resulting in loss of data or damage to property; (b) it may not be possible to make the sample code fully functional; and (c) Citrix may, without notice or liability to you, cease to make available the current version and/or any future versions of the sample code. In no event should the code be used to support ultra-hazardous activities, including but not limited to life support or blasting activities. NEITHER CITRIX NOR ITS AFFILIATES OR AGENTS WILL BE LIABLE, UNDER BREACH OF CONTRACT OR ANY OTHER THEORY OF LIABILITY, FOR ANY DAMAGES WHATSOEVER ARISING FROM USE OF THE SAMPLE CODE, INCLUDING WITHOUT LIMITATION DIRECT, SPECIAL, INCIDENTAL, PUNITIVE, CONSEQUENTIAL OR OTHER DAMAGES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. Although the copyright in the code belongs to Citrix, any distribution of the sample code should include only your own standard copyright attribution, and not that of Citrix. You agree to indemnify and defend Citrix against any and all claims arising from your use, modification or distribution of the sample code.

Issue/Introduction

This article describes how to change the Network Interface detail in existing host connection with XenDesktop.