Skip to contentSkip to conversation

Xen 4.x / Linux 3.x (dom0 and HVM domU) and NIC handling

DISCUSSION Stefan Bader 5 participants 23 messages Dec 1, 2011 – Dec 6, 2011

lore
Share & tools
lore
#0 lore raw

Moving to public discussion...

This was found with Xen hypervisor version supporting device unplugging and the domU kernel having net-/blkfront and pci platform built-in (or as module).

The block device is defined as hda and the NIC type=ioemu (so theoretically guests without pv support would work, too).

Since both drivers are present, the kernel tries to unplug the emulated devices and succeeds. The blkfront driver detects the xvda device available in parallel and is working ok.

However the network interface does not work. There are entries present under sysfs for the xenbus but trying to bring it up fails with errors. And also there seems to be no mac address set (all zeros in sysfs).
When the type=ioemu is removed in the configuration, this works.

I have not much more debugging information beyond that, yet. But it sounds a bit like NICs should behave the same as block devices. So if there is an emulated device defined there will be an alternate paravirt interface for it and after unplugging the emulated ones we end up with the pv ones.
Is that something that can be seen with newer Xen versions, too (I am using 4.1.1)?

-Stefan

#1 lore raw
Quoted 8 lines · Stefan Bader

Moving to public discussion...

This was found with Xen hypervisor version supporting device unplugging and the domU kernel having net-/blkfront and pci platform built-in (or as module).

The block device is defined as hda and the NIC type=ioemu (so theoretically guests without pv support would work, too).

Quoted 8 lines

Since both drivers are present, the kernel tries to unplug the emulated devices and succeeds. The blkfront driver detects the xvda device available in parallel and is working ok.

However the network interface does not work. There are entries present under sysfs for the xenbus but trying to bring it up fails with errors. And also there seems to be no mac address set (all zeros in sysfs).
When the type=ioemu is removed in the configuration, this works.

Which toolstack are you using?

The weird thing is that, at least with xl, type=ioemu is the default for an HVM guest.

What vif related entries do you get in xenstore, both front and backend?

Also what does your qemu-dm command line end up looking like?

Quoted 4 lines

I have not much more debugging information beyond that, yet. But it sounds a bit like NICs should behave the same as block devices. So if there is an emulated device defined there will be an alternate paravirt interface for it and after unplugging the emulated ones we end up with the pv ones.

That is certainly the expectation.

Quoted 1 line

Is that something that can be seen with newer Xen versions, too (I am using 4.1.1)?

I appear to have some other problem with xen-unstable at the moment. I've never noticed a problem in that past, although I don't habitually use type=XXX at all in my vif configuration.

Ian.

Quoted 1 line

-Stefan

#2 lore raw
Quoted 13 lines · Ian Campbell
Quoted 12 lines · Stefan Bader

Moving to public discussion...

This was found with Xen hypervisor version supporting device unplugging and the domU kernel having net-/blkfront and pci platform built-in (or as module).

The block device is defined as hda and the NIC type=ioemu (so theoretically guests without pv support would work, too).

Since both drivers are present, the kernel tries to unplug the emulated devices and succeeds. The blkfront driver detects the xvda device available in parallel and is working ok.

Quoted 7 lines
Quoted 4 lines

However the network interface does not work. There are entries present under sysfs for the xenbus but trying to bring it up fails with errors. And also there seems to be no mac address set (all zeros in sysfs).
When the type=ioemu is removed in the configuration, this works.

Which toolstack are you using?

xm (xl with the same config seems to work)

Quoted 5 lines

The weird thing is that, at least with xl, type=ioemu is the default for an HVM guest.

What vif related entries do you get in xenstore, both front and backend?

output of xenstore-ls attached (hopefully contains all info)

Quoted 2 lines

Also what does your qemu-dm command line end up looking like?

also in the attached file.

Quoted 7 lines
Quoted 4 lines

I have not much more debugging information beyond that, yet. But it sounds a bit like NICs should behave the same as block devices. So if there is an emulated device defined there will be an alternate paravirt interface for it and after unplugging the emulated ones we end up with the pv ones.

That is certainly the expectation.

Quoted 11 lines
Quoted 1 line

Is that something that can be seen with newer Xen versions, too (I am using 4.1.1)?

I appear to have some other problem with xen-unstable at the moment. I've never noticed a problem in that past, although I don't habitually use type=XXX at all in my vif configuration.

Ian.

Quoted 1 line

-Stefan

 7784 ?        SLsl   0:13 qemu-dm -d 9 -domain-name PreciseHVM -vnc 0.0.0.0:0 -vncunused -k de -serial pty -videoram 8 -boot cd -acpi -vcpus 2 -vcpu_avail 0x3 -net nic,vlan=0,macaddr=00:16:3e:12:04:f0,model=rtl8139 -net tap,vlan=0,ifname=tap9.0,bridge=virbr0,script=no -M xenfv
 7895 hvc0     S+     0:00 grep --color=auto qemu-dm

tool = ""
xenstored = ""
local = ""
pool = ""
0 = ""
other_config = ""
description = "Pool-0"
uuid = "bebce16f-902f-68ce-d38b-a4d49e8346a7" name = "Pool-0"
domain = ""
0 = ""
vm = "/vm/00000000-0000-0000-0000-000000000000" device = ""
control = ""
platform-feature-multiprocessor-suspend = "1"
memory = ""

    target = "524288"
    static-max = "4294967292"
    freemem-slack = "5032880"
   guest = ""
   hvmpv = ""
   data = ""
   cpu = ""
    1 = ""
     availability = "online"
    3 = ""
     availability = "online"
    2 = ""
     availability = "online"
    7 = ""
     availability = "online"
    0 = ""
     availability = "online"
    5 = ""
     availability = "online"
    6 = ""
     availability = "online"
    4 = ""
     availability = "online"
   description = ""
   console = ""
    limit = "1048576"
    type = "xenconsoled"
   domid = "0"
   name = "Domain-0"
   backend = ""
    qdisk = ""
     9 = ""
      768 = ""
       frontend = "/local/domain/9/device/vbd/768"
       params = "aio:/root/instances/precise-server/hda-64.img"
       frontend-id = "9"
       online = "1"
       removable = "0"
       bootable = "1"
       state = "4"
       dev = "hda"
       type = "tap"
       mode = "w"
       feature-barrier = "1"
       info = "0"
       sector-size = "512"
       sectors = "16384000"
       hotplug-status = "connected"
      5632 = ""
       frontend = "/local/domain/9/device/vbd/5632"
       params = "aio:/root/isos/precise-server-amd64.iso"
       frontend-id = "9"
       online = "1"
       removable = "1"
       bootable = "1"
       state = "6"
       dev = "hdc"
       type = "tap"
       mode = "r"
       feature-barrier = "1"
       info = "4"
       sector-size = "512"
       sectors = "1337944"
       hotplug-status = "connected"
    console = ""
     2 = ""
     5 = ""
     9 = ""
      0 = ""
       frontend = "/local/domain/9/console"
       frontend-id = "9"
       online = "1"
       state = "1"
       domain = "PreciseHVM"
       protocol = "vt100"
    vif = ""
     9 = ""
      0 = ""
       frontend = "/local/domain/9/device/vif/0"
       frontend-id = "9"
       online = "1"
       state = "4"
       script = "/etc/xen/scripts/vif-bridge"
       mac = "00:16:3e:12:04:f0"
       bridge = "virbr0"
       handle = "0"
       feature-sg = "1"
       feature-gso-tcpv4 = "1"
       feature-rx-copy = "1"
       feature-rx-flip = "0"
       hotplug-status = "connected"
   device-model = ""
    9 = ""
     disable_pf = "0"
     state = "running"
  9 = ""
   vm = "/vm/5de1c61a-cee8-4c18-b294-409b9214f7be"
   name = "PreciseHVM"
   control = ""
    shutdown = ""
    platform-feature-multiprocessor-suspend = "1"
   device = ""
    suspend = ""
     event-channel = ""
    vbd = ""
     768 = ""
      backend = "/local/domain/0/backend/qdisk/9/768"
      backend-id = "0"
      state = "4"
      virtual-device = "768"
      device-type = "disk"
      ring-ref = "8"
      event-channel = "17"
      protocol = "x86_64-abi"
     5632 = ""
      backend = "/local/domain/0/backend/qdisk/9/5632"
      backend-id = "0"
      state = "6"
      virtual-device = "5632"
      device-type = "cdrom"
    vif = ""
     0 = ""
      backend = "/local/domain/0/backend/vif/9/0"
      backend-id = "0"
      state = "4"
      handle = "0"
      mac = "00:16:3e:12:04:f0"
      tx-ring-ref = "768"
      rx-ring-ref = "769"
      event-channel = "18"
      request-rx-copy = "1"
      feature-rx-notify = "1"
      feature-sg = "1"
      feature-gso-tcpv4 = "1"
   data = ""
   cpu = ""
    0 = ""
     availability = "online"
    1 = ""
     availability = "online"
   memory = ""
    static-max = "2097152"
    target = "2088960"
    videoram = "8192"
   error = ""
   drivers = ""
   attr = ""
   messages = ""
   domid = "9"
   store = ""
    port = "3"
    ring-ref = "1044476"
   console = ""
    backend = "/local/domain/0/backend/console/9/0"
    backend-id = "0"
    limit = "1048576"
    type = "xenconsoled"
    output = "pty"
    port = "4"
    ring-ref = "1044479"
    tty = "/dev/pts/0"
    vnc-port = "5900"
    vnc-listen = "0.0.0.0"
   image = ""
    device-model-pid = "6787"
   serial = ""
    0 = ""
     tty = "/dev/pts/1"

vm = ""
00000000-0000-0000-0000-000000000000 = ""
on_xend_stop = "ignore"
pool_name = "Pool-0"
shadow_memory = "0"
uuid = "00000000-0000-0000-0000-000000000000"
on_reboot = "restart"
image = "(linux (kernel '') (superpages 0) (nomigrate 0) (tsc_mode 0))"
ostype = "linux"
kernel = ""
cmdline = ""
ramdisk = ""
on_poweroff = "destroy"
bootloader_args = ""
on_xend_start = "ignore"
on_crash = "restart"
xend = ""
restart_count = "0"
vcpus = "8"
vcpu_avail = "255"
bootloader = ""
name = "Domain-0"
5de1c61a-cee8-4c18-b294-409b9214f7be = ""
uuid = "5de1c61a-cee8-4c18-b294-409b9214f7be"
name = "PreciseHVM"
pool_name = "Pool-0"
rtc = ""
timeoffset = ""
image = ""
ostype = "linux"
kernel = ""
cmdline = ""
ramdisk = ""
start_time = "1322760176.22"
vncpasswd = "\000"

8163 ? SLl 0:11 /usr/lib/xen-4.1/bin/qemu-dm -d 12 -domain-name PreciseHVM -videoram 4 -k de -vnc 0.0.0.0:0 -vncunused -vcpus 2 -vcpu_avail 0x3 -boot cd -serial pty -acpi -net nic,vlan=1,macaddr=00:16:3e:12:04:f0,model=rtl8139 -net tap,vlan=1,ifname=tap12.0,bridge=virbr0 -M xenfv

tool = ""
xenstored = ""
local = ""
pool = ""
0 = ""
other_config = ""
description = "Pool-0"
uuid = "bebce16f-902f-68ce-d38b-a4d49e8346a7" name = "Pool-0"
domain = ""
0 = ""
vm = "/vm/00000000-0000-0000-0000-000000000000" device = ""
control = ""
platform-feature-multiprocessor-suspend = "1"
memory = ""

    target = "524288"
    static-max = "4294967292"
    freemem-slack = "5032880"
   guest = ""
   hvmpv = ""
   data = ""
   cpu = ""
    1 = ""
     availability = "online"
    3 = ""
     availability = "online"
    2 = ""
     availability = "online"
    7 = ""
     availability = "online"
    0 = ""
     availability = "online"
    5 = ""
     availability = "online"
    6 = ""
     availability = "online"
    4 = ""
     availability = "online"
   description = ""
   console = ""
    limit = "1048576"
    type = "xenconsoled"
   domid = "0"
   name = "Domain-0"
   backend = ""
    qdisk = ""
    console = ""
     2 = ""
     5 = ""
     9 = ""
     11 = ""
     12 = ""
      0 = ""
       domain = "PreciseHVM"
       protocol = "vt100"
       uuid = "5b9a5e30-1a52-b46f-5b69-8d341b21e7cc"
       frontend = "/local/domain/12/device/console/0"
       state = "2"
       location = "4"
       online = "1"
       frontend-id = "12"
       hotplug-status = "connected"
    vif = ""
     12 = ""
      0 = ""
       bridge = "virbr0"
       domain = "PreciseHVM"
       handle = "0"
       uuid = "ed8c27a1-6d5e-5841-7acb-426e593ba657"
       script = "/etc/xen/scripts/vif-bridge"
       state = "6"
       frontend = "/local/domain/12/device/vif/0"
       mac = "00:16:3e:12:04:f0"
       online = "1"
       frontend-id = "12"
       type = "ioemu"
       feature-sg = "1"
       feature-gso-tcpv4 = "1"
       feature-rx-copy = "1"
       feature-rx-flip = "0"
    vfb = ""
     12 = ""
      0 = ""
       vncunused = "1"
       domain = "PreciseHVM"
       vnc = "1"
       uuid = "c4ebb60e-d22a-167f-3b7a-fc33773f84de"
       vnclisten = "0.0.0.0"
       vncdisplay = "0"
       frontend = "/local/domain/12/device/vfb/0"
       state = "1"
       keymap = "de"
       online = "1"
       frontend-id = "12"
       location = "0.0.0.0:5900"
    vbd = ""
     12 = ""
      768 = ""
       domain = "PreciseHVM"
       frontend = "/local/domain/12/device/vbd/768"
       uuid = "fe7353fa-2f9f-9943-10c7-739002365571"
       bootable = "1"
       dev = "hda"
       state = "4"
       params = "/root/instances/precise-server/hda-64.img"
       mode = "w"
       online = "1"
       frontend-id = "12"
       type = "file"
       node = "/dev/loop1"
       physical-device = "7:1"
       hotplug-status = "connected"
       feature-flush-cache = "1"
       sectors = "16384000"
       info = "0"
       sector-size = "512"
      5632 = ""
       domain = "PreciseHVM"
       frontend = "/local/domain/12/device/vbd/5632"
       uuid = "d3a1a643-65c4-6d31-41bc-786bb4d6cfea"
       bootable = "0"
       dev = "hdc"
       state = "6"
       params = "/root/isos/precise-server-amd64.iso"
       mode = "r"
       online = "1"
       frontend-id = "12"
       type = "file"
       node = "/dev/loop0"
       physical-device = "7:0"
       hotplug-status = "connected"
   device-model = ""
    12 = ""
     disable_pf = "0"
     state = "running"
  12 = ""
   vm = "/vm/ad0952d7-59aa-f185-a4e3-9ad3234e9871"
   device = ""
    vfb = ""
     0 = ""
      state = "1"
      backend-id = "0"
      backend = "/local/domain/0/backend/vfb/12/0"
    vbd = ""
     768 = ""
      backend-id = "0"
      virtual-device = "768"
      device-type = "disk"
      state = "4"
      backend = "/local/domain/0/backend/vbd/12/768"
      ring-ref = "8"
      event-channel = "17"
      protocol = "x86_64-abi"
     5632 = ""
      backend-id = "0"
      virtual-device = "5632"
      device-type = "cdrom"
      state = "6"
      backend = "/local/domain/0/backend/vbd/12/5632"
    vif = ""
     0 = ""
      state = "6"
      backend-id = "0"
      backend = "/local/domain/0/backend/vif/12/0"
    console = ""
     0 = ""
      state = "1"
      backend-id = "0"
      backend = "/local/domain/0/backend/console/12/0"
   control = ""
    platform-feature-multiprocessor-suspend = "1"
   error = ""
    device = ""
     vbd = ""
      5632 = ""
       error = "19 xenbus_dev_probe on device/vbd/5632"
     vif = ""
      0 = ""
       error = "2 parsing device/vif/0/mac"
   memory = ""
    target = "2097152"
   guest = ""
   hvmpv = ""
   data = ""
   device-misc = ""
    vif = ""
     nextDeviceID = "1"
    console = ""
     nextDeviceID = "1"
   image = ""
    device-model-fifo = "/var/run/xend/dm-12-1322761044.fifo"
    device-model-pid = "8163"
    suspend-cancel = "1"
   console = ""
    port = "4"
    limit = "1048576"
    type = "ioemu"
    tty = "/dev/pts/1"
    vnc-port = "5900"
    vnc-listen = "0.0.0.0"
   description = ""
   domid = "12"
   cpu = ""
    0 = ""
     availability = "online"
    1 = ""
     availability = "online"
   store = ""
    ring-ref = "1044476"
    port = "3"
   name = "PreciseHVM"
   serial = ""
    0 = ""
     tty = "/dev/pts/0"

vm = ""
00000000-0000-0000-0000-000000000000 = ""
on_xend_stop = "ignore"
pool_name = "Pool-0"
shadow_memory = "0"
uuid = "00000000-0000-0000-0000-000000000000"
on_reboot = "restart"
image = "(linux (kernel '') (superpages 0) (nomigrate 0) (tsc_mode 0))"
ostype = "linux"
kernel = ""
cmdline = ""
ramdisk = ""
on_poweroff = "destroy"
bootloader_args = ""
on_xend_start = "ignore"
on_crash = "restart"
xend = ""
restart_count = "0"
vcpus = "8"
vcpu_avail = "255"
bootloader = ""
name = "Domain-0"
ad0952d7-59aa-f185-a4e3-9ad3234e9871 = ""
image = "(hvm (kernel '') (superpages 0) (videoram 4) (hpet 0) (stdvga 0) \..."
ostype = "hvm"
kernel = ""
cmdline = ""
ramdisk = ""
dmargs = "-domain-name PreciseHVM -videoram 4 -k de -vnc 0.0.0.0:0 -vncun\..." device-model = "/usr/lib/xen-4.1/bin/qemu-dm"
display = ""
rtc = ""
timeoffset = "0"
device = ""
vfb = ""

    0 = ""
     frontend = "/local/domain/12/device/vfb/0"
     frontend-id = "12"
     backend-id = "0"
     backend = "/local/domain/0/backend/vfb/12/0"
   vbd = ""
    768 = ""
     frontend = "/local/domain/12/device/vbd/768"
     frontend-id = "12"
     backend-id = "0"
     backend = "/local/domain/0/backend/vbd/12/768"
    5632 = ""
     frontend = "/local/domain/12/device/vbd/5632"
     frontend-id = "12"
     backend-id = "0"
     backend = "/local/domain/0/backend/vbd/12/5632"
   vif = ""
    0 = ""
     frontend = "/local/domain/12/device/vif/0"
     frontend-id = "12"
     backend-id = "0"
     backend = "/local/domain/0/backend/vif/12/0"
   console = ""
    0 = ""
     frontend = "/local/domain/12/device/console/0"
     frontend-id = "12"
     backend-id = "0"
     backend = "/local/domain/0/backend/console/12/0"

on_xend_stop = "ignore"
pool_name = "Pool-0"
shadow_memory = "18"
uuid = "ad0952d7-59aa-f185-a4e3-9ad3234e9871"
on_reboot = "restart"
start_time = "1322761044.48"
on_poweroff = "destroy"
bootloader_args = ""
on_xend_start = "ignore"
on_crash = "restart"
xend = ""
restart_count = "0"
vcpus = "2"
vcpu_avail = "3"
bootloader = ""
name = "PreciseHVM"

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

#3 lore raw
Quoted 14 lines · Stefan Bader
Quoted 13 lines · Ian Campbell
Quoted 12 lines · Stefan Bader

Moving to public discussion...

This was found with Xen hypervisor version supporting device unplugging and the domU kernel having net-/blkfront and pci platform built-in (or as module).

The block device is defined as hda and the NIC type=ioemu (so theoretically guests without pv support would work, too).

Since both drivers are present, the kernel tries to unplug the emulated devices and succeeds. The blkfront driver detects the xvda device available in parallel and is working ok.

Quoted 8 lines
Quoted 7 lines
Quoted 4 lines

However the network interface does not work. There are entries present under sysfs for the xenbus but trying to bring it up fails with errors. And also there seems to be no mac address set (all zeros in sysfs).
When the type=ioemu is removed in the configuration, this works.

Which toolstack are you using?

xm (xl with the same config seems to work)

That's good. xm is deprecated and this seems to be a known issue with xend. There is a workaround which is to not specify type=.

Quoted 7 lines
Quoted 6 lines

The weird thing is that, at least with xl, type=ioemu is the default for an HVM guest.

What vif related entries do you get in xenstore, both front and backend?

output of xenstore-ls attached (hopefully contains all info)

FWIW the xend frontend dir looks more empty than I would have expected. However given the above I don't think we want to spend time figuring out why.

Ian.

Quoted 24 lines
Quoted 3 lines

Also what does your qemu-dm command line end up looking like?

also in the attached file.

Quoted 18 lines
Quoted 4 lines

I have not much more debugging information beyond that, yet. But it sounds a bit like NICs should behave the same as block devices. So if there is an emulated device defined there will be an alternate paravirt interface for it and after unplugging the emulated ones we end up with the pv ones.

That is certainly the expectation.

Quoted 1 line

Is that something that can be seen with newer Xen versions, too (I am using 4.1.1)?

I appear to have some other problem with xen-unstable at the moment. I've never noticed a problem in that past, although I don't habitually use type=XXX at all in my vif configuration.

Ian.

Quoted 1 line

-Stefan

#4 lore raw
In reply to Stefan Bader
Quoted 17 lines · Stefan Bader

Moving to public discussion...

This was found with Xen hypervisor version supporting device unplugging and the domU kernel having net-/blkfront and pci platform built-in (or as module).

The block device is defined as hda and the NIC type=ioemu (so theoretically guests without pv support would work, too).

Since both drivers are present, the kernel tries to unplug the emulated devices and succeeds. The blkfront driver detects the xvda device available in parallel and is working ok.

However the network interface does not work. There are entries present under sysfs for the xenbus but trying to bring it up fails with errors. And also there seems to be no mac address set (all zeros in sysfs).
When the type=ioemu is removed in the configuration, this works.

Quoted 6 lines

I have not much more debugging information beyond that, yet. But it sounds a bit like NICs should behave the same as block devices. So if there is an emulated device defined there will be an alternate paravirt interface for it and after unplugging the emulated ones we end up with the pv ones.
Is that something that can be seen with newer Xen versions, too (I am using 4.1.1)?

Hey,

Have you seen?:
http://wiki.xen.org/xenwiki/XenLinuxPVonHVMdrivers

Especially the following note:
"NOTE! If you have "type=ioemu" specified for the "vif"-line, PVHVM drivers WILL NOT work! Don't specify "type" parameter for the vif. (with type=ioemu the pvhvm nic in the VM will have mac address full of zeroes - and thus won't work!)."

"type=ioemu" is not needed, at least with xm/xend toolstack both HVM and PVHVM guests work OK without it.

-- Pasi

#5 lore raw
Quoted 25 lines · Pasi Kärkkäinen
Quoted 17 lines · Stefan Bader

Moving to public discussion...

This was found with Xen hypervisor version supporting device unplugging and the domU kernel having net-/blkfront and pci platform built-in (or as module).

The block device is defined as hda and the NIC type=ioemu (so theoretically guests without pv support would work, too).

Since both drivers are present, the kernel tries to unplug the emulated devices and succeeds. The blkfront driver detects the xvda device available in parallel and is working ok.

However the network interface does not work. There are entries present under sysfs for the xenbus but trying to bring it up fails with errors. And also there seems to be no mac address set (all zeros in sysfs).
When the type=ioemu is removed in the configuration, this works.

Quoted 6 lines

I have not much more debugging information beyond that, yet. But it sounds a bit like NICs should behave the same as block devices. So if there is an emulated device defined there will be an alternate paravirt interface for it and after unplugging the emulated ones we end up with the pv ones.
Is that something that can be seen with newer Xen versions, too (I am using 4.1.1)?

Quoted 4 lines

Hey,

Have you seen?:
http://wiki.xen.org/xenwiki/XenLinuxPVonHVMdrivers

I was about to say "Please use the new wiki URLs where possible" but the section you refer to seems to be missing in the new wiki!

http://wiki.xen.org/wiki/XenLinuxPVonHVMdrivers

It is there in
http://wiki.xen.org/old-wiki-converted/XenLinuxPVonHVMdrivers.txt but not in the first revision in the new wiki. Lars, do you know what happened here?

Quoted 8 lines

Especially the following note:
"NOTE! If you have "type=ioemu" specified for the "vif"-line, PVHVM drivers WILL NOT work! Don't specify "type" parameter for the vif. (with type=ioemu the pvhvm nic in the VM will have mac address full of zeroes - and thus won't work!)."

"type=ioemu" is not needed, at least with xm/xend toolstack both HVM and PVHVM guests work OK without it.

-- Pasi

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

#6 lore raw
In reply to Pasi Kärkkäinen
Quoted 30 lines · Pasi Kärkkäinen
Quoted 17 lines · Stefan Bader

Moving to public discussion...

This was found with Xen hypervisor version supporting device unplugging and the domU kernel having net-/blkfront and pci platform built-in (or as module).

The block device is defined as hda and the NIC type=ioemu (so theoretically guests without pv support would work, too).

Since both drivers are present, the kernel tries to unplug the emulated devices and succeeds. The blkfront driver detects the xvda device available in parallel and is working ok.

However the network interface does not work. There are entries present under sysfs for the xenbus but trying to bring it up fails with errors. And also there seems to be no mac address set (all zeros in sysfs).
When the type=ioemu is removed in the configuration, this works.

Quoted 6 lines

I have not much more debugging information beyond that, yet. But it sounds a bit like NICs should behave the same as block devices. So if there is an emulated device defined there will be an alternate paravirt interface for it and after unplugging the emulated ones we end up with the pv ones.
Is that something that can be seen with newer Xen versions, too (I am using 4.1.1)?

Hey,

Have you seen?:
http://wiki.xen.org/xenwiki/XenLinuxPVonHVMdrivers

Quoted 7 lines

Especially the following note:
"NOTE! If you have "type=ioemu" specified for the "vif"-line, PVHVM drivers WILL NOT work! Don't specify "type" parameter for the vif. (with type=ioemu the pvhvm nic in the VM will have mac address full of zeroes - and thus won't work!)."

"type=ioemu" is not needed, at least with xm/xend toolstack both HVM and PVHVM guests work OK without it.

-- Pasi

Thanks Pasi,

hmm, so it is documented actually and thus sort of expected. Still it is confusing. For one driver it does not make a difference to use the form of an emulated device in the config, for the other it does. The xl stack works, the xm stack does not.
And then, ok this is probably a quite naive approach, it seemed to make sense to go through the pain of always having potentially both interfaces available (emulated and pv) so in theory the same guest config can accommodate a guest os supporting one or the other (or easily switch from one to the other). Otherwise I would expect an emulated device only when I have hd? in the config and a pv device when I write xvd?.

-Stefan

#7 lore raw
Quoted 40 lines · Stefan Bader
Quoted 30 lines · Pasi Kärkkäinen
Quoted 17 lines · Stefan Bader

Moving to public discussion...

This was found with Xen hypervisor version supporting device unplugging and the domU kernel having net-/blkfront and pci platform built-in (or as module).

The block device is defined as hda and the NIC type=ioemu (so theoretically guests without pv support would work, too).

Since both drivers are present, the kernel tries to unplug the emulated devices and succeeds. The blkfront driver detects the xvda device available in parallel and is working ok.

However the network interface does not work. There are entries present under sysfs for the xenbus but trying to bring it up fails with errors. And also there seems to be no mac address set (all zeros in sysfs).
When the type=ioemu is removed in the configuration, this works.

Quoted 6 lines

I have not much more debugging information beyond that, yet. But it sounds a bit like NICs should behave the same as block devices. So if there is an emulated device defined there will be an alternate paravirt interface for it and after unplugging the emulated ones we end up with the pv ones.
Is that something that can be seen with newer Xen versions, too (I am using 4.1.1)?

Hey,

Have you seen?:
http://wiki.xen.org/xenwiki/XenLinuxPVonHVMdrivers

Quoted 7 lines

Especially the following note:
"NOTE! If you have "type=ioemu" specified for the "vif"-line, PVHVM drivers WILL NOT work! Don't specify "type" parameter for the vif. (with type=ioemu the pvhvm nic in the VM will have mac address full of zeroes - and thus won't work!)."

"type=ioemu" is not needed, at least with xm/xend toolstack both HVM and PVHVM guests work OK without it.

-- Pasi

Thanks Pasi,

Quoted 11 lines

hmm, so it is documented actually and thus sort of expected. Still it is confusing. For one driver it does not make a difference to use the form of an emulated device in the config, for the other it does. The xl stack works, the xm stack does not.
And then, ok this is probably a quite naive approach, it seemed to make sense to go through the pain of always having potentially both interfaces available (emulated and pv) so in theory the same guest config can accommodate a guest os supporting one or the other (or easily switch from one to the other). Otherwise I would expect an emulated device only when I have hd? in the config and a pv device when I write xvd?.

This works for both HVM and PVHVM (also mentioned on the wiki page):
vif = [ 'mac=00:16:5e:02:07:45, bridge=xenbr0, model=e1000' ]

So there's no need for "type=ioemu" option with xm/xend.

You can switch between HVM and PVHVM with:
xen_platform_pci=0|1

-- Pasi

#8 lore raw
Quoted 9 lines · --On 2 December 2011 12:41:10 +0200 Pasi Kärkkäinen <[email protected]> wrote:
Quoted 8 lines

And then, ok this is probably a quite naive approach, it seemed to make sense to go through the pain of always having potentially both interfaces available (emulated and pv) so in theory the same guest config can accommodate a guest os supporting one or the other (or easily switch from one to the other). Otherwise I would expect an emulated device only when I have hd? in the config and a pv device when I write xvd?.

Quoted 7 lines

This works for both HVM and PVHVM (also mentioned on the wiki page):
vif = [ 'mac=00:16:5e:02:07:45, bridge=xenbr0, model=e1000' ]

So there's no need for "type=ioemu" option with xm/xend.

You can switch between HVM and PVHVM with:
xen_platform_pci=0|1

AFAIK changing xen_platform_pci=0|1 will switch rather more than just the NIC. It will switch your disk too, instantly causing your previously happily booting OS to fail to boot as the root device name changes.

Signature · 6 lines
Alex Bligh

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel
#9 lore raw
Quoted 15 lines · Alex Bligh
Quoted 12 lines · --On 2 December 2011 12:41:10 +0200 Pasi Kärkkäinen <[email protected]> wrote:
Quoted 8 lines

And then, ok this is probably a quite naive approach, it seemed to make sense to go through the pain of always having potentially both interfaces available (emulated and pv) so in theory the same guest config can accommodate a guest os supporting one or the other (or easily switch from one to the other). Otherwise I would expect an emulated device only when I have hd? in the config and a pv device when I write xvd?.

This works for both HVM and PVHVM (also mentioned on the wiki page):
vif = [ 'mac=00:16:5e:02:07:45, bridge=xenbr0, model=e1000' ]

Quoted 8 lines
Quoted 4 lines

So there's no need for "type=ioemu" option with xm/xend.

You can switch between HVM and PVHVM with:
xen_platform_pci=0|1

AFAIK changing xen_platform_pci=0|1 will switch rather more than just the NIC. It will switch your disk too, instantly causing your previously happily booting OS to fail to boot as the root device name changes.

We recommend you use "root=LABEL=foo" rather than "root=/dev/blah" for this reason. Fortunately most distros use that scheme by default these days.

Ian.

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

#10 lore raw
Quoted 7 lines · --On 2 December 2011 16:40:48 +0000 Ian Campbell <[email protected]>…
Quoted 3 lines

AFAIK changing xen_platform_pci=0|1 will switch rather more than just the NIC. It will switch your disk too, instantly causing your previously happily booting OS to fail to boot as the root device name changes.

We recommend you use "root=LABEL=foo" rather than "root=/dev/blah" for this reason. Fortunately most distros use that scheme by default these days.

Yes; and /etc/fstab. UUID= works too.

FWIW my experience is that various built-for-cloud type distros don't use that scheme, mainly because they use grub1 which IIRC does not support this, and building images in a non-root environment that have grub1 in is rather easier than grub2. So, for instance, all the vm-builder stuff in debian/ubuntu used grub1 and did not work this way.

However, my point was that xen_platform_pci does not only change whether your net driver is emulated or PVHVM, but also whether your disk, and indeed everything else is emulated or PVHVM.

Signature · 1 line
Alex Bligh
#11 lore raw
Quoted 8 lines · Alex Bligh

--On 2 December 2011 16:40:48 +0000 Ian Campbell <[email protected]>

Quoted 4 lines · wrote:
Quoted 3 lines

AFAIK changing xen_platform_pci=0|1 will switch rather more than just the NIC. It will switch your disk too, instantly causing your previously happily booting OS to fail to boot as the root device name changes.

Quoted 5 lines
Quoted 3 lines

We recommend you use "root=LABEL=foo" rather than "root=/dev/blah" for this reason. Fortunately most distros use that scheme by default these days.

Yes; and /etc/fstab. UUID= works too.

Right.

Quoted 4 lines

FWIW my experience is that various built-for-cloud type distros don't use that scheme, mainly because they use grub1 which IIRC does not support this, and building images in a non-root environment that have grub1 in is rather easier than grub2.

UUID= and LABEL= are functions of your initrd (actually udev) and not the bootloader. They work with both grub1 and grub2.

Quoted 2 lines

So, for instance, all the vm-builder stuff in debian/ubuntu used grub1 and did not work this way.

Which ones are these?

The Debian installer uses UUID where it can AFAIK. Ubuntu's installer is derived from Debian's so I'd expect it to be the same.

Quoted 3 lines

However, my point was that xen_platform_pci does not only change whether your net driver is emulated or PVHVM, but also whether your disk, and indeed everything else is emulated or PVHVM.

That is indeed worth highlighting.

Ian.

#12 lore raw

Ian,

Quoted 9 lines · --On 2 December 2011 17:42:35 +0000 Ian Campbell <[email protected]>…

Right.

Quoted 4 lines

FWIW my experience is that various built-for-cloud type distros don't use that scheme, mainly because they use grub1 which IIRC does not support this, and building images in a non-root environment that have grub1 in is rather easier than grub2.

UUID= and LABEL= are functions of your initrd (actually udev) and not the bootloader. They work with both grub1 and grub2.

I /think/ we might be slightly at cross purposes.

At least when I was busy making images for Xen for PVHVM a couple of years ago, the problem is roughly as follows:

The boot loader needs to know what device to load the kernel and initrd from. To do this (roughly speaking) it needs to know what BIOS device to use. Of course it does not matter whether the boot loader uses the PV device or the emulated device, save that this requires the emulated device be present (at least whilst the boot loader doesn't support drivers for the pv device). The problem is that the device the boot loader accesses is in general specified in the boot loader configuration file not as a bios device number, but as a device name. Equally, it needs to know the device so that it can write the boot sector in order to reinstall the boot loader, set options etc. The problem we ran into here was that this needs to be set to xvda in order to to write the boot sector etc., because the sda device is unplugged. However, it only recognised a BIOS mapping for sda. So neither worked, without fiddling with mappings, but that wasn't possible on a straight install. For some reason, grub1 was far more forgiving.

Quoted 4 lines
Quoted 2 lines

So, for instance, all the vm-builder stuff in debian/ubuntu used grub1 and did not work this way.

Which ones are these?

EG:
http://packages.ubuntu.com/search?keywords=ubuntu-vm-builder
http://wiki.debian.org/VMBuilder

Quoted 2 lines

The Debian installer uses UUID where it can AFAIK. Ubuntu's installer is derived from Debian's so I'd expect it to be the same.

There is more than one method of generating debian/ubuntu images (debootstrap, multistrap, vmbuilder to name but 3). Some of these run an installer, some just generate a working image for a particular environment (and it's the latter which are problematic).

FWIW my understanding is that though Ubuntu and Debian's installers both use the same underlying d-i stuff (or used to), they are now reasonably different (not that this has much bearing on the argument, as the main difference between the two is the kernel which has led to rather different results between the two); certainly which boot loader they use is independent of the install architecture, their partitioning schemes
have been substantially different, and I would expect use of UUID/LABEL
not necessarily to correspond.

Signature · 1 line
Alex Bligh
#13 lore raw
Quoted 20 lines · Alex Bligh

Ian,

--On 2 December 2011 17:42:35 +0000 Ian Campbell <[email protected]>

Quoted 9 lines · wrote:

Right.

Quoted 4 lines

FWIW my experience is that various built-for-cloud type distros don't use that scheme, mainly because they use grub1 which IIRC does not support this, and building images in a non-root environment that have grub1 in is rather easier than grub2.

UUID= and LABEL= are functions of your initrd (actually udev) and not the bootloader. They work with both grub1 and grub2.

I /think/ we might be slightly at cross purposes.

At least when I was busy making images for Xen for PVHVM a couple of years ago, the problem is roughly as follows:

Quoted 14 lines

The boot loader needs to know what device to load the kernel and initrd from. To do this (roughly speaking) it needs to know what BIOS device to use. Of course it does not matter whether the boot loader uses the PV device or the emulated device, save that this requires the emulated device be present (at least whilst the boot loader doesn't support drivers for the pv device). The problem is that the device the boot loader accesses is in general specified in the boot loader configuration file not as a bios device number, but as a device name. Equally, it needs to know the device so that it can write the boot sector in order to reinstall the boot loader, set options etc. The problem we ran into here was that this needs to be set to xvda in order to to write the boot sector etc., because the sda device is unplugged. However, it only recognised a BIOS mapping for sda. So neither worked, without fiddling with mappings, but that wasn't possible on a straight install. For some reason, grub1 was far more forgiving.

grub-install /dev/xvdX is supposed to work just as well as grub-install /dev/sdX depending on which is currently active. If it does not then you have found a bug and this should be reported against the grub package in the distro you are using.

This was fixed in grub 1 in Debian Lenny (#456776) and grub2 in Debian Squeeze (#456777). The grub2 fixes are upstream however grub1 doesn't have an upstream so other distros may be missing this fix. If you find this please report it to them. Likewise if you find that this support has regressed in Debian (or Ubuntu) then please report those bugs to them.

Please don't just assume that because something is broken for you that this is the way it must be. Report bugs to the appropriate place and there is some chance that they will get fixed. Likewise if something was broken for you "years ago" please don't assume that it has remained so.

Quoted 9 lines
Quoted 4 lines
Quoted 2 lines

So, for instance, all the vm-builder stuff in debian/ubuntu used grub1 and did not work this way.

Which ones are these?

EG:
http://packages.ubuntu.com/search?keywords=ubuntu-vm-builder
http://wiki.debian.org/VMBuilder

Quoted 7 lines
Quoted 2 lines

The Debian installer uses UUID where it can AFAIK. Ubuntu's installer is derived from Debian's so I'd expect it to be the same.

There is more than one method of generating debian/ubuntu images (debootstrap, multistrap, vmbuilder to name but 3). Some of these run an installer, some just generate a working image for a particular environment (and it's the latter which are problematic).

If a tools such as these are not correctly generating a PVHVM capable configuration when possible then IMHO that is a bug in those tools. Please report it to the tool authors as such.

If you cannot flip between PVHVM and emulated HVM easily then IMHO this is also a bug (although perhaps less serious) and should be reported as such, perhaps as a wishlist bug.

Quoted 8 lines

FWIW my understanding is that though Ubuntu and Debian's installers both use the same underlying d-i stuff (or used to), they are now reasonably different (not that this has much bearing on the argument, as the main difference between the two is the kernel which has led to rather different results between the two); certainly which boot loader they use is independent of the install architecture, their partitioning schemes have been substantially different, and I would expect use of UUID/LABEL not necessarily to correspond.

The Ubuntu installer folks are closely involved in Debian installer and in particular the folks who deal with bootloader type things on both sides are the same people.

Ian.

#14 lore raw
Quoted 87 lines · Ian Campbell
Quoted 20 lines · Alex Bligh

Ian,

--On 2 December 2011 17:42:35 +0000 Ian Campbell <[email protected]>

Quoted 9 lines · wrote:

Right.

Quoted 4 lines

FWIW my experience is that various built-for-cloud type distros don't use that scheme, mainly because they use grub1 which IIRC does not support this, and building images in a non-root environment that have grub1 in is rather easier than grub2.

UUID= and LABEL= are functions of your initrd (actually udev) and not the bootloader. They work with both grub1 and grub2.

I /think/ we might be slightly at cross purposes.

At least when I was busy making images for Xen for PVHVM a couple of years ago, the problem is roughly as follows:

Quoted 14 lines

The boot loader needs to know what device to load the kernel and initrd from. To do this (roughly speaking) it needs to know what BIOS device to use. Of course it does not matter whether the boot loader uses the PV device or the emulated device, save that this requires the emulated device be present (at least whilst the boot loader doesn't support drivers for the pv device). The problem is that the device the boot loader accesses is in general specified in the boot loader configuration file not as a bios device number, but as a device name. Equally, it needs to know the device so that it can write the boot sector in order to reinstall the boot loader, set options etc. The problem we ran into here was that this needs to be set to xvda in order to to write the boot sector etc., because the sda device is unplugged. However, it only recognised a BIOS mapping for sda. So neither worked, without fiddling with mappings, but that wasn't possible on a straight install. For some reason, grub1 was far more forgiving.

grub-install /dev/xvdX is supposed to work just as well as grub-install /dev/sdX depending on which is currently active. If it does not then you have found a bug and this should be reported against the grub package in the distro you are using.

This was fixed in grub 1 in Debian Lenny (#456776) and grub2 in Debian Squeeze (#456777). The grub2 fixes are upstream however grub1 doesn't have an upstream so other distros may be missing this fix. If you find this please report it to them. Likewise if you find that this support has regressed in Debian (or Ubuntu) then please report those bugs to them.

Please don't just assume that because something is broken for you that this is the way it must be. Report bugs to the appropriate place and there is some chance that they will get fixed. Likewise if something was broken for you "years ago" please don't assume that it has remained so.

Quoted 9 lines
Quoted 4 lines
Quoted 2 lines

So, for instance, all the vm-builder stuff in debian/ubuntu used grub1 and did not work this way.

Which ones are these?

EG:
http://packages.ubuntu.com/search?keywords=ubuntu-vm-builder
http://wiki.debian.org/VMBuilder

Quoted 7 lines
Quoted 2 lines

The Debian installer uses UUID where it can AFAIK. Ubuntu's installer is derived from Debian's so I'd expect it to be the same.

There is more than one method of generating debian/ubuntu images (debootstrap, multistrap, vmbuilder to name but 3). Some of these run an installer, some just generate a working image for a particular environment (and it's the latter which are problematic).

If a tools such as these are not correctly generating a PVHVM capable configuration when possible then IMHO that is a bug in those tools. Please report it to the tool authors as such.

If you cannot flip between PVHVM and emulated HVM easily then IMHO this is also a bug (although perhaps less serious) and should be reported as such, perhaps as a wishlist bug.

Quoted 8 lines

FWIW my understanding is that though Ubuntu and Debian's installers both use the same underlying d-i stuff (or used to), they are now reasonably different (not that this has much bearing on the argument, as the main difference between the two is the kernel which has led to rather different results between the two); certainly which boot loader they use is independent of the install architecture, their partitioning schemes have been substantially different, and I would expect use of UUID/LABEL not necessarily to correspond.

Quoted 4 lines

The Ubuntu installer folks are closely involved in Debian installer and in particular the folks who deal with bootloader type things on both sides are the same people.

At least in my limited experiments, this was not any issue. Though any newer installation uses grub2 and uuids. The grub stage was working most of the time (beside initial interrupt related problems). It was more the missing pv modules and the default to unplug emulated devices, that caused later stages to go not so smoothly. And finding that there is a way to configure NICs that seems to work in any combination of pci platform and tool stack sounds like a good way forward. It just seems that sometimes there are a bit too many knobs to frob and twiddle. ;)

-Stefan

Quoted 4 lines

Ian.

#15 lore raw
Quoted 2 lines · --On 5 December 2011 16:03:30 +0100 Stefan Bader <[email protected]>…

At least in my limited experiments, this was not any issue. Though any newer installation uses grub2 and uuids.

Well, my experience here was mostly Lucid (as I think I said), and vm-builder, which I believe is abandonware.

Ubuntu's cloud image stuff is now far better (having played with it for a couple of days now we have Xen4 working). I am not sure what Debian are doing.

Signature · 1 line
Alex Bligh
#16 lore raw
In reply to Alex Bligh
Quoted 20 lines · Alex Bligh
Quoted 7 lines · --On 2 December 2011 16:40:48 +0000 Ian Campbell <[email protected]>…
Quoted 3 lines

AFAIK changing xen_platform_pci=0|1 will switch rather more than just the NIC. It will switch your disk too, instantly causing your previously happily booting OS to fail to boot as the root device name changes.

We recommend you use "root=LABEL=foo" rather than "root=/dev/blah" for this reason. Fortunately most distros use that scheme by default these days.

Yes; and /etc/fstab. UUID= works too.

FWIW my experience is that various built-for-cloud type distros don't use that scheme, mainly because they use grub1 which IIRC does not support this, and building images in a non-root environment that have grub1 in is rather easier than grub2. So, for instance, all the vm-builder stuff in debian/ubuntu used grub1 and did not work this way.

Quoted 4 lines

However, my point was that xen_platform_pci does not only change whether your net driver is emulated or PVHVM, but also whether your disk, and indeed everything else is emulated or PVHVM.

I can understand a policy of using the pv devices whenever it is possible. The change of the device name is there but as pointed out most distro installations try to avoid those anyway since there is a similar problem with usb keys or drives potentially moving around. Same for network devices that get mapped based on mac address.
Not sure how real the need for a mixed setup is. If, then I can see that it gets a bit weird. While you can use xen_emul_unplug with other keywords to prevent unplugging disks or nics. But that would not remove the related pv devices. And I am not sure whether this would be a desired behavior or actually be feasible in a clean layered way. Personally I would think nobody could want both interfaces at the same time but I would not assume I know all of the use cases.

-Stefan

#17 lore raw
Quoted 25 lines · Stefan Bader
Quoted 20 lines · Alex Bligh
Quoted 7 lines · --On 2 December 2011 16:40:48 +0000 Ian Campbell <[email protected]>…
Quoted 3 lines

AFAIK changing xen_platform_pci=0|1 will switch rather more than just the NIC. It will switch your disk too, instantly causing your previously happily booting OS to fail to boot as the root device name changes.

We recommend you use "root=LABEL=foo" rather than "root=/dev/blah" for this reason. Fortunately most distros use that scheme by default these days.

Yes; and /etc/fstab. UUID= works too.

FWIW my experience is that various built-for-cloud type distros don't use that scheme, mainly because they use grub1 which IIRC does not support this, and building images in a non-root environment that have grub1 in is rather easier than grub2. So, for instance, all the vm-builder stuff in debian/ubuntu used grub1 and did not work this way.

Quoted 4 lines

However, my point was that xen_platform_pci does not only change whether your net driver is emulated or PVHVM, but also whether your disk, and indeed everything else is emulated or PVHVM.

Quoted 6 lines

I can understand a policy of using the pv devices whenever it is possible. The change of the device name is there but as pointed out most distro installations try to avoid those anyway since there is a similar problem with usb keys or drives potentially moving around. Same for network devices that get mapped based on mac address.
Not sure how real the need for a mixed setup is.

Basically non-existent IMHO. The option to not use pv devices is more for debugging or recovering in the case that you can't boot from the pv device for some reason (e.g. because you aren't using LABEL/UUID= ;-)).

Quoted 3 lines

If, then I can see that it gets
a bit weird. While you can use xen_emul_unplug with other keywords to prevent unplugging disks or nics. But that would not remove the related pv devices.

It does (at least in upstream Linux) prevent the PV driver from initialising, which isn't quite the same but serves the same end purpose.

Ian.

Quoted 6 lines

And
I am not sure whether this would be a desired behavior or actually be feasible in a clean layered way. Personally I would think nobody could want both interfaces at the same time but I would not assume I know all of the use cases.

-Stefan

#18 lore raw

Ian,

Quoted 5 lines · --On 5 December 2011 16:10:54 +0000 Ian Campbell <[email protected]>…
Quoted 1 line

Not sure how real the need for a mixed setup is.

Basically non-existent IMHO. The option to not use pv devices is more for debugging or recovering in the case that you can't boot from the pv device for some reason (e.g. because you aren't using LABEL/UUID= ;-)).

I think the question was 'mixed setup' which I mostly agree on.

There is plenty of reason to use emulated only setup, including that the kernel on the image does not support pv drivers at all. There's an awful lot of crud that runs on 2.6.18.

Signature · 4 lines
Alex Bligh

------------------------------------------------------------------
The information transmitted is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please contact the sender and delete the material from any computer.
#19 lore raw
In reply to Stefan Bader

Stefan,

Quoted 3 lines · --On 5 December 2011 15:55:49 +0100 Stefan Bader <[email protected]>…

Personally I would think nobody could want both
interfaces at the same time but I would not assume I know all of the use cases.

There are no sensible use cases I know of for having both at the same time, but there are use cases where either a P2V migration is done (where the P installation has hardcoded root=/dev/sda) or where a kernel upgrade is done to a kernel supporting PV drivers and unplug, where the current behaviour of unplugging stuff is not the policy of least surprise.

OTOH we've got Xen4 cloud images booting with Precise with unplug better than kvm does, precisely because kvm leaves both around (as you have probably gathered from a bug that I filed in another place...)

Signature · 1 line
Alex Bligh
#20 lore raw
In reply to Ian Campbell
Quoted 21 lines · Ian Campbell
Quoted 20 lines · Alex Bligh
Quoted 16 lines · --On 2 December 2011 12:41:10 +0200 Pasi Kärkkäinen <[email protected]> wrote:
Quoted 8 lines

And then, ok this is probably a quite naive approach, it seemed to make sense to go through the pain of always having potentially both interfaces available (emulated and pv) so in theory the same guest config can accommodate a guest os supporting one or the other (or easily switch from one to the other). Otherwise I would expect an emulated device only when I have hd? in the config and a pv device when I write xvd?.

This works for both HVM and PVHVM (also mentioned on the wiki page):
vif = [ 'mac=00:16:5e:02:07:45, bridge=xenbr0, model=e1000' ]

So there's no need for "type=ioemu" option with xm/xend.

You can switch between HVM and PVHVM with:
xen_platform_pci=0|1

Quoted 8 lines
Quoted 3 lines

AFAIK changing xen_platform_pci=0|1 will switch rather more than just the NIC. It will switch your disk too, instantly causing your previously happily booting OS to fail to boot as the root device name changes.

We recommend you use "root=LABEL=foo" rather than "root=/dev/blah" for this reason. Fortunately most distros use that scheme by default these days.

Yep, for example Fedora works out-of-the-box with both HVM and PVHVM..

-- Pasi

#21 lore raw
In reply to Pasi Kärkkäinen
Quoted 56 lines · Pasi Kärkkäinen
Quoted 40 lines · Stefan Bader
Quoted 30 lines · Pasi Kärkkäinen
Quoted 17 lines · Stefan Bader

Moving to public discussion...

This was found with Xen hypervisor version supporting device unplugging and the domU kernel having net-/blkfront and pci platform built-in (or as module).

The block device is defined as hda and the NIC type=ioemu (so theoretically guests without pv support would work, too).

Since both drivers are present, the kernel tries to unplug the emulated devices and succeeds. The blkfront driver detects the xvda device available in parallel and is working ok.

However the network interface does not work. There are entries present under sysfs for the xenbus but trying to bring it up fails with errors. And also there seems to be no mac address set (all zeros in sysfs).
When the type=ioemu is removed in the configuration, this works.

Quoted 6 lines

I have not much more debugging information beyond that, yet. But it sounds a bit like NICs should behave the same as block devices. So if there is an emulated device defined there will be an alternate paravirt interface for it and after unplugging the emulated ones we end up with the pv ones.
Is that something that can be seen with newer Xen versions, too (I am using 4.1.1)?

Hey,

Have you seen?:
http://wiki.xen.org/xenwiki/XenLinuxPVonHVMdrivers

Quoted 7 lines

Especially the following note:
"NOTE! If you have "type=ioemu" specified for the "vif"-line, PVHVM drivers WILL NOT work! Don't specify "type" parameter for the vif. (with type=ioemu the pvhvm nic in the VM will have mac address full of zeroes - and thus won't work!)."

"type=ioemu" is not needed, at least with xm/xend toolstack both HVM and PVHVM guests work OK without it.

-- Pasi

Thanks Pasi,

Quoted 11 lines

hmm, so it is documented actually and thus sort of expected. Still it is confusing. For one driver it does not make a difference to use the form of an emulated device in the config, for the other it does. The xl stack works, the xm stack does not.
And then, ok this is probably a quite naive approach, it seemed to make sense to go through the pain of always having potentially both interfaces available (emulated and pv) so in theory the same guest config can accommodate a guest os supporting one or the other (or easily switch from one to the other). Otherwise I would expect an emulated device only when I have hd? in the config and a pv device when I write xvd?.

This works for both HVM and PVHVM (also mentioned on the wiki page):
vif = [ 'mac=00:16:5e:02:07:45, bridge=xenbr0, model=e1000' ]

Quoted 7 lines

So there's no need for "type=ioemu" option with xm/xend.

You can switch between HVM and PVHVM with:
xen_platform_pci=0|1

-- Pasi

It seems that this works (without the model, too) for xm and xl. So even without explicitly saying type=ioemu, there is an emulated device created. And if the platform device is enabled, the emulated devices are unplugged by default. So it sounds like "type=ioemu" is not only not needed but hurts in the one case of xm. Would it make sense to completely remove it from the example configs?

-Stefan

#22 lore raw
Quoted 5 lines · Stefan Bader

It seems that this works (without the model, too) for xm and xl. So even without explicitly saying type=ioemu, there is an emulated device created. And if the platform device is enabled, the emulated devices are unplugged by default. So it sounds like "type=ioemu" is not only not needed but hurts in the one case of xm. Would it make sense to completely remove it from the example configs?

I think it would