Hacking Xenserver

June 13, 2009

Attaching Management Network to a virtual NIC

Filed under: Unsupported configurations — foscarini @ 6:49 pm
Tags: ,

Citrix doesn’t support the use of management interface via VLAN, as said in the XenServer documentation. Despite of the lack of official support, this configuration is possible and can be arranged via XenServer management tools. The procedures described in this howto can be performed in standalone XenServers and was tested with versions 5.0U3 e 5.5Beta.

  • Create the virtual NIC via XenCenter following these steps:
    1. In Network tab, click “Add Network”
    2. Keep selected “External Network” and click “Next”
    3. Type a name and a optional description
    4. Select the NIC which is connected to the trunk interface and type the VLAN ID

    The Network tab should look like the following image. In this example “management-vlan” will be the interface used for the Management Network. I’m assuming that the network level configuration was done previously.

configured management-vlan virtual NIC

configured management-vlan virtual NIC

  • Tell to XenServer which interface use for the Management Network
    1. Access the server via console (real console, not Console tab in XenCenter)
    2. Select “Network and Management Interface”
    3. Select “Configure Management Interface” and type the administrator password as required
    4. The screen will show a list of the available real and virtual NICs. Select the “eth1: Virtual PIF with management-vlan (connected)”
    5. Configure the IP to be used, either static or DHCP
    6. Apply the configuration and tell to “Copy Hostname to XenCenter Name”
list of network interfaces

List of available network interfaces

Between steps 5 and 6 the XenServer host may be inaccessible via network, specifically if the new and old management interfaces are in the same ethernet addressing. In such case you need to access the Linux Console by typing “Alt + F3” in the XenServer real console. Once authenticated, you should run the following commands:

  1. [root@xenserver ~]# route -n
    Kernel IP routing table
    Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
    192.168.0.0     0.0.0.0         255.255.255.0   U     0      0        0 xapi1
    192.168.0.0     0.0.0.0         255.255.255.0   U     0      0        0 xenbr0
    169.254.0.0     0.0.0.0         255.255.0.0     U     0      0        0 xenbr0
    0.0.0.0         192.168.0.254   0.0.0.0         UG    0      0        0 xapi1

    verify which network is configured with the interface xenbr0 and run the following command to remove this route

  2. [root@xenserver ~]# route del -net 192.168.0.0 netmask 255.255.255.0 dev xenbr0

    After removing the route you can return to the XenServer console, typing “Alt + F1”

If you changed the IP address of the XenServer host, the XenCenter connection should be removed and a new one must be created with the new IP.

If the IP is the same, for a short period of time the connection will freeze, but will return as soon as the routers/switches propagate the new path to the XenServer host.

A workaround to use VLAN for the management network in a XenServer host that will be added to a XenServervers Pool will be discussed later.

Advertisements

Create a free website or blog at WordPress.com.