Posts Tagged ‘kvm’

Running Windows on Eucalyptus

August 5, 2009

This post has now been superseded.  See here for the update.

This post details how to create a Microsoft Windows image to run on a Eucalyptus instance with nodes running running KVM. In my example, I’ve created an XP image; a similar methodology can be used for Server 2003 and other NT versions.

The approach should theoretically also work on paravirtualised Xen nodes, though I haven’t tried it!

Windows XP running on Eucalyptus

Windows XP running on Eucalyptus

Create the base image

You first need to create a Windows base image using KVM.  There are already plenty of how-tos around explaining this process, so I won’t go into any detail here.  The critical part is that the install should be onto a SCSI disk image, as this is what Eucalyptus expects.

Generate the bootloader kernel

For this step, you’ll need to download and compile the memdisk component of syslinux.

Syslinux can be downloaded from http://www.kernel.org/pub/linux/utils/boot/syslinux/ .  I just grabbed the latest version.  Extract the archive, switch to the syslinux-<version>/memdisk directory, and compile memdisk using make.  You’ll need to install nasm first, as this is a dependency; to do this on Ubuntu, type:

# sudo apt-get install nasm

Make will compile a number of files into the memdisk directory – you’ll just need the one called memdisk

Create the bootloader ramdisk

This is the interesting part.  Basically, we’re going to create a Windows boot image, which will then launch the Windows virtual machine itself.

First, create a blank virtual floppy disk, using:

# dd bs=512 count=2880 if=/dev/zero of=win-boot.img

Now, attach this image as a floppy drive to the Windows VM you created above, and start the instance.  Format the disk either by right-clicking on the floppy drive icon in My Computer, or through a terminal using format a: (mkfs.msdos doesn’t work here, as the resulting file system isn’t bootable).

Finally, copy the following 4 files from the root of the windows c:\ to the floppy disk:

ntldr
ntdetect.com
boot.ini
Ntbootdd.sys

(for the above in greater depth, see: http://support.microsoft.com/kb/305595 )

Bundle the image

Create the eucalyptus bundles using the same method as for a linux image.  You’ll need the memdisk and win-boot.img files you’ve just created, together with the hard disk image file from the Windows KVM virtual machine.

The command sequence (assuming you have the EC2 tools set up correctly) should be:

mkdir kernel
ec2-bundle-image -i /path-to/memdisk -d ./kernel --kernel true
ec2-upload-bundle -b kernel -m ./kernel/memdisk.manifest.xml
EKI=`ec2-register kernel/memdisk.manifest.xml | awk '{print $2}'`
echo $EKI
mkdir ramdisk
ec2-bundle-image -i /path-to/win-boot.img -d ./ramdisk --ramdisk true
ec2-upload-bundle -b ramdisk -m ramdisk/win-boot.img.manifest.xml
ERI=`ec2-register ramdisk/win-boot.img.manifest.xml | awk '{print $2}'`
echo $ERI
mkdir image
ec2-bundle-image -i path-to/<windows_disk>.img -d ./image --kernel $EKI --ramdisk $ERI
ec2-upload-bundle -b image -m ./image/<windows_disk>.manifest.xml
EMI=`ec2-register image/<windows_disk>.manifest.xml | awk '{print $2}'`
echo $EMI

And that’s it!

Management interfaces for the Kernel Virtual Machine (KVM)

June 8, 2009

With linux distributions increasingly standardising on the Kernel Virtual Machine (KVM) as the hypervisor of choice, it seems initially surprising that there aren’t more high quality management interfaces available.  Most distribution documentation focuses on the use of virsh (a useful command line tool, but not particularly user-friendly), and virt-manager (which shows promise, but seems pretty under-developed and feature-short when compared to the VMWare Vi client and web interface).

A little research, however, shows a number of open source offerings that I’ll aim to evaluate in the quest to settle on the ‘perfect’ KVM administrative interface.  The first 3 are web-based, but each with different aims:

Proxmox VE

Proxmox VE describes its “vision” as to:

“Setup a complete virtual server infrastructure within 1 hour.” Starting from bare metal, it is possible to create a full featured enterprise infrastructure including an email proxy, web proxy, groupware, wiki, web cms, crm, trouble ticket system, intranet … – including backup/restore and live migration.

Nowadays people are faced with more and more complex server software and installation methods. But Proxmox VE is different.

Proxmox VE is simple to use:

  • Pre-built Virtual Appliances
  • Install and manage with a view clicks
  • Selection of products for the use in the enterprise

    Proxmox VE is licensed under GPLv2 (Open source). Open source and commercial Virtual Appliances are supported.

    Url:  http://www.proxmox.com/

    Eucalyptus

    Eucalyptus takes the concept of server virtualisation a stage further, aiming to bring the means to create private and hybrid server clouds in the datacenter.  Currently under heavy development, it forms the backbone of the Ubuntu Enterprise Cloud.  It describes itself as:

    EUCALYPTUS – Elastic Utility Computing Architecture for Linking Your Programs To Useful Systems – is an open-source software infrastructure for implementing “cloud computing” on clusters. Eucalyptus Systems is the pioneer in open source cloud computing technology that delivers hybrid cloud deployments for enterprise data centers. Leveraging Linux and web service technologies that commonly exist in today’s IT infrastructure, Eucalyptus enables customers to quickly and easily create elastic clouds in minutes. This “no lock-in” approach provides users with ultimate flexibility when delivering their SLAs.

    Eucalyptus is more than just virtualization. Along with building virtual machines, the technology supports the network and storage infrastructure within the cloud environment. Eucalyptus works with multiple flavors of Linux including Ubuntu, OpenSuse, Debian, and CentOS. Eucalyptus currently supports Xen and KVM hypervisors.

    Url: http://open.eucalyptus.com/

    Ovirt

    Ovirt isn’t strictly just a management UI; instead the project aims to provide the components required to construct a virtualised infrastructure based on KVM nodes controlled by a management server.  Sponsored by Redhat, its core is a ruby-based web console.  From the project site:

    oVirt is an open, cross-platform virtualization management system. oVirt provides both a small image that runs on a host and provides virtualization services to VMs there, and also a web-based management console that lets you allocate and group hosts and storage, install and remove virtual machines, level resources across a large group of machines, and much more. oVirt is designed to scale from a small group of users with little need for access control and quota management, all the way up to hundreds or even thousands of hosts with robust control over grouping, permissions, and quotas.

    The oVirt host image is a small, stateless Fedora build that is meant to run from a flash drive, a CDROM, or entirely in RAM via PXE … The combination of libvirt and collectd means that a properly set-up remote management tool can securely handle all aspects of virtual machine management and monitoring on the oVirt host.

    The oVirt management console also uses libvirt, along with a kerberos/LDAP server, for secure transport, monitoring, and management. It has several components:

  • A host browser that listens for oVirt hosts to advertise themselves and their capabilities over the network
  • A task engine that reads a task queue from a Postgresql database and makes the appropriate libvirt calls over the transport
  • A Rails-based web UI that allows users to manage virtual machines, view usage and performance statistics and graphs, group and ungroup hosts and storage servers, delegate groups of machines to other users, manage quota and SLA for groups of users and machines, and many other management capabilities.
  • Url: http://ovirt.org/

    The final two I’m examining consist of a feature-rich desktop client based solution, and a command line application that looks potentially quite useful in the datacenter.  These are:

    ConVirt

    ConVirt provides an interesting alternative to a traditional VMWare ESX / VirtualCenter setup, seeming to provide a large subset of VMware’s functionality, but based on an open source platform and free to download.  Covirt gives an overview of their product as:

    ConVirt provides enterprise-class management of open source virtualization platforms, making open source virtualization an extremely viable and cost-effective choice for enterprises. ConVirt lets you manage the complete lifecycle of Xen and KVM virtualization platforms from a central, GUI dashboard. With sophisticated template-based provisioning, centralized monitoring, configuration management and administration, IT administrators can now automate the entire virtual machine lifecycle on open source platforms. ConVirt is an open source product backed by commercial, enterprise-class support, so you get the best of both worlds: a sophisticated, commercially-backed solution that is also highly cost effective.

    Url:  http://www.convirture.com/

    OpenNebula Virtual Infrastructure Engine

    OpenNebula doesn’t really count as a UI, as it’s currently only administered from the command line (though a Ruby-based web interface is planned as part of the GSoC).  It does, however, promise to provide a mature platform on which to build a hybrid or private cloud, incorporating many of the high availability features that the datacaenter requires.  From the website:

    OpenNebula is an open source virtual infrastructure engine that enables the dynamic deployment and re-placement of virtualized services (groups of interconnected virtual machines) within and across sites. OpenNebula extends the benefits of virtualization platforms from a single physical resource to a pool of resources, decoupling the server not only from the physical infrastructure but also from the physical location.

    OpenNebula can be primarily used as a virtualization tool to manage your virtual infrastructure in the data-center or cluster. This application is usually referred as private cloud, and with OpenNebula you can also dynamically scale it to multiple external clouds, so building a hybrid cloud. When combined with a Cloud interface, OpenNebula can be used as engine for public clouds, providing a scalable and dynamic management of the back-end infrastructure.

    Url:  http://www.opennebula.org/

    So there we have it: a varied selection of virtualisation management products to provide control over KVM, each with their own particular focus.  Now all that’s required is the time to get on with the evaluation…