[CentOS-virt] Preferred method of provisioning VM images

Thu Jun 12 10:30:44 UTC 2014
Peter <peter at pajamian.dhs.org>

On 06/12/2014 05:17 PM, lee wrote:
> I knew before I started that network setup would be a PITA because years
> ago, I set up a VM for someone who didn't have a 64bit system to compile
> a 64bit version of some software.  The network setup being so
> ridiculously difficult has kept me from touching VMs ever again for
> years.  It's just too difficult and not worth the effort unless you're
> really forced to do it.

Networking can be confusing until it "clicks" then it all seems to fall
into place, there is a certain amount of understanding of the overall
picture of how bridge networking (or other types of networking) works
that once you get that understanding it becomes a lot simpler.  One
thing that probably confuses you is that there are certain parts of the
networking that are done by the dom0 distro, certain parts are done by
Xen scripts and front and backend drivers, and some parts are done by
the domu operating system.  Understanding how those parts fit together
and how different distros do the same thing but perhaps with different
configs helps a lot to getting a grasp on the whole.

Obviously better documentation would help with this, but like anything
of this nature there is a learning curve that you simply have to get
over before you can really become proficient.

> As a user, I'm used to get an ISO of an installer or of a life system,
> put that into a DVD drive or write it to an USB stick and to boot from
> that to do the installation.  Why can't I do that with xen?

You can do that with Xen, KVM, and most other types of virtualization.
The idea is that you need to block-attach the disk (or ISO file if you
prefer not to use a physical disk) to the VM and then it can be mounted
and used as install media (or any other type of media for that matter).
 This can be done from teh domain config file or from the xm (or xl)
command line.

Another quick note specifically for you.  I have noticed in past
messages that you seem to be having some confusion with xm vs xl
commands and some explanation about that is probably in order to clear
up that confusion.  xm and xl are nearly identical commands to use, but
xm is the "old" way and xl the "new" way.  Basically put, xm interfaces
with a daemon running in the dom0 (xend) which in turn interfaces with
the hypervisor, while xl uses libraries to interface directly with the
hypervisor and so eliminates the need for xend.  You will see
documentation refer to one or the other, sometimes almost
interchangeably, because the two tools have almost identical usage, but
what you should be aware of is that you really need to pick one and
stick with it, Xen does not work well if you try to use xm for some
commands and xl for others.  Since you're new I would recommend xl
because xm is deprecated in newer versions of Xen, so if you want to
future-proof your knowledge xl is the way to go.  Also if you're using
xl then you should not be running the xend daemon, this is easily
accomplished by using chkconfig and service to turn xend off.


Peter