XenServer 5.6 FP1 – Config NIC settings & Multipathing

During the installation of your XenServer, you only configure basic settings for your management Network Interface Card (NIC). Further, and maybe even more complex, configuration of your NICs can be set with the XenCenter GUI or with the xe CommandLine Interface (CLI).
The xe CLI can be run locally at the command prompt of the XenServer Console within XenCenter or you can use the ex.exe, which is part of the XenCenter installation and allows and administrator to remotely manage a XenServer from the command prompt of the Windows desktop. With the CLI you can also easily script some of the common tasks to perform on a XenServer.

This post contains additional xe CLI examples that are used for NIC settings on your XenServer.

Basic settings for remote connections with xe.exe:

Each xe.exe command starts with the connection settings for the XenServer (Pool Master), followed by the specific command(s) to be performed.
 

%programfiles%\Citrix\XenCenter>xe.exe -s [xenserver] -u [user] -pw [password] [xe-commands]

 
Which uses the following syntax:

  • xenserver: ip-address or name of the XenServer (or Pool Master).
  • user: name of account used to connect to the XenServer.
  • password: password of the used account.
  • xe-commands: the commands to be performed after the connection to the XenServer (Pool Master) is made.

To uniquely identify all objects in a XenServer configuration, each object is given an uuid, a unique identifier to use in all commands, so let’s look at the xe commands, to retrieve the uuid’s for different objects.

 

Retrieving the required object identifiers

The following commands show you how to retrieve the required unique identifiers for the different XenServer objects that are used for the configurational changes.

* List all XenServers in a Pool:

%programfiles%\Citrix\XenCenter>xe.exe -s [xenserver] -u [user] -pw [password] host-list

 
Gives a list of all XenServers (host) and their uuid.

 

* List all physical interfaces for the specified XenServer:

xe pif-list host-uuid=[uuid-host]

 
Which uses the following syntax:

  • uuid-host: unique identifier for the specified XenServer.

 
Gives a list of all physical NICs in the specified XenServer and their uuid.

 

If the XenServer is part of a Pool and the XenServer is NOT specified, all physical interfaces from all XenServers within the Pool are shown. Specify the XenServer to ensure you are retrieving the right uuid for the physical interface (pif).
 

 

Changing speed and duplex-mode of an interface

The following commands are used to change the speed and duplex settings for a NIC.

* Review all settings for the specified physical interface (pif):

xe pif-list uuid=[uuid-pif] params=all

 
Which uses the following additional syntax:

  • uuid-pif: unique identifier of the physical NIC in a XenServer.

 

* Setting speed and duplex mode for the specified NIC:

xe pif-param-set uuid=[uuid-pif] other-config:ethtool-autoneg="off" other-config:ethtool-speed="1000" other-config-duplex="full"

 
Which uses the following additional syntax:

  • uuid-pif: unique identifier of the physical NIC in a XenServer.

 

In order to set the speed and duplex-mode of the NIC, you need to turn off auto negotiation, so this setting is added to the command as well.
 

 

* Apply the new settings for the specified NIC:

xe pif-unplug uuid=[uuid-pif]
xe pif-plug uuid=[uuid-pif]

 
Which uses the following additional syntax:

  • uuid-pif: unique identifier of the physical NIC in a XenServer.

 

You need to unplug and plug the interface in order to activate the new settings. If for some reason you cannot perform these actions, the new settings will not be activated untill the XenServer is rebooted.
 Modifying speed and duplux-mode can also be performed with ethtool, which changes the settings on the fly. The changes made with ethtool are however not persistent and will be discarded after a reboot.

 

Creating a NIC bond

The following commands are used to team (or bond) two NICs into a single interface for network redundancy purposes.

* Create a new pool-wide (virtual) network for use with the bonded NICs:

xe network-create name-label=[network-name]

 
Which uses the following additional syntax:

  • network-name: name for the (virtual) network that is newly created.

 

This command returns the uuid of the newly created network. Make sure that you write it down for further reference.
 

 

* Create a new bond for this network:

xe bond-create network-uuid=[uuid-network] pif-uuids=[uuid-pif-1],[uuid-pif-2]

 
Which uses the following additional syntax:

  • uuid-network: unique identifier of the network.
  • uuid-pif-1: unique identifier of the 1st physical interface that is included in the bond.
  • uuid-pif-2: unique identifier of the 2nd physical interface that is included in the bond.

 

This command returns the uuid of the newly created bond. Make sure that you write it down for further reference.
 

 

* Retrieve the unique identifier of the bond:

xe pif-list network-uuid=[uuid-network]

 
Which uses the following additional syntax:

  • uuid-network: unique identifier of the network.

 

* Config the bond as an active/passive bond:

xe pif-param-set uuid=[uuid-bond-pif] other-config:bond-mode=active-backup

 
Which uses the following additional syntax:

  • uuid-bond-pif: unique identifier of the bond.

 

Enable storage multipathing

Some storage solutions support the use of multipathing. Multipath I/O is a fault-tolerance and performance enhancement technique whereby there is more than one physical path between the XenServer and the Storage device.
Dynamic multipathing support is available for Fibre Channel and iSCSI storage backends. By default, it uses roundrobin mode load balancing, so both routes have active traffic on them during normal operation.

Before attempting to enable multipathing, verify that multiple targets are available on your storage server. For example, an iSCSI storage backend queried for sendtargets on a given portal should return multiple targets.
 

* Check for multipath support (iSCSI):

iscsiadm -m discovery --type sendtargets --portal [ip-address-storage]
102.168.0.161:3260,1 iqn.strawberry:litchie
192.168.0.162:3260,2 iqn.strawberry:litchie

 
Which uses the following additional syntax:

  • ip-address-storage: the ip-adress used to connect to the storage.

 

* Retrieve all Physical Block Devices attached to the XenServer:

xe pbd-list host-uuid=[uuid-host]

 
Which uses the following additional syntax:

  • uuid-host: unique identifier of the XenServer (host).

 

* Unplug all Physical Block Devices (PBDs):

xe pbd-unplug uuid=[uuid-pbd]

 
Which uses the following additional syntax:

  • uuid-pbd: unique identifier of the physical block device (pbd).

 

* Set the multipath parameter on the XenServer:

xe host-param-set other-config:multipathing=true uuid=[uuid-host]

 
Which uses the following additional syntax:

  • uuid-host: unique identifier of the XenServer (host).

 

* Set the multipathhandle parameter on the XenServer:

xe host-param-set other-config:multipathhandle=dmp uuid=[uuid-host]

 
Which uses the following additional syntax:

  • uuid-host: unique identifier of the XenServer (host).

 

* Replug the PDB:

xe pbd-plug uuid=[uuid-pbd]

 
Which uses the following additional syntax:

  • uuid-pbd: unique identifier of the physical block device (pbd).

 

To disable multipathing, first unplug your VBDs, set the host other-config:multipathing parameter to false and then replug your PBDs as described above. Do not modify the otherconfig:multipathhandle parameter as this will be done automatically.
 

virtuEs Administrator
After finishing my Master of Science in Computer Science, I started working in the IT consultancy business in 1997. I've learned different diciplines, like web development, database administration, server administration and specialized in Server Based Computing solutions in 2007. Nowadays I'm designing new IT infrastructures as a Citrix Architect, specializing in Virtualization solutions.

10 thoughts on “XenServer 5.6 FP1 – Config NIC settings & Multipathing

  1. Pingback: VirtuEs.IT

  2. Pingback: Ruben Spruijt

  3. Pingback: John Carey

  4. Pingback: Joze Danen

  5. Pingback: S

  6. Pingback: Christiaan Swanepoel

  7. Pingback: Alain Malboeuf

  8. Fritz Walter

    This web site (XenServer 5.6 FP1 – Config NIC settings & Multipathing VirtuEs.IT) doesn’t show up correctly on my I phone – you may want to try and repair that 🙂 Fritz Walter

  9. Pingback: Alex Verboon