New Linux tool helps manage guest virtual machines

By Rodney Gedda, Computerworld Australia |  Virtualization, Linux Add a new comment

With the increasing prevalence of virtualization comes the greater need for management of "guest" operating systems that run as virtual machines on the hypervisor, and the tool called libguestfs is set to provide that on Linux.

Libguestfs is a library for accessing and modifying guest vms and can be used for making batch configuration changes to guests, viewing and editing files inside guests, getting disk statistics, migrating between virtualization systems, performing partial guest backups and clones, cloning guests and changing system information of Linux and Windows guests among other things.

Developed by Red Hat emerging technologies software engineer Richard Jones, libguestfs overcomes the "constant problem" with virtualization management of how to "see inside" the guest virtual machine.

"You can measure things like how much CPU it's using or how much network traffic it generates, but people often ask how much disk space a guest is using (not allocated, but actually using)?" Jones said.

"Did the guest boot up correctly? Can you install virtio drivers in that guest? Can you add a disk to a guest and change its /etc/fstab at the same time? Can you migrate a guest from Xen to KVM, uninstall the Xen PV kernel and add the right KVM drivers?"

Libguestfs uses Linux kernel and qemu code, and can access any type of guest file system that Linux and qemu can, including ext2/3/4, btrfs, FAT and NTFS, LVM, different disk partition schemes, qcow, qcow2, and vmdk.

"What we need to use is the Linux kernel code directly," he said. "The whole thing runs inside a qemu container, and we talk from a small library to the userspace inside qemu, giving it instructions like 'edit this file', 'run this program', 'install this device driver'."

The library can be linked with C and C++ management programs and has bindings for OCaml, Perl, Python, Ruby, Java and Haskell. It can also be used from shell scripts or the command line with the guestfish utility.

"The beauty of this is that Linux already has the drivers to handle numerous different file systems, LVM, partition types and so on," Jones said, adding all the complexity is "hidden" inside the libguestfs library.

"The qemu process can decode qcow2 and a variety of other containers. We can even run an NFS server inside the guest and mount file systems on the host."

    Add a comment

    Post a comment using one of these accounts
    Or join now
    At least 6 characters

    Note: Comment will appear soon after you have activated your account.
    Obscene/spam comments will be removed and accounts suspended.
    The information you submit is subject to our Privacy Policy and Terms of Service.

    ITworld LIVE

    VirtualizationWhite Papers & Webcasts

    White Paper

    AppAssure vs Backup Exec

    In this new Lab Report, openBench Labs examines AppAssure backup and replication software v4.7 with Symantec Backup Exec 2010 R2. AppAssure implements changed-block tracking technology to provide data protection for both virtual and physical servers in specific OS environments. In contrast, Backup Exec 2010 R2 uses traditional file-based backup to promote compatibility with the largest number of operating systems.

    White Paper

    Top 5 Requirements for Backup of Virtual and Physical Servers - Greg Shields, Microsoft MVP

    Reports by leading industry analysts like Gartner, IDC and Concentrated Technology suggest virtual servers in 2011 will eclipse physical servers in total server deployments. The majority of today's business computing environments already have both virtual and physical servers at the same time.

    White Paper

    Lab Report - Optimizing VM Backup for VMware and Hyper-V

    Data centers are becoming more difficult to manage and protect as more data and applications are moved into virtual environments. Adding fuel to the fire, CIOs must now deal with corporate mandates to build an IT infrastructure that scales to unknown demand levels and provides service assurance for fluctuating conditions that cannot be accurately projected. The solution is a transition to a private cloud characterized by a hypervisor-independent Virtual Infrastructure (VI).

    Webcast On Demand

    Managing Enterprise Mobility Costs

    Mobile employees, especially those traveling internationally, were spending time and resources finding and making connections. Roaming costs were out of control. The IT Administrator at The Hay Group tells you how he got more control over these costs, providing management with predictable budgets and insights while ensuring employee productivity.

    Sponsor: iPass

    White Paper

    Forrester Total Economic Impact (TEI) Case Study - Oracle

    In this paper, Forrester Consulting examines the total economic impact and potential return on investment (ROI) realized by three Enterprise organizations as they virtualized mission-critical Oracle databases on the VMware vSphere platform. The purpose of this study is to provide readers with a framework to evaluate the potential financial impact of VMware vSphere on their organizations.

    See more White Papers | Webcasts

    Ask a question

    Ask a Question