PR PR
2019-Apr-04 18:02 UTC
[libvirt-users] Guest interface names not same as configured name
Hi, I am creating a guest with following description for interfaces in the xml using virsh create xml command. For some reason, the guest interface names in the VM dont match the names specified in the xml. Is there a way to make guest interface names predictable? Following is the qemu version on host dpkg --list | grep -i qemu ii qemu-kvm 1:2.11+dfsg-1ubuntu7.10 amd64 QEMU Full virtualization on x86 hardware <interface type='user'> <mac address='52:54:00:17:0b:e7'/> <guest dev='eth0'/> <model type='e1000'/> <alias name='net0'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/> </interface> <interface type='ethernet'> <mac address='52:54:00:ee:70:34'/> <target dev='net0'/> <guest dev='Ethernet0'/> <model type='rtl8139'/> <alias name='net1'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/> </interface> Thanks
Laine Stump
2019-Apr-04 21:35 UTC
Re: [libvirt-users] Guest interface names not same as configured name
On 4/4/19 2:02 PM, PR PR wrote:> Hi, > > I am creating a guest with following description for interfaces in the > xml using virsh create xml command. For some reason, the guest interface > names in the VM dont match the names specified in the xml. Is there a > way to make guest interface names predictable?For qemu (which you've indicating you're using) there isn't any way to set the name of the network device in the guest from the libvirt config. There is no visibility of the <guest dev='xxx'> element into the guest OS; all that the guest can know is that there is an e1000 ethernet device plugged into PCI bus 0 slot 3, and it has MAC address 52:54:00:17:0b:e7. Any determination of name must be done within the guest OS. The <guest dev='blah'> element is only used by the LXC and openvz drivers. It really should be flagged as an error during validation for other drivers (patches welcome :-).> > Following is the qemu version on host > > dpkg --list | grep -i qemu > ii qemu-kvm 1:2.11+dfsg-1ubuntu7.10 > amd64 QEMU Full virtualization on x86 hardware > > <interface type='user'> > <mac address='52:54:00:17:0b:e7'/> > <guest dev='eth0'/> > <model type='e1000'/> > <alias name='net0'/> > <address type='pci' domain='0x0000' bus='0x00' slot='0x03' > function='0x0'/> > </interface> > <interface type='ethernet'> > <mac address='52:54:00:ee:70:34'/> > <target dev='net0'/> > <guest dev='Ethernet0'/> > <model type='rtl8139'/> > <alias name='net1'/> > <address type='pci' domain='0x0000' bus='0x00' slot='0x05' > function='0x0'/> > </interface> > > Thanks > > _______________________________________________ > libvirt-users mailing list > libvirt-users@redhat.com > https://www.redhat.com/mailman/listinfo/libvirt-users >
PR PR
2019-Apr-07 00:38 UTC
Re: [libvirt-users] Guest interface names not same as configured name
Thanks for the quick response. I was able to use udev to control the names in the guest. Reg patch, i am new to this codebase and sure if you give me pointers on which file to look into I can give it a shot. Thanks On Thu, Apr 4, 2019 at 2:35 PM Laine Stump <laine@redhat.com> wrote:> On 4/4/19 2:02 PM, PR PR wrote: > > Hi, > > > > I am creating a guest with following description for interfaces in the > > xml using virsh create xml command. For some reason, the guest interface > > names in the VM dont match the names specified in the xml. Is there a > > way to make guest interface names predictable? > > For qemu (which you've indicating you're using) there isn't any way to > set the name of the network device in the guest from the libvirt config. > There is no visibility of the <guest dev='xxx'> element into the guest > OS; all that the guest can know is that there is an e1000 ethernet > device plugged into PCI bus 0 slot 3, and it has MAC address > 52:54:00:17:0b:e7. Any determination of name must be done within the > guest OS. > > The <guest dev='blah'> element is only used by the LXC and openvz > drivers. It really should be flagged as an error during validation for > other drivers (patches welcome :-). > > > > > > Following is the qemu version on host > > > > dpkg --list | grep -i qemu > > ii qemu-kvm 1:2.11+dfsg-1ubuntu7.10 > > amd64 QEMU Full virtualization on x86 hardware > > > > <interface type='user'> > > <mac address='52:54:00:17:0b:e7'/> > > <guest dev='eth0'/> > > <model type='e1000'/> > > <alias name='net0'/> > > <address type='pci' domain='0x0000' bus='0x00' slot='0x03' > > function='0x0'/> > > </interface> > > <interface type='ethernet'> > > <mac address='52:54:00:ee:70:34'/> > > <target dev='net0'/> > > <guest dev='Ethernet0'/> > > <model type='rtl8139'/> > > <alias name='net1'/> > > <address type='pci' domain='0x0000' bus='0x00' slot='0x05' > > function='0x0'/> > > </interface> > > > > Thanks > > > > _______________________________________________ > > libvirt-users mailing list > > libvirt-users@redhat.com > > https://www.redhat.com/mailman/listinfo/libvirt-users > > > >