LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Virtualization and Cloud (https://www.linuxquestions.org/questions/linux-virtualization-and-cloud-90/)
-   -   Is there an easier way to do bridged networking with KVM? (https://www.linuxquestions.org/questions/linux-virtualization-and-cloud-90/is-there-an-easier-way-to-do-bridged-networking-with-kvm-4175506834/)

Red Squirrel 06-02-2014 09:37 PM

Is there an easier way to do bridged networking with KVM?
 
Every other VM solution I've used never required to screw around with network configuration to create virtual interfaces, or having to restart the service or reboot, but everything I read seems to lead to having to edit the interfaces file and restarting networking.

Is there not a better way to do this? Why can't I just bridge directly to the eth0.3/bond0.3 etc interfaces? (where 3 is vlan id). Is there something I'm missing?

Also when they say "use virtio" what exactly do they mean? What do I do to use that? I feel like all the documentation I read makes too many assumptions about existing knowledge. I can't seem to find anything that starts from the beginning.

Currently to add vlans I just use "vconfig add bond0 3" where 3 is vlan 3. I don't use the interface script because that requires a network restart, which is unacceptable on a production machine. I have a startup script that also executes all these to add vlans. If I later on want to add another vlan then I just edit that script, but I can also issue the command.

Is there a way to do this with bridging, or a way to just bridge directly to the actual vlan interface instead of having to create two interfaces per vlan?

I also read a lot about xml files, where am I suppose to create these?

evo2 06-02-2014 10:30 PM

Hi,

the short answer is yes. Longer answer is that you can use lib-virt, and virt-manager to easily set this up once and forget about it. How to install these depends on your OS.

Evo2.

Red Squirrel 06-02-2014 10:37 PM

Using Debian. I saw the option in virt-manager but everything is grayed out, can't select any of the vlan interfaces.

evo2 06-02-2014 11:00 PM

Hi,

in the "Virtual Networks" tab click on the "+" to add a new network and then you should be walked through setting up a new network however you like.

Alternatively you can use the virsh on the command line to create, modify, start, stop, etc networks. See the man page or online documentation for details.

Evo2.

Red Squirrel 06-02-2014 11:12 PM

I was trying to figure out how to use vish but it wants a xml file to create a network, I have no idea what that file is, how or where I create it. Nothing seems to explain that.

evo2 06-02-2014 11:38 PM

Hi,
Quote:

Originally Posted by Red Squirrel (Post 5181278)
I was trying to figure out how to use vish but it wants a xml file to create a network, I have no idea what that file is, how or where I create it. Nothing seems to explain that.

You can create it using virt-manager as explained above. Then if you need to tweak some seetings you can use virsh. For example if you have a network called "default", you can modify it with:
Code:

virsh net-edit default
You'll need to read the documentation if you want to use virsh.

Evo2.

Red Squirrel 06-03-2014 12:20 AM

Do you have any documentation I should start with? I'm having trouble finding something that's targeted at someone who has never used it before. I'm also really confused about all the different tools/systems used. There's qemu, kvm, libvirt, virt-manager, virtsh etc... just not sure what I'm suppose to use and what not, so even googling for documentation is hard as I'm not even sure what I should be searching for.

evo2 06-03-2014 12:40 AM

Hi,

Quote:

Originally Posted by Red Squirrel (Post 5181321)
Do you have any documentation I should start with? I'm having trouble finding something that's targeted at someone who has never used it before. I'm also really confused about all the different tools/systems used. There's qemu, kvm, libvirt, virt-manager, virtsh etc... just not sure what I'm suppose to use and what not, so even googling for documentation is hard as I'm not even sure what I should be searching for.

libvirt is a set of libraries/tools for managing virtual machines. It can be used to manage kvm and others. Roughly speaking, virt-manager is a graphical front end for using libvirt and virsh is a commandline front end for using libvirt. Perhaps https://wiki.debian.org/libvirt is reasonable place to start.

Evo2.

dijetlo 06-04-2014 03:49 PM

If you have libvirt installed on your machine, there is a very nice, version specific documentation library in your docs directory. On my Slackware install the index page for it is file:///usr/doc/libvirt-1.0.3/html/index.html.
Evo is exactly correct with the reference but when I first started digging into libvirt I created confusion for myself looking at some documentation that didn't refer to my particular version.
Libvirt seems to be under extremely heavy development releasing version 1.2.5 just the other day.

Red Squirrel 06-04-2014 05:23 PM

I decided to give up and go ESXi. Installing it now. Maybe once libvirt/kvm/qemu etc is more mature and has a more unified management system I will reconsider it. There is just too much involved to do simple things that are normally a mouse click away in any other hypervisor. I don't know why Linux devs always make things more complicated than they have to be. I think that is the biggest thing that keeps people away from Linux. Nothing is plug and play, you always have to read tons of documentations and do tons of stuff manually.

dijetlo 06-04-2014 05:40 PM

Here's about 30 3rd party management tools that work with QEMU-KVM. Many of them web based so their as graphical as any other GUI.
That said, they have an extremely well developed commandline interface (I thinks so anyway)
One of the things I really prefer about QEMU-KVM is they seem to work on developing functionality instead of interface. They leave that to the user, which makes sense in the environment they're working in.

Red Squirrel 06-04-2014 06:11 PM

Wow did not know there was that many management interfaces, I googled but did not find much. Once I migrate everything over from my old server I can maybe experiment more on the old server when I get the chance.

I'm already setting up VMs and everything in vmware now so probably going to stick with that, but I will still need a fallback plan in case they stop making it free, and eventually if I add multiple servers I will want to be able to do live migrations and stuff. Though another issue with kvm is having to shut down the vm just to do a trivial change like changing the cd though, unless some of those tools fix that problem?

dijetlo 06-04-2014 08:22 PM

You know Red, I'm really interested in comparing vmware to QEMU-KVM in some limited applications, anything you can post about your experiences converting images would be welcome.

evo2 06-04-2014 09:50 PM

Hi,
Quote:

Originally Posted by dijetlo (Post 5182523)
If you have libvirt installed on your machine, there is a very nice, version specific documentation library in your docs directory. On my Slackware install the index page for it is file:///usr/doc/libvirt-1.0.3/html/index.html.

OP is running Debian, so would need to install the libvirt-doc package and will then find the docs at file:///usr/share/doc/libvirt-doc/index.html

Evo2.

dijetlo 06-04-2014 10:26 PM

thanks


All times are GMT -5. The time now is 10:06 AM.