0

I am trying to launch VM using a XML. This VM will be having 5 interfaces each connected to certain bridge. Issue here is allocation of these interfaces is random. My XML

<interface type='bridge'>
    <mac address='52:54:00:9f:14:b3'/>
    <source bridge='br0'/>
    <target dev='vnet1'/>
    <model type='e1000'/>
    <alias name='net0'/>
    <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
</interface>
<interface type='bridge'>
    <mac address='52:54:00:9f:14:b4'/>
    <source bridge='br1'/>
    <target dev='vnet2'/>
    <model type='e1000'/>
    <alias name='net1'/>
    <address type='pci' domain='0x0000' bus='0x00' slot='0x10' function='0x0'/>
</interface>
<interface type='bridge'>
    <mac address='52:54:00:9f:14:b5'/>
    <source bridge='br2'/>
    <target dev='vnet2'/>
    <model type='e1000'/>
    <alias name='net3'/>
    <address type='pci' domain='0x0000' bus='0x00' slot='0x12' function='0x0'/>
</interface>
<interface type='bridge'>
    <mac address='52:54:00:9f:14:c4'/>
    <source bridge='br3'/>
    <target dev='vnet3'/>
    <model type='e1000'/>
    <alias name='net4'/>
    <address type='pci' domain='0x0000' bus='0x00' slot='0x18' function='0x0'/>
</interface>

Allocation of interfaces are random mean e th6 will be connected to br3 ; eth7 --> br4 eth8 --> br2 eth9 --> br0.

Is there any way to make it static??

At the same time is there anyway of assigning IP Address to these eth interfaces through XML file itself??

2
  • 1
    The interface names and IP addresses are assigned within the guest OS, so that is where you must make any necessary configuration. Jun 10, 2014 at 17:29
  • I haven't messed with this in a while, but I seem to remember that there's some bridging that needs to happen on the hypervisor, and that it's way easier to use the relevant virsh net-* and virsh iface-* (define/destroy/etc) bash commands to set everything up. Jun 10, 2014 at 19:47

1 Answer 1

0

You cannot really do this from the host.

One terrible workaround is to start the guest with the first interface, let it full start up, and shut it down. Modify the XML to add the second interface, start up, shut down... and repeat. On most modern linux distributions this will add things in the correct order.

You must log in to answer this question.

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