The mac adress are unknown until the creation of the VM, so udev won't help here :(

2012/10/3 Antoni Segura Puimedon <asegurap@redhat.com>


----- Original Message -----
> From: "Kevin Maziere Aubry" <kevin.maziere@alterway.fr>
> To: "Igor Lvovsky" <ilvovsky@redhat.com>
> Cc: "Dor Laor" <dlaor@redhat.com>, "Michael Tsirkin" <mtsirkin@redhat.com>, users@ovirt.org
> Sent: Wednesday, October 3, 2012 8:35:04 AM
> Subject: Re: [Users] Question about network card order
>
>
> Thanks for your reply.
>
>
>
> 2012/10/3 Igor Lvovsky < ilvovsky@redhat.com >
>
>
>
>
>
> ----- Original Message -----
> > From: "Kevin Maziere Aubry" < kevin.maziere@alterway.fr >
> > To: users@ovirt.org
> > Sent: Wednesday, October 3, 2012 9:58:44 AM
> > Subject: [Users] Question about network card order
> >
> >
> > Hello
> >
> >
> > My first email on the mailing, I hope the first one of a longue
> > serie.
> >
>
> Welcome to community :)
>
>
> >
> > The email concerns a Network Card order issue for which I like to
> > report a have your advises.
> >
> >
> > I've made a template which contains 2 network cards, Each one
> > bridge
> > on different vlan network.
> > When I create a VM from this template, the network card mac address
> > assignation is random... so that by default my fedora assign eth0
> > to
> > the smallest mac address, and so on for eth1/eth2 ...
> >
> >
> > But no way to define network card order in template, so that
> > sometime
> > the smallest mac address is on eth0, sometime on eth1 (and in fact
> > more often on eth1), sometime my VM works, sometime I have to
> > destroy and recreate network interfaces.
> >
> >
>
> Unfortunately it's a known issue that related mostly to guest kernel
> rather than RHEV-M.
> This is not related to order of NICs during VM start, because RHEV-M
> keep the MAC assignment
> and even PCI address assignment same over VM reboots.
>
> The real reason hidden somewhere deep in kernel/udev behaviour.
> We need to understand why 2 NICs with same MAC addresses and same PCI
> addresses may get different names (eth0/eth1)
> over machine reboot.
>
> Michael, any ideas?
>
>
> > Is there a workaround or anything else ?
> >
>
> No, I am not aware of any workaround

Wouldn't it be possible to write some matching rules in:
    /etc/udev/rules.d/70-persistent-net.rules

for your template so you would have it consistent. Mind that you should
not rename to the kernel eth namespace.

Best,

Toni

>
>
> Regards,
> Igor
>
>
> >
> > Thanks
> >
> >
> > Kévin
> >
> >
> > --
> >
> > Kevin Mazière
> > Responsable Infrastructure
> > Alter Way – Hosting
> > 1 rue Royal - 227 Bureaux de la Colline
> > 92213 Saint-Cloud Cedex
> > Tél : +33 (0)1 41 16 38 41
> > Mob : +33 (0)7 62 55 57 05
> > http://www.alterway.fr
> >
> > _______________________________________________
> > Users mailing list
> > Users@ovirt.org
> > http://lists.ovirt.org/mailman/listinfo/users
> >
>
>
>
>
> --
>
> Kevin Mazière
> Responsable Infrastructure
> Alter Way – Hosting
> 1 rue Royal - 227 Bureaux de la Colline
> 92213 Saint-Cloud Cedex
> Tél : +33 (0)1 41 16 38 41
> Mob : +33 (0)7 62 55 57 05
> http://www.alterway.fr
>
> _______________________________________________
> Users mailing list
> Users@ovirt.org
> http://lists.ovirt.org/mailman/listinfo/users
>



--

Kevin Mazière
Responsable Infrastructure
Alter Way – Hosting
1 rue Royal - 227 Bureaux de la Colline
92213 Saint-Cloud Cedex
Tél : +33 (0)1 41 16 38 41
Mob : +33 (0)7 62 55 57 05
http://www.alterway.fr