
:FM<IJKFIP MLN 8[d`e`jk\i`e^m`iklXcdXZ_`e\jn`k_DCE N8K:?@E> K?<=CF:B This simple command-line tool helps you keep ahead of your virtual infrastructure. BY KYRRE BEGNUM AND ÆLEEN FRISCH he simplest virtualization scenar- tion, the open source MLN VM adminis- ios are very easy to manage. In tration tool might be just what you need. implement complex VM deployments. Kthe real world, though, virtual- MLN, which stands for “Manage Large ization does not always simplify system Networks,” lets you build sophisticated, ployment should be as efficient as pos- administration. In fact, many of the most dynamic, virtual infrastructures with the sible. powerful uses of virtualization result in use of freely available virtualization plat- The configuration language should be additional administrative tasks and chal- forms. The versatile MLN currently sup- extensible, so users can customize MLN lenges. For example, large data centers ports the widely used VMware Server [1] easily for their unique needs. use virtualization to consolidate several and Xen [2] packages, as well as User- MLN is designed to work in concert servers onto the same physical hard- Mode Linux [3]. with other VM management tools. For ware, thereby minimizing space, cost, For Xen, MLN also provides live mi- example, if you have a VMware Server, and power requirements. gration of entire network topologies, you can use MLN for efficient building These virtual machines (VMs) can mi- which is otherwise available in applica- and redeploying of complex virtual net- grate between servers to achieve higher tions only at the highest end. MLN’s works and also use VMware Server Con- uptimes and flexible load balancing. simple command-line and config file in- sole for starting and stopping individual However, managing such a complex vir- terfaces serve the needs of complex vir- virtual machines. tual infrastructure is at least as challeng- tualization scenarios, but it is easy Download MLN from SourceForge [4]. ing as administering the equivalent enough for administrators who are new The installation process is simple and number of separate server systems, and to virtualization. similar to the procedure for other Linux it requires very different skills. programs: Many high-end commercial virtualiza- 8YflkDCE tion products come with sophisticated The MLN environment helps you man- # wget 5 VM management features. If you are age large numbers of virtual machines http://mln.sourceforge.net/5 wondering whether the free software through a simple command-line inter- files/mln-latest.tar.gz community offers an equivalent applica- face. MLN has three main design goals: # tar xzfv mln-latest.tar.gz 22 ISSUE 98 JANUARY 2009 022-030_mln.indd 22 13.11.2008 17:57:08 Uhr MLN :FM<IJKFIP # cd mln-latest Listing 1: ldaptest.mln # ./mln setup 01 global { 17 (Settings affecting all VMs and 18 host ldapserver { ;\]`e`e^Gifa\Zkj switches in the file.) 19 xen Another Xen VM. MLN organizes virtual machines into 02 project ldaptest Project name. units called projects. Projects are groups 20 memory 256M 03 } of virtual machines and their associated 21 lvm 04 virtual networks. The simplest project 22 size 2GB 05 host ldapclient { consists of a single virtual machine. A 23 template ubuntu-ldap.ext3 more powerful approach is to group vir- 06 xen This is a Xen VM. (Initial OS image.) tual machines that belong together: all 07 memory 128M Memory size for VM. 24 nameserver 10.0.0.15 virtual machines that are web servers, 08 lvm Create logical volume 25 network eth0 { This VM uses a an entire replica of a small business net- for storing VM. static address. work, all the test systems for a software 09 size 2GB Size of the VM. 26 address 10.0.0.2 test suite. 10 template ubuntu-client.ext3 27 netmask 255.255.255.0 Projects are defined in MLN configura- 11 nameserver 10.0.0.15 Set the 28 gateway 10.0.0.1 tion files. The configuration file shown name server. 29 switch LDAPlan Connect to in Listing 1 (ldaptest.mln) defines two 12 network eth0 { Config. virt. virtual LAN. net.interface. virtual machines connected by a virtual 30 } LAN. Annotations in the file highlight 13 address dhcp Use DHCP for 31 } the most important configuration set- IP address. 32 tings. 14 switch LDAPlan Connect to Listing 1 starts with the global stanza, virt. switch. 33 switch LDAPlan { } (Create virtual switch connecting 15 } wherein the name of the project is de- the VMs.) fined. Next follows a declaration of a vir- 16 users { kyrre l47/Y.NtB9p7w } tual machine called ldapclient – a Xen (Create user and set encoded host with 128MB of memory built from password.) 022-030_mln.indd 23 13.11.2008 17:57:11 Uhr :FM<IJKFIP MLN Table 1: Working with the mln Command Clearly, writing host stanzas for large numbers of virtual machines would get Action Command tedious. The MLN configuration lan- Build VM mln build -f project-config-file [-r] guage allows you to define superclasses: Reconfigure VM (including live migration) mln upgrade -f modified-config-file named groups of settings that can be Start VM mln start -p project [-h host] applied to multiple hosts. Stop VM mln stop -p project [-h host] Query status of all/ specified projects mln status [-p project] Jlg\iZcXjj List defined projects mln list Listing 2 illustrates the use of a super- Remove a project mln remove -p project class. The superclass, which is called Register a template mln rt -t file-system-image-file basic in Listing 2, provides a bundle of Backup an entire project mln export -p project -d location [-z] settings that are then available for host Restore a saved project mln import -p project -d location definitions. Listing 2 defines three hosts based on the superclass. The third host the template ubuntu-client.ext3. The command to build the virtual machines illustrates the technique of overriding a host has one network interface config- and virtual network inside it. For exam- setting from the superclass. Of course, ured to use DHCP for its IP address. The ple, the following commands create the many more settings could be placed into third stanza defines another Xen host, virtual hosts and network defined in the superclass or individual host stanzas ldapserver, with similar settings, al- Listing 1 and then start the hosts and as required. One project file can include though it is given more memory. Note virtual network: multiple superclasses, and the super- that the second host uses a different classes can even be nested. template as its initial operating system # mln build -f ldaptest.mln Substanzas, such as network interface image and has a static IP address. The # mln start -p ldaptest definitions, which appear both within final stanza defines a virtual switch to superclass and host definitions, are which both virtual machines are con- The build subcommand instantiates the merged. Directives that appear in the nected; this switch allows them to com- entities in the specified project file, and host definition have precedence over municate with one another. the start subcommand boots the virtual directives within the superclass. Most of the settings are straightfor- machines and activates the virtual net- ward, but the template specifications work. ;`jki`Ylk\[Gifa\ZkjXe[ deserve special mention. Templates are Typically, the build subcommand is C`m\D`^iXk`fe pre-fabricated VM filesystems. Each time used only once – initially to create the So far, all the examples have been lo- you build a new virtual machine, you project – whereas the start subcommand cated on a single server. However, MLN specify a template to use as its base. The and its sibling stop are used to activate supports distributed projects in which virtual machine will be individualized and deactivate the project hosts and net- virtual machines are located on one or by MLN during the build process. Some work. more remote hosts. The host and switch people like to use very generic templates By including the -h option, you can definitions in a distributed project re- $$ ' $$ for all their virtual machines and cus- apply the command to a single host quire an additional service_host direc- % & % & tomize them later, whereas others create within a project: tive, which specifies the server location: very specialized templates, like a fully functional LAMP server or a copy of a # mln stop -p ldaptest -h 5 host rem-vm { typical employee desktop. ldapserver vmware The definition for a VMware Server template rhel5.vmdk virtual machine differs only slightly from Table 1 summarizes the most important ... the host definition in Listing 1. The vm- subcommands related to project man- service_host bigvmbox ware keyword is used in the VM host agement. } & definition stanzas instead of xen, and a ! " # VMware format template is used instead Listing 2: Working with a Superclass & . / of a filesystem image. The switch defini- 01 global { project italy } 12 } () ! tion stanza also requires the vmware 02 13 ! keyword. 03 superclass basic { 14 host uno { superclass basic } % *+ , ! " # Valid host and switch names are case 04 vmware 15 host due { superclass basic } 0 ,- $%&&' sensitive and can contain lowercase and 05 template rhel5.vmdk 16 host tre { uppercase letters, numbers, and hy- ""# 06 memory 128M 17 superclass basic () ! phens. ! 07 network eth0 { 18 memory 256MB % *+ , DXeX^`e^MDjn`k_k_\dce 08 address dhcp 19 } :fddXe[ 09 switch lan 20 ,- 10 } 21 switch lan { vmware } ! Once you have defined a project in a configuration file, you can use the mln 11 service_host milano 24 ISSUE 98 JANUARY 2009 022-030_mln.indd 24 13.11.2008 17:57:11 Uhr MLN :FM<IJKFIP Superclasses can include the service_host To move virtual machines from one noted by bigvmbox to the one denoted directive as well (as shown in Listing 2).
Details
-
File Typepdf
-
Upload Time-
-
Content LanguagesEnglish
-
Upload UserAnonymous/Not logged-in
-
File Pages9 Page
-
File Size-