1

Playing around with xen 4.0.1, trying to setup a simple domU.

When I put the parameter in vif like :

vif = [ 'ip=192.168.1.41,mac=00:16:3E:2F:F4:78,bridge=xenbr0,vifname=domu1' ]

It fails

error: Device 0 (vif) could not be connected. 
ip link set vif5.0 name domu1 failed

Also, running the command from dom0:

ip link set vif5.0 name domu1

returns

RTNETLINK answers: Device or resource busy

Any idea ?

4 Answers 4

1

From what I can tell the vifname= command isn't properly supported in many versions of Xen.

My guess is that you can only rename the device before certain usage and the Xen vif scripts are doing it too late.

Looking at the source in vif-common.sh:

vifname=$(xenstore_read_default "$XENBUS_PATH/vifname" "")
if [ "$vifname" ]
then
  if [ "$command" == "online" ] && ! ip link show "$vifname" >&/dev/null
  then
    do_or_die ip link set "$vif" name "$vifname"
  fi
  vif="$vifname"
fi

I don't see any obvious bugs. You should look at your vif-common.sh and confirm that it is the same as this.

Edit: I think maybe the vifX.Y interface may not be up at this point. Try commenting out the do_or_die line. That should set vif="$vifname" and if the device is then created later there is no reason to rename it.

1
  • Yes, the same; it's the 'ip link set vif5.0 name domu1' which fails. Any guess on a 'bug' of ip command ?
    – Disco
    Jan 25, 2011 at 14:52
1

Your link vif5.0 is used...

This solution function very well. Every time I suggest you do not use it on a production server ...

*** scripts/vif-common.sh.old   2012-03-28 16:00:50.555630500 +0200
--- scripts/vif-common.sh       2012-03-28 15:59:58.775633091 +0200
***************
*** 70,88 ****
--- 70,90 ----
      # Check presence of compulsory args.
      XENBUS_PATH="${XENBUS_PATH:?}"
      dev="${dev:?}"

      vifname=$(xenstore_read_default "$XENBUS_PATH/vifname" "")
      if [ "$vifname" ]
      then
          if [ "$command" == "online" ] && ! ip link show "$vifname" >&/dev/null
          then
+             ip link set "$dev" down
              do_or_die ip link set "$dev" name "$vifname"
+             ip link set "$vifname" up
          fi
          dev="$vifname"
      fi
  elif [ "$type_if" = tap ]; then
      # Check presence of compulsory args.
      : ${INTERFACE:?}

      # Get xenbus_path from device name.
      # The name is built like that: "tap${domid}.${devid}".
1

Here's one reason why this problem occurs:

ps auxw | grep -v grep | grep NetworkManager && service network-manager stop

xm create ... and good luck!

Solutions 1, 2 or 3:

  1. dpkg - purge network-manager
  2. service network-manager stop
  3. man NetworkManager.conf and search 'unmanaged-devices ...

Explanation: http://bugs.launchpad.net/bugs/191889

1
  • Works on ubuntu 16.04, xen v4.8.0.
    – Hassan
    Mar 25, 2018 at 19:26
1

Solution 3 implemented:

Update NetworkManager.conf with:

[main]
plugins=keyfile

[keyfile]
unmanaged-devices=interface-name:vif*

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .