[libvirt] Network Interface: How to disable virbr0 correctly?

Hi all, Recently, I have been using libvirt to create virtual machines on ESX servers. It has been very well until to the point where I couldn't find any way to disable/remove the virbr0 interface properly. We use static configuration for VMs on ESX so we do not need to use virbr0 interface and we do not want libvirt to configure iptables as a result of the newly created virbr0 interface. I have tried to remove/rename the /etc/libvirt/qemu/networks/autostart.xml file, and that prevents virbr0 being installed. However, that also seems to prevent the second interface eth1 being configured properly. After libvirt defines a VM, eth0 and eht1 are both installed, but only eth0 is configured properly. The eth1 does not appear in the /etc/sysconfig/network-script/ifcfg-xxx file. It seems to me that the 'autostart.xml' file interrupts the configuration of the eth1 interface. Can anyone please advise how I can do this properly? Thanks a lot, Jake

On 03/07/2011 04:32 PM, Jake Xu wrote:
Hi all,
Recently, I have been using libvirt to create virtual machines on ESX servers. It has been very well until to the point where I couldn't find any way to disable/remove the virbr0 interface properly.
We use static configuration for VMs on ESX so we do not need to use virbr0 interface and we do not want libvirt to configure iptables as a result of the newly created virbr0 interface.
I have tried to remove/rename the /etc/libvirt/qemu/networks/autostart.xml file, and that prevents virbr0 being installed.
Here is how to properly remove steps virbr0 (the default virtual network): http://wiki.libvirt.org/page/FAQ#How_can_I_make_libvirt_stop_using_iptables....
However, that also seems to prevent the second interface eth1 being configured properly. After libvirt defines a VM, eth0 and eht1 are both installed, but only eth0 is configured properly.
The eth1 does not appear in the /etc/sysconfig/network-script/ifcfg-xxx file. It seems to me that the 'autostart.xml' file interrupts the configuration of the eth1 interface.
Not sure why autostarting a virtual network would also bring up eth1, so no ideas there. - Cole

Hi Cole, Thanks for the wiki link. It would be so useful if the ESX driver supported those commands. It seems like the ESX driver does not support most of the network or interface configuration. Regarding the eth1 interface, I am not sure why the autostart.xml could affect bringing up eth1. Before I made changes to the autostart.xml or renamed the folder completely, the VMs have all interfaces installed: eth0, eth1, virbr0 (even though the virbr0 and its iptable rules seem to be a bit difficult to get rid of). After I renamed the autostart folder, I was able to remove the virbr0 interface and iptable rules, but the eth1 can't be brought up successfully as described in the opening post. Thanks, Jake On Tue, Mar 8, 2011 at 6:31 AM, Cole Robinson <crobinso@redhat.com> wrote:
On 03/07/2011 04:32 PM, Jake Xu wrote:
Hi all,
Recently, I have been using libvirt to create virtual machines on ESX servers. It has been very well until to the point where I couldn't find any way to disable/remove the virbr0 interface properly.
We use static configuration for VMs on ESX so we do not need to use virbr0 interface and we do not want libvirt to configure iptables as a result of the newly created virbr0 interface.
I have tried to remove/rename the /etc/libvirt/qemu/networks/autostart.xml file, and that prevents virbr0 being installed.
Here is how to properly remove steps virbr0 (the default virtual network):
http://wiki.libvirt.org/page/FAQ#How_can_I_make_libvirt_stop_using_iptables....
However, that also seems to prevent the second interface eth1 being configured properly. After libvirt defines a VM, eth0 and eht1 are both installed, but only eth0 is configured properly.
The eth1 does not appear in the /etc/sysconfig/network-script/ifcfg-xxx file. It seems to me that the 'autostart.xml' file interrupts the configuration of the eth1 interface.
Not sure why autostarting a virtual network would also bring up eth1, so no ideas there.
- Cole

2011/3/8 Jake Xu <jake@demonwaremail.net>:
Hi Cole, Thanks for the wiki link. It would be so useful if the ESX driver supported those commands. It seems like the ESX driver does not support most of the network or interface configuration.
What do you mean by " those commands"? The problem with implementing ESX networking support in libvirt is that ESX's and libvirt's network model don't match directly and it's not entirely clear how two map those two in a useful way. Can you be more specific about what you need in terms of network management?
Regarding the eth1 interface, I am not sure why the autostart.xml could affect bringing up eth1. Before I made changes to the autostart.xml or renamed the folder completely, the VMs have all interfaces installed: eth0, eth1, virbr0 (even though the virbr0 and its iptable rules seem to be a bit difficult to get rid of). After I renamed the autostart folder, I was able to remove the virbr0 interface and iptable rules, but the eth1 can't be brought up successfully as described in the opening post. Thanks, Jake
Are you installing libvirt inside the VMs and running libvirtd? Why are you doing that? Matthias
On Tue, Mar 8, 2011 at 6:31 AM, Cole Robinson <crobinso@redhat.com> wrote:
On 03/07/2011 04:32 PM, Jake Xu wrote:
Hi all,
Recently, I have been using libvirt to create virtual machines on ESX servers. It has been very well until to the point where I couldn't find any way to disable/remove the virbr0 interface properly.
We use static configuration for VMs on ESX so we do not need to use virbr0 interface and we do not want libvirt to configure iptables as a result of the newly created virbr0 interface.
I have tried to remove/rename the /etc/libvirt/qemu/networks/autostart.xml file, and that prevents virbr0 being installed.
Here is how to properly remove steps virbr0 (the default virtual network):
http://wiki.libvirt.org/page/FAQ#How_can_I_make_libvirt_stop_using_iptables....
However, that also seems to prevent the second interface eth1 being configured properly. After libvirt defines a VM, eth0 and eht1 are both installed, but only eth0 is configured properly.
The eth1 does not appear in the /etc/sysconfig/network-script/ifcfg-xxx file. It seems to me that the 'autostart.xml' file interrupts the configuration of the eth1 interface.
Not sure why autostarting a virtual network would also bring up eth1, so no ideas there.
- Cole
-- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list

On Tue, Mar 8, 2011 at 11:20 AM, Matthias Bolte < matthias.bolte@googlemail.com> wrote:
2011/3/8 Jake Xu <jake@demonwaremail.net>:
Hi Cole, Thanks for the wiki link. It would be so useful if the ESX driver supported those commands. It seems like the ESX driver does not support most of the network or interface configuration.
What do you mean by " those commands"?
The problem with implementing ESX networking support in libvirt is that ESX's and libvirt's network model don't match directly and it's not entirely clear how two map those two in a useful way.
Can you be more specific about what you need in terms of network management?
Sorry if I did not make it clear. For commands, I meant the net-list, net-destroy, etc commands in virsh.
I am actually using the libvirt Python-bindings to write scripts which automate the VM creation process. All I need in terms of network management is that I want it to have two interfaces eth0 and eth1 with static ip addresses(gateway, subnet, etc), so I don't need any other extra configuration such as virtbr0 provided by libvirt/libvirtd daemon. Is there any way to prevent libvirtd daemon being installed on the guest VM?
Regarding the eth1 interface, I am not sure why the autostart.xml could affect bringing up eth1. Before I made changes to the autostart.xml or renamed the folder completely, the VMs have all interfaces installed: eth0, eth1, virbr0 (even though the virbr0 and its iptable rules seem to be a bit difficult to get rid of). After I renamed the autostart folder, I was able to remove the virbr0 interface and iptable rules, but the eth1 can't be brought up successfully as described in the opening post. Thanks, Jake
Are you installing libvirt inside the VMs and running libvirtd? Why are you doing that?
Matthias
No. I am running libvirt with its Python-bindings on a Ubuntu PC, and remotely creating VMs on ESX server. Since I am creating VMs on ESX server, I don't really need libvirtd. It would be nice if I can disable libvirtd before it's being installed on VMs.
Thanks so much for your help, Jake
On Tue, Mar 8, 2011 at 6:31 AM, Cole Robinson <crobinso@redhat.com> wrote:
On 03/07/2011 04:32 PM, Jake Xu wrote:
Hi all,
Recently, I have been using libvirt to create virtual machines on ESX servers. It has been very well until to the point where I couldn't
find
any way to disable/remove the virbr0 interface properly.
We use static configuration for VMs on ESX so we do not need to use virbr0 interface and we do not want libvirt to configure iptables as a result of the newly created virbr0 interface.
I have tried to remove/rename the /etc/libvirt/qemu/networks/autostart.xml file, and that prevents virbr0 being installed.
Here is how to properly remove steps virbr0 (the default virtual network):
http://wiki.libvirt.org/page/FAQ#How_can_I_make_libvirt_stop_using_iptables....
However, that also seems to prevent the second interface eth1 being configured properly. After libvirt defines a VM, eth0 and eht1 are
both
installed, but only eth0 is configured properly.
The eth1 does not appear in the /etc/sysconfig/network-script/ifcfg-xxx file. It seems to me that the 'autostart.xml' file interrupts the configuration of the eth1 interface.
Not sure why autostarting a virtual network would also bring up eth1, so no ideas there.
- Cole
-- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list

Sorry for the late response. 2011/3/8 Jake Xu <jake@demonwaremail.net>:
On Tue, Mar 8, 2011 at 11:20 AM, Matthias Bolte <matthias.bolte@googlemail.com> wrote:
2011/3/8 Jake Xu <jake@demonwaremail.net>:
Hi Cole, Thanks for the wiki link. It would be so useful if the ESX driver supported those commands. It seems like the ESX driver does not support most of the network or interface configuration.
What do you mean by " those commands"?
The problem with implementing ESX networking support in libvirt is that ESX's and libvirt's network model don't match directly and it's not entirely clear how two map those two in a useful way.
Can you be more specific about what you need in terms of network management?
Sorry if I did not make it clear. For commands, I meant the net-list, net-destroy, etc commands in virsh. I am actually using the libvirt Python-bindings to write scripts which automate the VM creation process. All I need in terms of network management is that I want it to have two interfaces eth0 and eth1 with static ip addresses(gateway, subnet, etc), so I don't need any other extra configuration such as virtbr0 provided by libvirt/libvirtd daemon. Is there any way to prevent libvirtd daemon being installed on the guest VM?
Okay, I knew what commands you meant, I was asking what you want to do with them. You want to assign static IP addresses to the guests by defining a fixed MAC to IP address mapping in the virtual network definition. In general that would be the right approach. Unfortunately this is not how it currently works for ESX. Although an ESX server can run it's own DHCP server for it's virtual machines (at least I guess so from the documentation) it's not enabled by default and I couldn't figure out how to enable it yet. By default virtual machines use what ever DHCP server is in the same subnet as the ESX server itself. Another problem seems to be that the ESX DHCP server configuration doesn't allow for fixed MAC to IP address mappings. The best thing you can currently do to assign fixed IP addresses to virtual machines is to configure your external DHCP server to do so.
Regarding the eth1 interface, I am not sure why the autostart.xml could affect bringing up eth1. Before I made changes to the autostart.xml or renamed the folder completely, the VMs have all interfaces installed: eth0, eth1, virbr0 (even though the virbr0 and its iptable rules seem to be a bit difficult to get rid of). After I renamed the autostart folder, I was able to remove the virbr0 interface and iptable rules, but the eth1 can't be brought up successfully as described in the opening post. Thanks, Jake
Are you installing libvirt inside the VMs and running libvirtd? Why are you doing that?
Matthias
No. I am running libvirt with its Python-bindings on a Ubuntu PC, and remotely creating VMs on ESX server. Since I am creating VMs on ESX server, I don't really need libvirtd. It would be nice if I can disable libvirtd before it's being installed on VMs. Thanks so much for your help, Jake
"Disable libvirtd before it's being installed on VMs"? So you're installing libvirt inside the VM, but on the other hand you said that you're not doing that. I'm confused. Also having libvirtd running on your Ubuntu PC has nothing to do with networking on the ESX side. Matthias

2011/3/7 Jake Xu <jake@demonwaremail.net>:
Hi all, Recently, I have been using libvirt to create virtual machines on ESX servers. It has been very well until to the point where I couldn't find any way to disable/remove the virbr0 interface properly.
virbr0 is part of libvirt default virtual network. This is created by the libvirt daemon libvirtd. You don't need libvirtd to connect to an and ESX server. Just don't start it, and if you have it running just stop it and the virbr0 interface go away with it. If you need or want to run libvirtd for some reason you can use this virsh -c qemu:///system net-autostart --disable default virsh -c qemu:///system net-destroy default This will stop the default virtual network and disable it's autostart. The result is that virbr0 will go away.
We use static configuration for VMs on ESX so we do not need to use virbr0 interface and we do not want libvirt to configure iptables as a result of the newly created virbr0 interface.
The iptables rules will go away with the virbr0 interface.
I have tried to remove/rename the /etc/libvirt/qemu/networks/autostart.xml file, and that prevents virbr0 being installed. However, that also seems to prevent the second interface eth1 being configured properly. After libvirt defines a VM, eth0 and eht1 are both installed, but only eth0 is configured properly. The eth1 does not appear in the /etc/sysconfig/network-script/ifcfg-xxx file. It seems to me that the 'autostart.xml' file interrupts the configuration of the eth1 interface.
I don't understand this point. Are eth0 and eth1 inside of your VMs or are you referring to the interfaces of your management client? Matthias
participants (3)
-
Cole Robinson
-
Jake Xu
-
Matthias Bolte