0% found this document useful (0 votes)
96 views17 pages

Networking: PIF VIF

The document discusses networking configuration in XenServer, including: - Managing networking for standalone hosts and resource pools - Creating networks, VLANs, and connecting VMs to networks - Forming NIC bonds between two physical NICs for redundancy - Changing networking options like the management NIC and IP addresses It provides instructions for configuring various networking features using the xe CLI.

Uploaded by

Supriono Legimin
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
96 views17 pages

Networking: PIF VIF

The document discusses networking configuration in XenServer, including: - Managing networking for standalone hosts and resource pools - Creating networks, VLANs, and connecting VMs to networks - Forming NIC bonds between two physical NICs for redundancy - Changing networking options like the management NIC and IP addresses It provides instructions for configuring various networking features using the xe CLI.

Uploaded by

Supriono Legimin
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 17

Networking

Table of Contents Networking configuration performed during Host installation Managing networking configuration for standalone XenServer Hosts Creating networks Connecting Virtual Machines (VMs) to networks Creating VLANs Creating NIC bonds Controlling Quality of Service (QoS) Dedicating a NIC to storage traffic Changing networking configuration options Managing networking configuration for XenServer pools Networks in resource pools Creating NIC bonds in resource pools Changing XenServer Host IP address configuration in resource pools NIC/PIF ordering Networking Troubleshooting Diagnosing network corruption Recovering from a bad network configuration This chapter discusses how physical network interface cards (NICs) in XenServer Hosts are used to enable networking within Virtual Machines (VMs). XenServer supports up to 4 physical NICs per XenServer Host and up to 7 virtual network interfaces (VIFs) per VM. XenServer 4.1 provides automated configuration and management of NICs via the xe command line interface (CLI). As VIFs, PIFs, and networks are created and configured the XenServer Host will perform all required configuration of the physical NICs.

Note
Unlike previous XenServer versions, the host's networking configuration files should not be edited directly in most cases; where a CLI command is available, do not edit the underlying files. Some networking options have different behaviors when used with standalone XenServer Hosts compared to resource pools. This chapter contains sections on general information that applies to both standalone hosts and pools, and additional information that applies when using pools. The xe CLI can be used to create, destroy and modify three types of server-side objects which represent networking entities. These objects are:

A PIF, which represents a physical network interface on a XenServer Host. A VIF, which represents a virtual interface on a Virtual Machine.

A network, which is a virtual Ethernet switch on a XenServer Host. Network objects have a name and description, a globally unique UUID, and the collection of VIFs and PIFs connected to the network.

Additional CLI commands allow configuration of networking options, control over which NIC is used for management operations, and creation of advanced networking features such as virtual local area networks (VLANs) and NIC bonds. The examples in this chapter assume familiarity with the xe CLI. For more information on using the xe CLI, see Command line interface.

Networking configuration performed during Host installation


The networking configuration for a XenServer Host is specified during initial host installation. Options such as IP address configuration (DHCP/static), the NIC used as the management interface, and hostname are set based on the values provided during installation. When a XenServer Host has a single NIC, the follow configuration will be present after installation:

a single PIF is created corresponding to the host's single NIC the PIF is configured with the IP addressing options specified during installation and to enable management of the host the PIF is set for use in host management operations a single network, network 0, is created network 0 is connected to the PIF to enable external connectivity to VMs

When a host has multiple NICs the configuration present after installation depends on which NIC is selected for management operations during installation:

PIFs are created for each NIC in the host the PIF of the NIC selected for use as the management interface is configured with the IP addressing options specified during installation a network is created for each PIF ("network 0", "network 1", etc.) each network is connected to one PIF the IP addressing options of all other PIFs are left unconfigured

In both cases the resulting networking configuration allows connection to the XenServer Host by XenCenter, the xe CLI, and any other management software running on separate machines via the IP address of the management interface. The configuration also provides external networking for VMs created on the host. The PIF used for management operations is the only PIF ever configured with an IP address. External networking for VMs is achieved by bridging PIFs to VIFs via the network object which acts as a virtual Ethernet switch. The steps required for networking features such as VLANs, NIC bonds, and dedicating a NIC to storage traffic are covered in the following sections.

Managing networking configuration for standalone XenServer Hosts


Creating networks
Each XenServer Host has one or more networks, which are virtual Ethernet switches. Networks without an association to a PIF are considered internal, and can be used to provide connectivity only between VMs on a given XenServer Host, with no connection to the outside world. Networks with a PIF association are considered available through the PIF's NIC. Because external networks are created for each PIF during host installation, creating additional networks is typically only required to:

external,

and provide a bridge between VIFs and the PIF connected to the network, enabling connectivity to resources

use an internal network support advanced operations such as VLANs or NIC bonding

To add or remove networks using XenCenter, refer to the XenCenter online Help. To add a new network via the CLI 1. 2. Open the XenServer Host text console. Create the network with the network-create command, which returns the UUID of the newly created network:

3. xe network-create name-label=<mynetwork>

At this point the network is not connected to a PIF and therefore is internal.

Connecting Virtual Machines (VMs) to networks


When a new VM is created via the CLI, it does not contain a virtual network interface (VIF). Adding a VIF and connecting it to the desired network must be done as additional steps. When creating VMs using XenCenter, the New VM wizard contains a page allowing creation of virtual network interfaces. To add a new virtual interface to a VM via the CLI 1. Use xe vm-list to find the UUID of the VM to which you want to add the VIF. For example, if the VM is named windows, issue the following command to return the UUID of the VM:

2. xe vm-list params=uuid name-label=windows

3.

Add a VIF to the VM with the vif-create command, specifying the VM and network UUIDs. The UUID of the new virtual interface will be returned:

4. xe vif-create vm-uuid=<VM UUID> network-uuid=<network UUID> device=0

The device parameter is a number which uniquely identifies the virtual NIC (0, 1, 2, etc.) to a VM. 5. VIFs are automatically plugged into VMs when a VM is started, but if the VM is already running when the VIF is created, the VIF must be manually connected, or hot-plugged. Hot-plugging VIFs requires the

XenServer Virtual Machine Installation Guide for details on installing the XenServer Tools. To hot-plug a VIF to a VM use the
XenServer Tools to be installed in the VM. Refer to the vif-plug command:

6. xe vif-plug uuid=<VIF UUID>

Creating VLANs
Virtual Local Area Networks (VLANs) allow a single physical network to support multiple logical networks. To use VLANs with XenServer, the host's NIC must be connected to a VLAN trunk port. XenServer VLANs are represented by additional PIFs corresponding to a specified VLAN tag. XenServer networks can then be connected to the PIF representing the physical NIC to see all traffic on the NIC, or to a PIF representing a VLAN to see only the traffic with the specified VLAN tag. When using VLANs the XenServer Host handles all interpretation of the VLAN tags and does not include VLAN tags in packets routed to VMs. To connect a network to an external VLAN via the CLI 1. 2. Open the XenServer Host text console. Create a new network for use with the VLAN. The UUID of the new network is returned:

3. xe network-create name-label=network5

4.

Use the pif-list command to find the UUID of the PIF corresponding to the physical NIC supporting the desired VLAN tag. The UUIDs and device names of all PIFs are returned, including any existing VLANs:

5. xe pif-list

6.

Create a VLAN object specifying the desired physical PIF and VLAN tag. A new PIF will be created and plugged into the specified network. The UUID of the new PIF object is returned.

7. xe vlan-create network-uuid=<network UUID> pif-uuid=<PIF UUID> vlan=5

8.

Attach VM VIFs to the new network. See the section called Connecting Virtual Machines (VMs) to networks for more details.

Creating NIC bonds

NIC bonds can improve XenServer Host resiliency by using two physical NICs as if they were one. If one NIC within the bond fails the host's network traffic will automatically be routed over the second NIC. NIC bonds work in an active/passive mode, with only one physical NIC ever in use. XenServer NIC bonds completely subsume the underlying physical devices (PIFs). In order to activate a bond the underlying PIFs must not be in use, either as the management interface for the host or by running VMs with VIFs attached to the networks associated with the PIFs. XenServer NIC bonds are represented by additional PIFs. The bond PIF can then be connected to a XenServer network to allow VM traffic and host management functions to occur over the bonded NIC. The exact steps to use to create a NIC bond depend on the number of NICs in your host, and whether the management interface of the host is assigned to a PIF to be used in the bond. Also see the section called Creating NIC bonds in resource pools for details on creating NIC bonds with resource pools. Creating a NIC bond on a dual-NIC host Creating a bond on a dual-NIC host implies that the PIF/NIC currently in use as the management interface for the host will be subsumed by the bond. The additional steps required to move the management interface to the bond PIF are included. To create a NIC bond a dual-NIC host 1. Use XenCenter or the vm-shutdown command to shut down all VMs on the host, thereby forcing all VIFs to be unplugged from their current networks. The existing VIFs will be invalid after the bond is enabled.

2. xe vm-shutdown uuid=<VM UUID>

3.

Use the network-create command to create a new network for use with the bonded NIC. The UUID of the new network is returned:

4. xe network-create name-label=bond0

5.

Use the pif-list command to determine the UUIDs of the PIFs to use in the bond:

6. xe pif-list 7.

8.

Use the bond-create command to create the bond by specifying the newly created network UUID and the UUIDs of the PIFs to be bonded separated by commas. The UUID for the bond is returned:

9. xe bond-create network-uuid=<network UUID> pif-uuids=<PIF UUID 1>,<PIF UUID 2>

Note

See the section called Controlling the MAC address of the bond for details on controlling the MAC address used for the bond PIF. 10. Use the pif-list command to determine the UUID of the new bond PIF:

11.

xe pif-list device=bond0

12. Use the pif-reconfigure-ip command to configure the desired management interface IP address settings for the bond PIF. See Command line interface for more detail on the options available for the pifreconfigure-ip command.

13.

xe pif-reconfigure-ip uuid=<bond PIF UUID> mode=DHCP

14. Use the host-management-reconfigure command to move the management interface from the existing physical PIF to the bond PIF. This step will activate the bond:

15.

xe host-management-reconfigure pif-uuid=<bond PIF UUID>

16. Use the pif-reconfigure-ip command to remove the IP address configuration from the non-bonded PIF previously used for the management interface. This step is not strictly necessary but might help reduce confusion when reviewing the host networking configuration.

17.

xe pif-reconfigure-ip uuid=<old mgmt PIF UUID> mode=None

18. Move existing VMs to the bond network using the vif-destroy and vif-create commands. This step can also be completed via XenCenter by editing the VM configuration and connecting the existing VIFs of a VM to the bond network. 19. Restart the VMs shut down in step 1. Controlling the MAC address of the bond Creating a bond on a dual-NIC host implies that the PIF/NIC currently in use as the management interface for the host will be subsumed by the bond. If DHCP is used to supply IP addresses to the host in most cases the MAC address of the bond should be the same as the PIF/NIC currently in use, allowing the IP address of the host received from DHCP to remain unchanged. The MAC address of the bond can be changed from PIF/NIC currently in use for the management interface, but doing so will cause existing network sessions to the host to be dropped when the bond is enabled and the MAC/IP address in use changes. The MAC address to be used for a bond can be controlled in two ways:

an optional mac parameter can be specified in the bond-create command. Using this parameter, the the bond MAC address can be set to any arbitrary address. If the mac parameter is not specified, the MAC address of the first PIF listed in the pif-uuids parameter is used for the bond.

Reverting NIC bonds If reverting a XenServer Host to a non-bonded configuration, be aware of the following requirements:

As when creating a bond, all VMs with VIFs on the bond must be shut down prior to destroying the bond. After reverting to a non-bonded configuration, reconnect the VIFs to an appropriate network. Move the management interface to another PIF using the pif-ip-reconfigure and hostmanagement-reconfigure commands prior to issuing the bond-destroy command, otherwise connections to the host (including XenCenter) will be dropped.

Controlling Quality of Service (QoS)


Enterprise Edition allows an optional Quality of Service (QoS) value to be set on VM virtual network interfaces (VIFs) using the CLI. The only QoS algorithm type supported in this release is rate limiting, specified as a maximum transfer rate for the VIF in Kb/s. For example, to limit a VIF to a maximum transfer rate of 100kb/s, use the vif-param-set command:

xe vif-param-set uuid=<VIF UUID> qos_algorithm_type=ratelimit xe vif-param-set uuid=<VIF UUID> qos_algorithm_params:kbps=100

Dedicating a NIC to storage traffic


XenServer Hosts automatically manage NICs as needed based on the related network, VIF, PIF, and bond configuration. In the default XenServer networking configuration, all network traffic to IP-based storage devices occurs over the PIF used for the management interface. To dedicate a NIC to storage traffic, it must be configured as unmanaged, and the NIC can no longer be used for XenServer networks. To dedicate a NIC to storage traffic 1. 2. 3. 4. Use the pif-list command to determine which PIF corresponds to the NIC to be dedicated to storage traffic. Use the pif-forget command to mark the NIC as unmanaged. The NIC will remain unmanaged across host restarts. Perform any required IP address configuration and enable the NIC using standard Linux commands. Once storage resources are available via the NIC, create the appropriate storage repositories.

To change an unmanaged NIC to managed, use the pif-introduce command.

Note
Use of the pif-scan command will reset all NICs on the host to managed.

Changing networking configuration options


Hostname

The system host-name is defined in the pool-wide database and modified using the xe host-set-hostnamelive CLI command as follows:

xe host-set-hostname-live uuid=<host-uuid> host-name=example


The underlying control domain hostname will also change dynamically to reflect the new hostname. DNS servers To add or remove DNS servers in the IP addressing configuration of a XenServer Host, use the pif-reconfigureip command. For example, for a PIF with a static IP:

pif-reconfigure-ip uuid=<PIF UUID> mode=static DNS=<new DNS IP>

XenServer Host IP address configuration Network interface configuration can be manipulated via the xe command-line interface (CLI). Unlike earlier XenServer versions, the underlying network configuration scripts should not be modified directly without using the CLI. To modify the IP address configuration of a PIF, use the pif-reconfigure-ip CLI command. See the section called pifreconfigure-ip for details on the parameters of the pif-reconfigure-ip command.

Note
See the section called Changing XenServer Host IP address configuration in resource pools for details on changing host IP addresses in resource pools. Management interface When XenServer is installed on a host with multiple NICs, one NIC is selected for use as the management interface. The management interface is used for XenCenter connections to the host and for host-to-host communication. To change the NIC used for the management interface 1. Use the pif-list command to determine which PIF corresponds to the NIC desired for use as the management interface. The UUID of each PIF will be returned.

2. xe pif-list

3.

Use the pif-param-list command to verify the IP addressing configuration for the PIF that will be used for the management interface. If necessary, use the pif-reconfigure-ip command to configure IP addressing for the PIF to be used. See Command line interface for more detail on the options available for the pif-reconfigure-ip command.

4. xe pif-param-list uuid=<PIF UUID>

5.

Use the host-management-reconfigure CLI command to change the PIF used for the management interface:

6. xe host-management-reconfigure pif-uuid=<PIF UUID>

Disabling management access To disable remote access to the management console entirely, use the host-management-disable CLI command. But be careful! Once the management interface is disabled, you will have to log in on the physical host console to perform management tasks and external interfaces such as XenCenter will no longer work.

Managing networking configuration for XenServer pools


Networks in resource pools
All XenServer Hosts in a resource pool should have the same number of physical network interface cards (NICs), although this requirement is not strictly enforced when a XenServer Host is joined to a pool. Having the same physical networking configuration for XenServer Hosts within a pool is important because all hosts in a pool share a common set of XenServer networks. PIFs on the individual hosts are connected to pool-wide networks based on device name. For example, all XenServer Hosts in a pool with an eth0 NIC will have a corresponding PIF plugged into the pool-wide "Network 0" network. The same will be true for hosts with eth1 NICs and "Network 1", as well as other NICs present in at least one XenServer Host in the pool. If one XenServer Host has a different number of NICs than other hosts in the pool, complications can arise because not all pool networks will be valid for all pool hosts. For example, if hosts A and B are in the same pool and host A has four NICs while host B only has two, only the networks connected to PIFs corresponding to eth0 and eth1 will be valid on host B. VMs on host A with VIFs connected to networks corresponding to eth2 and eth3 will not be able to migrate to host B. All NICs of all XenServer Hosts within a resource pool must be configured with the same MTU size.

Creating NIC bonds in resource pools


Whenever possible, create NIC bonds as part of initial resource pool creation prior to joining additional member servers to the pool or creating VMs. Doing so allows the bond configuration to be automatically replicated to member servers as they are joined to the pool and reduces the number of steps required. Adding a NIC bond to an existing pool is also a disruptive operation - all VMs in the pool must be shut down. Adding NIC bonds to new resource pools 1. 2. Install the master host and use XenCenter to create the pool. Create the NIC bond on the master as follows: 1. Use the network-create command to create a new pool-wide network for use with the bonded NICs. The UUID of the new network is returned.

2. xe network-create name-label=<network name>

3. Use the host-list command to find the UUID of the master host:

4. xe host-list

5. Use the pif-list command to determine the UUIDs of the PIFs to use in the bond:

6. 7. xe pif-list

8. Use the bond-create command to create the bond, specifying the network UUID created in step 1 and the UUIDs of the PIFs to be bonded, separated by commas. The UUID for the bond is returned:

9. 10.

xe bond-create network-uuid=<network UUID> pif-uuids=<PIF UUID 1>,<PIF UUID 2>

Note
See the section called Controlling the MAC address of the bond for details on controlling the MAC address used for the bond PIF. 11. Use the pif-list command to determine the UUID of the new bond PIF:

12. 13.

xe pif-list device=<network UUID>

14. Use the pif-reconfigure-ip command to configure the desired management interface IP address settings for the bond PIF. See Command line interface for more detail on the options available for the pif-reconfigure-ip command.

15. 16.

xe pif-reconfigure-ip uuid=<bond PIF UUID> mode=DHCP

17. Use the host-management-reconfigure command to move the management interface from the existing physical PIF to the bond PIF. This step will activate the bond:

18. 19.

xe host-management-reconfigure pif-uuid=<bond PIF UUID>

20. Use the pif-reconfigure-ip command to remove the IP address configuration from the nonbonded PIF previously used for the management interface. This step is not strictly necessary but might help reduce confusion when reviewing the host networking configuration.

21. 22.

xe pif-reconfigure-ip uuid=<old mgmt PIF UUID> mode=None

3. 4.

Join a member server to the pool.The network and bond information will be automatically replicated to the member server. Move the management interface on the member server to enable the bond as follows: 1. Use the host-list command to find the UUID of the member host being configured:

2. xe host-list

3. Use the pif-list command to determine the UUID of bond PIF on the new member host. Include the host-uuid parameter to list only the PIFs on the host being configured:

4. xe pif-list device=<network name> host-uuid=<host UUID>

5. Use the pif-reconfigure-ip command to configure the desired management interface IP address settings for the bond PIF with the pif-reconfigure-ip command. See Command line interface for more detail on the options available for the pif-reconfigure-ip command. This command must be run directly on the member server to be affected:

6. xe pif-reconfigure-ip uuid=<bond PIF UUID> mode=DHCP

7. Use the host-management-reconfigure command to move the management interface from the existing physical PIF to the bond PIF. This step will activate the bond. This command must be run directly on the member server to be affected:

8. xe host-management-reconfigure pif-uuid=<bond PIF UUID>

9. Use the pif-reconfigure-ip command to remove the IP address configuration from the nonbonded PIF previously used for the management interface. This step is not strictly necessary but may help reduce confusion when reviewing the host networking configuration. This command must be run directly on the member server to be affected:

10.

xe pif-reconfigure-ip uuid=<old mgmt PIF UUID> mode=None

5.

For each member server, join it to the pool and repeat 3 and 4 to move the management interface on the member server to enable the bond.

Adding NIC bonds to an existing pool When adding a NIC bond to an existing pool, the bond must be manually created on each host in the pool. The steps below can be used to add NIC bonds on both the pool master and member servers with the following requirements: 1. 2. 3. All VMs in the pool must be shut down Add the bond to the pool master first, and then to member hosts. The bond-create, host-management-reconfigure and host-management-disable commands affect the host on which they are run and so are not suitable for use on one host in a pool to change the configuration of another. Run these commands directly on the console of the host to be affected.

To add NIC bonds to existing pool master and member hosts 1. Use the network-create command to create a new pool-wide network for use with the bonded NICs. This step should only be performed once per pool. The UUID of the new network is returned.

2. xe network-create name-label=bond0

3.

Use XenCenter or the vm-shutdown command to shut down all VMs in the host pool to force all existing VIFs to be unplugged from their current networks. The existing VIFs will be invalid after the bond is enabled.

4. xe vm-shutdown uuid=<VM UUID>

5.

Use the host-list command to find the UUID of the host being configured:

6. xe host-list

7.

Use the pif-list command to determine the UUIDs of the PIFs to use in the bond. Include the hostuuid parameter to list only the PIFs on the host being configured:

8. xe pif-list host-uuid=<host UUID>

9.

Use the bond-create command to create the bond, specifying the network UUID created in step 1 and the UUIDs of the PIFs to be bonded, separated by commas. The UUID for the bond is returned.

10.

xe bond-create network-uuid=<network UUID> pif-uuids=<PIF UUID 1>,<PIF UUID 2>

Note
See the section called Controlling the MAC address of the bond for details on controlling the MAC address used for the bond PIF. 11. Use the pif-list command to determine the UUID of the new bond PIF. Include the host-uuid parameter to list only the PIFs on the host being configured:

12.

xe pif-list device=bond0 host-uuid=<host UUID>

13. Use the pif-reconfigure-ip command to configure the desired management interface IP address settings for the bond PIF. See Command line interface for more detail on the options available for the pif-reconfigure-ip command. This command must be run directly on the server to be affected:

14.

xe pif-reconfigure-ip uuid=<bond PIF UUID> mode=DHCP

15. Use the host-management-reconfigure command to move the management interface from the existing physical PIF to the bond PIF. This step will activate the bond. This command must be run directly on the member server to be affected:

16.

xe host-management-reconfigure pif-uuid=<bond PIF UUID>

17. Use the pif-reconfigure-ip command to remove the IP address configuration from the nonbonded PIF previously used for the management interface. This step is not strictly necessary, but might help reduce confusion when reviewing the host networking configuration. This command must be run directly on the member server to be affected:

18.

xe pif-reconfigure-ip uuid=<old mgmt PIF UUID> mode=None

19. Move existing VMs to the bond network using the vif-destroy and vif-create commands. This step can also be completed via XenCenter by editing the VM configuration and connecting the existing VIFs of the VM to the bond network. 20. Repeat steps 3 - 10 for member servers. 21. Restart the VMs previously shut down.

Changing XenServer Host IP address configuration in resource pools


XenServer Hosts in resource pools have a single management IP address used for management and communication to and from other hosts in the pool. The steps required to change the IP address of a host's management interface are different for master and member hosts. To change the IP address of a pool member host: 1. Use the pif-reconfigure-ip CLI command to set the IP address as desired. See Command line interface for details on the parameters of the pif-reconfigure-ip command:

2. xe pif-reconfigure-ip uuid=<PIF UUID> mode=DHCP

3.

Use the host-list CLI command to confirm that the member host has successfully reconnected to the master host by checking that all the other XenServer Hosts in the pool are visible:

4. xe host-list

Changing the IP address of the master XenServer Host requires additional steps because each of the member hosts uses the master's advertised IP address for communication and will not know how to contact the master when its IP address changes. Whenever possible, use a dedicated IP address that is not likely to change for the lifetime of the pool for pool masters. To change the IP address of a pool master host 1. Use the pif-reconfigure-ip CLI command to set the IP address as desired. See Command line interface for details on the parameters of the pif-reconfigure-ip command:

2. xe pif-reconfigure-ip uuid=<PIF UUID> mode=DHCP

3. 4.

When the IP address of the pool master host is changed, all member hosts will enter into an emergency mode when they fail to contact the master host. On the master XenServer Host, use the pool-recover-slaves command to force the master to contact each of the member servers and inform them of the master's new IP address:

5. xe pool-recover-slaves

Refer to the the section called Master failures for more information on emergency mode.

NIC/PIF ordering
It is possible for physical NIC devices to be discovered in different orders on different servers even though the servers contain the same hardware. Verifying NIC ordering is recommended before using the pooling features of XenServer. Verifying NIC ordering The pif-list command can be used to verify that NIC ordering is consistent across your XenServer Hosts. Review the MAC address and carrier (link state) parameters associated with each PIF to verify that the devices discovered (eth0, eth1, etc.) correspond to the appropriate physical port on the server.

xe pif-list params=uuid,device,MAC,currently-attached,carrier,management, \ IP-configuration-mode uuid ( RO) device MAC currently-attached management IP-configuration-mode carrier ( ( ( ( ( ( : RO): RO): RO): RO): RO): RO): 1ef8209d-5db5-cf69-3fe6-0e8d24f8f518 eth0 00:19:bb:2d:7e:8a true true DHCP true

uuid ( RO) device MAC currently-attached management IP-configuration-mode carrier ( ( ( ( ( (

: RO): RO): RO): RO): RO): RO):

829fd476-2bbb-67bb-139f-d607c09e9110 eth1 00:19:bb:2d:7e:7a false false None true

If the hosts have already been joined in a pool, add the host-uuid parameter to the pif-list command to scope the results to the PIFs on a given host. Re-ordering NICs

It is not possible to directly rename a PIF, although you can use the pif-forget and pif-introduce commands to achieve the same effect with the following restrictions:

The XenServer Host must be standalone and not joined to a resource pool. Re-ordering a PIF configured as the host's management interface requires additional steps which are included in the example below. Because the management interface must first be disabled the commands must be entered directly on the host console.

For the example configuration shown above use the following steps to change the NIC ordering so that eth0 corresponds to the device with a MAC address of 00:19:bb:2d:7e:7a: 1. Use XenCenter or the vm-shutdown command to shut down all VMs in the pool to force existing VIFs to be unplugged from their networks.

2. xe vm-shutdown uuid=<VM UUID>

3.

Use the host-management-disable command to disable the management interface:

4. xe host-management-disable

5.

Use the pif-forget command to remove the two incorrect PIF records:

6. xe pif-forget uuid=1ef8209d-5db5-cf69-3fe6-0e8d24f8f518 7. xe pif-forget uuid=829fd476-2bbb-67bb-139f-d607c09e9110

8.

Use the pif-introduce command to re-introduce the devices with the desired naming:

9. xe pif-introduce device=eth0 host-uuid=<host UUID> mac=00:19:bb:2d:7e:7a 10. xe pif-introduce device=eth1 host-uuid=<host UUID> mac=00:19:bb:2d:7e:8a

11. Use the pif-list command again to verify the new configuration:

12.

xe pif-list params=uuid,device,MAC

13. Use the pif-reconfigure-ip command to reset the management interface IP addressing configuration. See Command line interface for details on the parameters of the pif-reconfigure-ip command.

14.

xe pif-reconfigure-ip uuid=728d9e7f-62ed-a477-2c713974d75972eb mode=dhcp

15. Use the host-management-reconfigure command to set the management interface to the desired PIF and re-enable external management connectivity to the host:

16.

xe host-management-reconfigure pif-uuid=728d9e7f-62ed-a4772c71-3974d75972eb

Networking Troubleshooting
If you are having problems with configuring networking, first ensure that you have not directly modified any of the control domain ifcfg-* files directly. These files are directly managed by the control domain host agent, and changes will be overwritten.

Diagnosing network corruption


Some models of network cards require firmware upgrades from the vendor to work reliably under load, or when certain optimizations are turned on. If you are seeing corrupted traffic to VMs, then you should first try to obtain the latest recommended firmware from your vendor and apply a BIOS update. If the problem still persists, then you can use the CLI to disable receive/transmit offload optimizations on the physical interface. Be aware that this can result in a performance loss and/or increased CPU usage. First, determine the UUID of the physical interface. You can filter on the device field as follows:

$ xe pif-list device=eth0
Next, set the following parameter on the PIF to disable TX offload:

$ xe pif-param-set uuid=<pif-uuid> other_config:ethtool-tx=off


Finally, re-plug the PIF or reboot the host for the change to take effect.

Recovering from a bad network configuration


In some cases it is possible to render networking unusable by creating an incorrect configuration. This is particularly true when attempting to make network configuration changes on a member XenServer Host. If a loss of networking occurs, the following notes may be useful in recovering and regaining network connectivity:

It is recommended that you ensure networking configuration is set up correctly before creating a resource pool, as it is usually easier to recover from a bad configuration in a non-pooled state. The host-management-reconfigure and host-management-disable commands affect the XenServer Host on which they are run and so are not suitable for use on one host in a pool to change the configuration of another. Run these commands directly on the console of the XenServer Host to be affected, or use the xe -s, -u, and -pw remote connection options.

When the xapi service starts, it will apply configuration to the management interface first. The name of the management interface is saved in the /etc/xensource-inventory file. In extreme cases, you can stop the xapi service by running service xapi stop at the console, edit the inventory file to set the management interface to a safe default, and then ensure that the ifcfg files in /etc/sysconfig/network-scripts have correct configurations for a minimal network configuration (including one interface and one bridge; for example, eth0 on the xenbr0 bridge).

You might also like