Spotlight | Reviews | Current Issue | Academy | Newsletter | Subscribe | Shop |
Departments

Partner Links
Make your own website
WinWeb OnlineOffice
Comparing prices of hardware is worth it.
Price Comparison
UK Linux Jobs
What:
Where:
Country:
vacatures Netherlands njobs Linux vacatures
arbeit Deutschland njobs Linux arbeit
work United Kingdom njobs Linux jobs
Lavoro Italia njobs Linux lavoro
Emploi France njobs Linux emploi
trabajo Espana njobs Linux trabajo

user friendly

Admin Magazine

ADMIN Network & Security

Subscribe now and save!

ADMIN - Explore the new world of system administration! Special introductory offer! Order by September 30th to save 10% off the regular subscription price! Each issue delivers technical solutions to the real-world problems you face every day. Learn the latest techniques for better:

  • network security
  • system management
  • troubleshooting
  • performance tuning
  • virtualization
  • cloud computing

 

on Windows, Linux, Solaris, and popular varieties of Unix.

http://www.admin-magazine.com/

  linux-magazine.com » Issues » 2009 » 98 » MLN  

Print this page. Recommend
Share

Administering virtual machines with MLN

Watching the Flock

fo_7443191_schaefer-herde_Diana-Kosaric.png

© Diana Kosaric, Fotolia

This simple command-line tool helps you keep ahead of your virtual infrastructure.

The simplest virtualization scenarios are very easy to manage. In the real world, though, virtualization does not always simplify system administration. In fact, many of the most powerful uses of virtualization result in additional administrative tasks and challenges. For example, large data centers use virtualization to consolidate several servers onto the same physical hardware, thereby minimizing space, cost, and power requirements.

These virtual machines (VMs) can migrate between servers to achieve higher uptimes and flexible load balancing. However, managing such a complex virtual infrastructure is at least as challenging as administering the equivalent number of separate server systems, and it requires very different skills.

Many high-end commercial virtualization products come with sophisticated VM management features. If you are wondering whether the free software community offers an equivalent application, the open source MLN VM administration tool might be just what you need. MLN, which stands for "Manage Large Networks," lets you build sophisticated, dynamic, virtual infrastructures with the use of freely available virtualization platforms. The versatile MLN currently supports the widely used VMware Server [1] and Xen [2] packages, as well as User-Mode Linux [3].

For Xen, MLN also provides live migration of entire network topologies, which is otherwise available in applications only at the highest end. MLN's simple command-line and config file interfaces serve the needs of complex virtualization scenarios, but it is easy enough for administrators who are new to virtualization.

About MLN

The MLN environment helps you manage large numbers of virtual machines through a simple command-line interface. MLN has three main design goals:

  • The user should be able to design and implement complex VM deployments.
  • The process from design to actual deployment should be as efficient as possible.

The configuration language should be extensible, so users can customize MLN easily for their unique needs.

MLN is designed to work in concert with other VM management tools. For example, if you have a VMware Server, you can use MLN for efficient building and redeploying of complex virtual networks and also use VMware Server Console for starting and stopping individual virtual machines.

Download MLN from SourceForge [4]. The installation process is simple and similar to the procedure for other Linux programs:

# wget http://mln.sourceforge.net/files/mln-latest.tar.gz
# tar xzfv mln-latest.tar.gz
# cd mln-latest
# ./mln setup

Defining Projects

MLN organizes virtual machines into units called projects. Projects are groups of virtual machines and their associated virtual networks. The simplest project consists of a single virtual machine. A more powerful approach is to group virtual machines that belong together: all virtual machines that are web servers, an entire replica of a small business network, all the test systems for a software test suite.

Projects are defined in MLN configuration files. The configuration file shown in Listing 1 (ldaptest.mln) defines two virtual machines connected by a virtual LAN. Annotations in the file highlight the most important configuration settings.

Listing 1

ldaptest.mln

01 global {       (Settings affecting all VMs and switches in the file.)
02    project ldaptest     Project name.
03 }
04
05 host ldapclient {
06    xen           This is a Xen VM.
07    memory 128M  Memory size for VM.
08    lvm           Create logical volume for storing VM.
09    size 2GB     Size of the VM.
10    template ubuntu-client.ext3
11    nameserver 10.0.0.15  Set the name server.
12    network eth0 {      Config. virt. net.interface.
13      address dhcp      Use DHCP for IP address.
14      switch LDAPlan    Connect to virt. switch.
15    }
16    users { kyrre l47/Y.NtB9p7w } (Create user and set encoded password.)
17
18 host ldapserver {
19    xen              Another Xen VM.
20    memory 256M
21    lvm
22    size 2GB
23    template ubuntu¿ldap.ext3 (Initial OS image.)
24    nameserver 10.0.0.15
25    network eth0 {     This VM uses a static address.
26       address 10.0.0.2
27       netmask 255.255.255.0
28       gateway 10.0.0.1
29       switch LDAPlan  Connect to virtual LAN.
30    }
31 }
32
33 switch LDAPlan { }  (Create virtual switch connecting the VMs.)

Listing 1 starts with the global stanza, wherein the name of the project is defined. Next follows a declaration of a virtual machine called ldapclient – a Xen host with 128MB of memory built from the template ubuntu-client.ext3. The host has one network interface configured to use DHCP for its IP address. The third stanza defines another Xen host, ldapserver, with similar settings, although it is given more memory. Note that the second host uses a different template as its initial operating system image and has a static IP address. The final stanza defines a virtual switch to which both virtual machines are connected; this switch allows them to communicate with one another.

Most of the settings are straightforward, but the template specifications deserve special mention. Templates are pre-fabricated VM filesystems. Each time you build a new virtual machine, you specify a template to use as its base. The virtual machine will be individualized by MLN during the build process. Some people like to use very generic templates for all their virtual machines and customize them later, whereas others create very specialized templates, like a fully functional LAMP server or a copy of a typical employee desktop.

The definition for a VMware Server virtual machine differs only slightly from the host definition in Listing 1. The vmware keyword is used in the VM host definition stanzas instead of xen, and a VMware format template is used instead of a filesystem image. The switch definition stanza also requires the vmware keyword.

Valid host and switch names are case sensitive and can contain lowercase and uppercase letters, numbers, and hyphens.

Managing VMs with the mln Command

Once you have defined a project in a configuration file, you can use the mln command to build the virtual machines and virtual network inside it. For example, the following commands create the virtual hosts and network defined in Listing 1 and then start the hosts and virtual network:

# mln build -f ldaptest.mln
# mln start -p ldaptest

The build subcommand instantiates the entities in the specified project file, and the start subcommand boots the virtual machines and activates the virtual network.

Typically, the build subcommand is used only once – initially to create the project – whereas the start subcommand and its sibling stop are used to activate and deactivate the project hosts and network.

By including the -h option, you can apply the command to a single host within a project:

# mln stop -p ldaptest -h ldapserver

Table 1 summarizes the most important subcommands related to project management.

Clearly, writing host stanzas for large numbers of virtual machines would get tedious. The MLN configuration language allows you to define superclasses: named groups of settings that can be applied to multiple hosts.


Read full article as PDF »


Comments


Print this page. Recommend
Share
Related Articles
Virtual Performance Tips for optimizing performance in virtual environments
IT DIARY Three case studies in the life of an admin
VMworld 2008 A report from VMworld 2008
Virtual Admin Tools for managing virtual environments
Virtualizing with Xen Getting started with Xen virtualization
VIRTUAL BENEFITS System Emulation with QEMU
No More Downloads!

Save the download and take Linux Magazine DVDs instead.

Each DVD contains a full distro like Ubuntu, SUSE, Mandriva, Fedora, or Debian and comes with the corresponding issue of Linux Magazine.

Don't waste time downloading Linux!

more...