I'm running CentOS 5.5. I don't want to run Xen, since Redhat has stated it's standardizing on KVM for the future. I downloaded the CentOS 5.4 base image - kvm-Centos5.4-base and just tried to install it.
I have 3 interfaces, br0, br1 and br2. I've defined an IP range on br2 to use. I manually select the IP address to assign as one in the IP range on br2.
There's no tap interface involved in kvm, it just needs to be defined to use the appropriate bridge interface.
Where is the configuration for the kvm instance stored? Does cloudmin interact with libvirt?
Here's the log for the system creation attempt.
Copying 550.12 MB image file to host system steamroller.dhp.com .. .. already on host
Creating virtual system with KVM .. .. creation started.
Waiting for creation to complete ........................ .. creation has completed successfully.
Mounting new instance's filesystem .. .. mounted on /mnt/kvm-test1.srv.dhp.com
Setting root password .. .. done
Adding extra authorized SSH keys .. .. done
Updating configuration files with hostname and IP address .. .. done
Updating network configuration files .. .. done
Allowing SSH logins by root .. .. already allowed
Removing missing disks from fstab file .. .. done
Un-mounting instance's filesystem .. .. done
Adding DNS entry test1.srv.dhp.com. for IP address 199.4.150.175 .. .. done
Starting up new KVM instance .. .. failed to start : /etc/qemu-ifup: could not launch network script Could not initialize device 'tap'
Installing Webmin from http://www.webmin.com/download/webmin-current.tar.gz ..
.. install failed : Perl and Wget are required to install Webmin, but cannot be automatically installed Fetching current status .. .. status successfully retrieved (Down)
Enabling system at host boot time .. .. done
Comments
Submitted by JamieCameron on Sun, 09/19/2010 - 00:48 Comment #1
Cloudmin doesn't use libvirt, and stores the config for each KVM instance in its own config files.
Usually tap interfaces are used - without them, how would the KVM instance be able to contact systems other than the host?
Submitted by smgoller on Sun, 09/19/2010 - 14:50 Comment #2
My apologies, I misread the error and how i thought libvirt used kvm. So I started doing some research into what libvirt does versus cloudmin. Here's the command line from a libvirt started kvm instance.
/usr/libexec/qemu-kvm -S -M rhel5.4.0 -m 1024 -smp 2 -name prototype -uuid 5508b245-c50d-1325-2698-68ae615507e3 -no-kvm-pit-reinjection -monitor pty -pidfile /var/run/libvirt/qemu//prototype.pid -boot c -drive file=/dsk3/images/prototype.img,if=virtio,index=0,boot=on,cache=none -net nic,macaddr=00:50:56:01:01:01,vlan=0,model=virtio -net tap,fd=17,script=,vlan=0,ifname=vnet0 -serial pty -parallel none -usb -vnc 127.0.0.1:0 -k en-us
So I think the issue is that libvirt starts the tap interface with the option "script=" included, which presumably means that it shouldn't call anything when it starts up.
Have you guys considered integrating libvirtd as a new host type? It seems to me that it would be a good fit.
Submitted by JamieCameron on Sun, 09/19/2010 - 18:44 Comment #3
I don't really see the need to support libvirt, as it is just a wrapper around KVM and Xen, and Cloudmin already configures both of those natively.
So did you manage to get networking working?
Submitted by smgoller on Wed, 09/22/2010 - 00:23 Comment #4
I've set up networking as per your wiki entry on configuring KVM. However, the kvm instance will not start because kvm is trying to run a script during startup called /etc/qemu-ifup. This doesn't exist under CentOS.
I found a blog entry with a qemu-ifup script. I got networking working, but I'm running VMs on three different interfaces, and the script isn't capable of determining which bridge to add the tunnel interface to as it isn't given enough information. That coupled with no apparent support for starting kvm with virtio devices pretty much makes cloudmin a non-starter for us, which sucks because I really like your UI and management system. I just don't know if I have the time to reverse engineer your kvm perl library and make it support what we need.
Submitted by JamieCameron on Wed, 09/22/2010 - 00:43 Comment #5
Unfortunately I don't know of any way to tell KVM which bridge to connect a virtual interface to - the
qemu
man page doesn't seem to document any option for this. If this was possible, we could easily add support for it in Cloudmin.Submitted by smgoller on Wed, 09/22/2010 - 01:31 Comment #6
Presumably you could allow the user to choose one of the existing bridge interfaces on the host as part of the metadata for the KVM instance.
KVM by default runs /etc/qemu-ifup to bring up an interface. You can specify the name of the script by using the script= argument to the -net option. In theory you could create an ifup script like the one below customized for the kvm instance using the above metadata.
!/bin/shecho "Executing /etc/qemu-ifup" echo "Bringing up $1 for bridged mode..." /sbin/ifconfig $1 0.0.0.0 promisc up echo "Adding $1 to br0..." /usr/sbin/brctl addif br2 $1 sleep 2
would something like that make sense?
Submitted by JamieCameron on Wed, 09/22/2010 - 17:09 Comment #7
Yeah, that's what Cloudmin needs to do .. a bit manual (compared to Xen), but quite possible to support.
I will implement this, and then update this bug.
Submitted by JamieCameron on Thu, 09/23/2010 - 15:51 Comment #8
I have just completed implementation of multiple-bridge support for KVM in Cloudmin, for inclusion in the 4.8 release.
Submitted by smgoller on Wed, 09/29/2010 - 13:04 Comment #9
Excellent! I just tested this and it works fine. Thanks for the quick turnaround.
Submitted by JamieCameron on Wed, 09/29/2010 - 13:06 Comment #10
Cool .. thanks for pointing out how this can be implemented.
Submitted by Issues on Thu, 10/14/2010 - 03:22 Comment #11
Automatically closed -- issue fixed for 2 weeks with no activity.