I have a web application which requires quite a lot of dependencies. I'm currently evaluating the use of kvm images to help our users installing this application on their servers.
However we have some concerns with the possibility to customize these images, mainly with network and storage.
Potential network problems:
Many sites have several networks (for example one network for the public web interface and one private network for data), and virtual guests sometime need to access both of them. This should be easy to deal with using two (or more) virtual network interfaces. However:
- some sites use DHCP while other need static IP
- MAC Address restriction are present on some networks
- If we change MAC address on command line, the virtual guest will probably assign a new interface (ie eth2/eth3 instead of eth0/eth1). This happens with our debian guests because of udev rules.
- When such network problem occures, usually the guest takes ages at boot time while trying to load some network services (like MTA for instance).
I have to precise that guests currently access the networks via bridging.
What techniques are you employing for such problems ? Is there a way to configure once a virtual guest and run it everywhere with minimal configuration ? Can libvirt provide some assistance for this process ?
Thanks for the first answers. Now I realize that I should be a little more precise:
First, our application can of course be installed in any kind of virtual machine (XEN, VMWare, etc) and we give the choice to our users. I'm just focusing on KVM because some sites made the request of a pre-configured KVM image and are not as comfortable with virtualization techniques as those currently using Xen.
Second, the problem they can face with network issues described previously is more or less the same problem that I face at work: I usually create a virtual machine on my desktop computer before moving the archive into our cluster for production. However the environment is quite different between my desktop computer and the cluster. Linux version are different, we use different private networks, etc. So let's say that I only want to simplify the process of moving a virtual KVM machine from my computer to the cluster.
I was in fact looking for some robust solution to give the virtual guests some hints about their environment. For example adding some information in libvirt XML files like the mac adresses for eth0 and eth1 and the IP of these interfaces, and other stuff like that (NFS, etc). Since we use network bridging I don't think that a local DHCP server on the host could be a good solution, and would only solve one part of the problem. So what would be really cool is a way to communicate configuration information from the host to the guests. Maybe this already exists, or can be implemented by some way.
So my reformulated question is: is there a good (robust, standard, elegant, whatever) way to communicate those information from host to guests (ideally directly using libvirt XML), can this be implemented if it does not exists already or is this idea completely stupid (then please give arguments for why this is a stupid idea).
Thanks (again) !