qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [Bug 1089006] [NEW] Qemu scrambles order of eth devices in vm
@ 2012-12-11 16:49 john fisher
  2012-12-12 10:22 ` [Qemu-devel] [Bug 1089006] " Daniel Berrange
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: john fisher @ 2012-12-11 16:49 UTC (permalink / raw)
  To: qemu-devel

Public bug reported:

HV = 12.04 LTS plus libvirt 1.0x
VM = 12.04 LTS

On the HV there are 12 eth interfaces which we make available to the VM.
We have 4 10G virtual function interfaces, and 8 1G conventionally
bridged interfaces. No matter what order we present the interfaces in
the xml file, they come up in eth0-eth11 order on the VM as follows:   (
the interfcaes do work, once you figure out which is which)

eth0-eth7 not in order as compoared to the bridges on the HV (interfaces file) or compared to the xml file for the VM, or compared to the bus numbers. MAC addresses are random.
eth8-eth11 show up in the VM  in order of PCU bus numbers just as you'd expect, always after the bridged interfaces.

Consulting the libvirt mailing list, the developer says they present the
list in bus order to qemu, but qemu scrambles that order. That appears
to me too, to be the case.

** Affects: qemu
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1089006

Title:
  Qemu scrambles order of eth devices in vm

Status in QEMU:
  New

Bug description:
  HV = 12.04 LTS plus libvirt 1.0x
  VM = 12.04 LTS

  On the HV there are 12 eth interfaces which we make available to the
  VM. We have 4 10G virtual function interfaces, and 8 1G conventionally
  bridged interfaces. No matter what order we present the interfaces in
  the xml file, they come up in eth0-eth11 order on the VM as follows:
  ( the interfcaes do work, once you figure out which is which)

  eth0-eth7 not in order as compoared to the bridges on the HV (interfaces file) or compared to the xml file for the VM, or compared to the bus numbers. MAC addresses are random.
  eth8-eth11 show up in the VM  in order of PCU bus numbers just as you'd expect, always after the bridged interfaces.

  Consulting the libvirt mailing list, the developer says they present
  the list in bus order to qemu, but qemu scrambles that order. That
  appears to me too, to be the case.

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1089006/+subscriptions

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Qemu-devel] [Bug 1089006] Re: Qemu scrambles order of eth devices in vm
  2012-12-11 16:49 [Qemu-devel] [Bug 1089006] [NEW] Qemu scrambles order of eth devices in vm john fisher
@ 2012-12-12 10:22 ` Daniel Berrange
  2012-12-12 19:59 ` john fisher
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 6+ messages in thread
From: Daniel Berrange @ 2012-12-12 10:22 UTC (permalink / raw)
  To: qemu-devel

There is really no such concept as "NIC order" at the hardware level in
QEMU. NIC naming order is something that operating systems invent
according to some policy they have. As far as libvirt & QEMU are
concerned, you only have control over the PCI device slot numbering.
The operating system may choose to number NICs based on their PCI device
slot number, or something else entirely. Further after an OS has been
booted once, they often record the original mapping of MAC <-> NIC
names, so even if you change the PCI slot ordering on later boots, the
naming won't change.

-- 
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1089006

Title:
  Qemu scrambles order of eth devices in vm

Status in QEMU:
  New

Bug description:
  HV = 12.04 LTS plus libvirt 1.0x
  VM = 12.04 LTS

  On the HV there are 12 eth interfaces which we make available to the
  VM. We have 4 10G virtual function interfaces, and 8 1G conventionally
  bridged interfaces. No matter what order we present the interfaces in
  the xml file, they come up in eth0-eth11 order on the VM as follows:
  ( the interfcaes do work, once you figure out which is which)

  eth0-eth7 not in order as compoared to the bridges on the HV (interfaces file) or compared to the xml file for the VM, or compared to the bus numbers. MAC addresses are random.
  eth8-eth11 show up in the VM  in order of PCU bus numbers just as you'd expect, always after the bridged interfaces.

  Consulting the libvirt mailing list, the developer says they present
  the list in bus order to qemu, but qemu scrambles that order. That
  appears to me too, to be the case.

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1089006/+subscriptions

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Qemu-devel] [Bug 1089006] Re: Qemu scrambles order of eth devices in vm
  2012-12-11 16:49 [Qemu-devel] [Bug 1089006] [NEW] Qemu scrambles order of eth devices in vm john fisher
  2012-12-12 10:22 ` [Qemu-devel] [Bug 1089006] " Daniel Berrange
@ 2012-12-12 19:59 ` john fisher
  2012-12-18 22:37   ` john fisher
  2017-07-11 19:53 ` Thomas Huth
  2017-09-10  4:17 ` Launchpad Bug Tracker
  3 siblings, 1 reply; 6+ messages in thread
From: john fisher @ 2012-12-12 19:59 UTC (permalink / raw)
  To: qemu-devel

Thank you Daniel.
I understand what you say and agree. However when presented with a mapping and an order by libvirt, shouldn't the order be preserved by default? If the OS scrambles it, then fine, not your problem...

Are we on the right track here, is there some way to control the order
as presented by Qemu when the VM's OS boots?

If its at all helpful to understand the issue, here is our current proposed workaround:
=start 32 fresh VMs, each with 8 bridged connections and 4 82599 virtual connections=
take one generic xml file
qemu-img one default disk image
examine the HV's lspci output to find out bus numbering for the 82599 virtuals
add correct bus numbering in xml file
virsh create the xml to get randomized MAC addresses ( better ways  to do this...)
save  xml again
shutdown VM
> heres where the workaround occurs <
mount VM
write to /etc/udev/rules.d file to capture MAC vs PCI numbering in order of presentation for booting
etc etc

-- 
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1089006

Title:
  Qemu scrambles order of eth devices in vm

Status in QEMU:
  New

Bug description:
  HV = 12.04 LTS plus libvirt 1.0x
  VM = 12.04 LTS

  On the HV there are 12 eth interfaces which we make available to the
  VM. We have 4 10G virtual function interfaces, and 8 1G conventionally
  bridged interfaces. No matter what order we present the interfaces in
  the xml file, they come up in eth0-eth11 order on the VM as follows:
  ( the interfcaes do work, once you figure out which is which)

  eth0-eth7 not in order as compoared to the bridges on the HV (interfaces file) or compared to the xml file for the VM, or compared to the bus numbers. MAC addresses are random.
  eth8-eth11 show up in the VM  in order of PCU bus numbers just as you'd expect, always after the bridged interfaces.

  Consulting the libvirt mailing list, the developer says they present
  the list in bus order to qemu, but qemu scrambles that order. That
  appears to me too, to be the case.

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1089006/+subscriptions

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Qemu-devel] [Bug 1089006] Re: Qemu scrambles order of eth devices in vm
  2012-12-12 19:59 ` john fisher
@ 2012-12-18 22:37   ` john fisher
  0 siblings, 0 replies; 6+ messages in thread
From: john fisher @ 2012-12-18 22:37 UTC (permalink / raw)
  To: qemu-devel

For the benefit of 1) others and 2) me when I forget how this works-

I did find a solution in formatting the xml file.

If you leave the vnets out completely, see file below,  the generic xml file will cooperate with libvirt and qemu and
order the VM's eth devices as they are ordered on the hypervisor.

(note: the macvtap entries seen below may also not be needed, sound and
usb not tested)

## sample xml file for libvirt 1.0.0 showing some bridges and some SRIOV
ports too ##

<domain type='kvm' id='1'>
  <name>sample</name>
  <hostname>sample</hostname>
  <memory unit='KiB'>524288</memory>
  <currentMemory unit='KiB'>524288</currentMemory>
  <vcpu placement='static'>1</vcpu>
  <os>
    <type arch='x86_64' machine='pc-1.0'>hvm</type>
    <boot dev='hd'/>
  </os>
  <features>
    <acpi/>
    <apic/>
    <pae/>
  </features>
  <clock offset='utc'/>
  <on_poweroff>destroy</on_poweroff>
  <on_reboot>restart</on_reboot>
  <on_crash>restart</on_crash>
  <devices>
    <emulator>/usr/bin/kvm</emulator>
    <disk type='file' device='disk'>
      <driver name='qemu' type='qcow2'/>
      <source file='/var/lib/libvirt/images/oa4-vm-sample-cli.qcow2'/>
      <target dev='vda' bus='virtio'/>
      <alias name='virtio-disk0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>
    </disk>
    <controller type='usb' index='0'>
      <alias name='usb0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/>
    </controller>
    <interface type='bridge'>
      <source bridge='br4'/>
      <model type='virtio'/>
    </interface>
    <interface type='bridge'>
      <source bridge='br5'/>
      <model type='virtio'/>
    </interface>
    <interface type='bridge'>
      <source bridge='br6'/>
      <model type='virtio'/>
    </interface>
    <interface type='bridge'>
      <source bridge='br7'/>
      <model type='virtio'/>
    </interface>
    <interface type='bridge'>
      <source bridge='br8'/>
      <model type='virtio'/>
    </interface>
    <interface type='bridge'>
      <source bridge='br9'/>
      <model type='virtio'/>
    </interface>
    <interface type='bridge'>
      <source bridge='br10'/>
      <model type='virtio'/>
    </interface>
    <interface type='bridge'>
      <source bridge='br11'/>
      <model type='virtio'/>
    </interface>
    <interface type='bridge'>
      <source bridge='br250'/>
      <model type='virtio'/>
    </interface>
    <interface type='hostdev'>
      <source dev='eth0' mode='vepa'>
                  <address type='pci' domain='0x0000' bus='0x02' slot='0x10' function='0x0'/>
          </source>
      <target dev='macvtap1'/>
      <model type='virtio'/>   
    </interface>
    <interface type='hostdev'>
      <source dev='eth1' mode='vepa'>
                  <address type='pci' domain='0x0000' bus='0x02' slot='0x10' function='0x1'/>
          </source>
      <target dev='macvtap1'/>
      <model type='virtio'/>  
    </interface>
    <interface type='hostdev'>
      <source dev='eth2' mode='vepa'>
                  <address type='pci' domain='0x0000' bus='0x16' slot='0x10' function='0x0'/>
          </source>
      <target dev='macvtap0'/>    
    </interface>
        <interface type='hostdev'>
      <source dev='eth3' mode='vepa'>
                  <address type='pci' domain='0x0000' bus='0x16' slot='0x10' function='0x1'/>
          </source>
      <target dev='macvtap0'/>    
    </interface>
    <serial type='pty'>
      <source path='/dev/pts/1'/>
      <target port='0'/>
      <alias name='serial0'/>
    </serial>
    <console type='pty' tty='/dev/pts/1'>
      <source path='/dev/pts/1'/>
      <target type='serial' port='0'/>
      <alias name='serial0'/>
    </console>
    <input type='mouse' bus='ps2'/>
    <graphics type='vnc' port='5900' autoport='yes' listen='127.0.0.1'>
      <listen type='address' address='127.0.0.1'/>
    </graphics>
    <sound model='ich6'>
      <alias name='sound0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
    </sound>
    <video>
      <model type='cirrus' vram='9216' heads='1'/>
      <alias name='video0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
    </video>
    <memballoon model='virtio'>
      <alias name='balloon0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/>
    </memballoon>
  </devices>
  <seclabel type='none'/>
</domain>


On 12/12/2012 11:59 AM, john fisher wrote:
>
> Are we on the right track here, is there some way to control the order
> as presented by Qemu when the VM's OS boots?
>

-- 
John Fisher

-- 
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1089006

Title:
  Qemu scrambles order of eth devices in vm

Status in QEMU:
  New

Bug description:
  HV = 12.04 LTS plus libvirt 1.0x
  VM = 12.04 LTS

  On the HV there are 12 eth interfaces which we make available to the
  VM. We have 4 10G virtual function interfaces, and 8 1G conventionally
  bridged interfaces. No matter what order we present the interfaces in
  the xml file, they come up in eth0-eth11 order on the VM as follows:
  ( the interfcaes do work, once you figure out which is which)

  eth0-eth7 not in order as compoared to the bridges on the HV (interfaces file) or compared to the xml file for the VM, or compared to the bus numbers. MAC addresses are random.
  eth8-eth11 show up in the VM  in order of PCU bus numbers just as you'd expect, always after the bridged interfaces.

  Consulting the libvirt mailing list, the developer says they present
  the list in bus order to qemu, but qemu scrambles that order. That
  appears to me too, to be the case.

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1089006/+subscriptions

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Qemu-devel] [Bug 1089006] Re: Qemu scrambles order of eth devices in vm
  2012-12-11 16:49 [Qemu-devel] [Bug 1089006] [NEW] Qemu scrambles order of eth devices in vm john fisher
  2012-12-12 10:22 ` [Qemu-devel] [Bug 1089006] " Daniel Berrange
  2012-12-12 19:59 ` john fisher
@ 2017-07-11 19:53 ` Thomas Huth
  2017-09-10  4:17 ` Launchpad Bug Tracker
  3 siblings, 0 replies; 6+ messages in thread
From: Thomas Huth @ 2017-07-11 19:53 UTC (permalink / raw)
  To: qemu-devel

Is there still something left to do here, or could we close this bug
nowadays?

** Changed in: qemu
       Status: New => Incomplete

-- 
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1089006

Title:
  Qemu scrambles order of eth devices in vm

Status in QEMU:
  Incomplete

Bug description:
  HV = 12.04 LTS plus libvirt 1.0x
  VM = 12.04 LTS

  On the HV there are 12 eth interfaces which we make available to the
  VM. We have 4 10G virtual function interfaces, and 8 1G conventionally
  bridged interfaces. No matter what order we present the interfaces in
  the xml file, they come up in eth0-eth11 order on the VM as follows:
  ( the interfcaes do work, once you figure out which is which)

  eth0-eth7 not in order as compoared to the bridges on the HV (interfaces file) or compared to the xml file for the VM, or compared to the bus numbers. MAC addresses are random.
  eth8-eth11 show up in the VM  in order of PCU bus numbers just as you'd expect, always after the bridged interfaces.

  Consulting the libvirt mailing list, the developer says they present
  the list in bus order to qemu, but qemu scrambles that order. That
  appears to me too, to be the case.

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1089006/+subscriptions

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Qemu-devel] [Bug 1089006] Re: Qemu scrambles order of eth devices in vm
  2012-12-11 16:49 [Qemu-devel] [Bug 1089006] [NEW] Qemu scrambles order of eth devices in vm john fisher
                   ` (2 preceding siblings ...)
  2017-07-11 19:53 ` Thomas Huth
@ 2017-09-10  4:17 ` Launchpad Bug Tracker
  3 siblings, 0 replies; 6+ messages in thread
From: Launchpad Bug Tracker @ 2017-09-10  4:17 UTC (permalink / raw)
  To: qemu-devel

[Expired for QEMU because there has been no activity for 60 days.]

** Changed in: qemu
       Status: Incomplete => Expired

-- 
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1089006

Title:
  Qemu scrambles order of eth devices in vm

Status in QEMU:
  Expired

Bug description:
  HV = 12.04 LTS plus libvirt 1.0x
  VM = 12.04 LTS

  On the HV there are 12 eth interfaces which we make available to the
  VM. We have 4 10G virtual function interfaces, and 8 1G conventionally
  bridged interfaces. No matter what order we present the interfaces in
  the xml file, they come up in eth0-eth11 order on the VM as follows:
  ( the interfcaes do work, once you figure out which is which)

  eth0-eth7 not in order as compoared to the bridges on the HV (interfaces file) or compared to the xml file for the VM, or compared to the bus numbers. MAC addresses are random.
  eth8-eth11 show up in the VM  in order of PCU bus numbers just as you'd expect, always after the bridged interfaces.

  Consulting the libvirt mailing list, the developer says they present
  the list in bus order to qemu, but qemu scrambles that order. That
  appears to me too, to be the case.

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1089006/+subscriptions

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2017-09-10  4:30 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-12-11 16:49 [Qemu-devel] [Bug 1089006] [NEW] Qemu scrambles order of eth devices in vm john fisher
2012-12-12 10:22 ` [Qemu-devel] [Bug 1089006] " Daniel Berrange
2012-12-12 19:59 ` john fisher
2012-12-18 22:37   ` john fisher
2017-07-11 19:53 ` Thomas Huth
2017-09-10  4:17 ` Launchpad Bug Tracker

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).