Migrating from VMware ESXi to QEMU/KVM

For a myriad of reasons, I have been looking at alternatives to VMware ESXi for a few months. Virtualizing a few machines here and there has proven educational. Learning the ropes of working with qemu/kvm, libvirt, and virsh has been challenging at times, but overall a pleasure to work with. Working with kvm is great although it takes some getting use to coming from a VMware/ESXi centric environment.

Up to this point all of the virtual machines that I had worked with were new systems. After some research and a few backups of my current VMs running on one of my ESXi hosts, I decided to migrate a few production VMs. Here are the steps that I used to move virtual machines over from a licensed vSphere 4.1 installation to a Linux host running qemu/kvm.

For starters, be sure that you have full backups of any VMs that you plan on working with. With that out of the way, you are ready to start:

1. Remove all snapshots from the virtual machine across all virtual disks.

2. Uninstall VMware Tools and then perform a clean shutdown of the guest operating system.

3. Copy the virtual hard disk(s) over to the qemu/kvm host. The virtual disk is typically the largest file within a VM’s directory and will usually be named something like ‘guestname-flat.vmdk’

4. On the qemu/kvm host, change to the directory containing the .vmdk file. Assuming you are using qcow2 disk images, run the following command to convert the .vmdk: kvm-img convert -O qcow2 guestname-flat.vmdk newguestname.qcow2

5. Create a new VM on the qemu/kvm host and choose the recently converted disk image as your existing drive/image. It is important that you create your new guest with the same or similar settings as it had before. I recommend cloning the MAC address over to the new guest for added simplicity with NIC detection, assignment, and third party software licensing.

6. Attempt to boot the system. Depending upon your guests virtual disk settings and other factors, the system may hang during boot. Edit your virtual machine and set the controller type to SCSI assuming that was the controller type back on ESXi.

At this point your system should be up and running on the new host. I did find notes and suggestions that qemu/kvm can run vmdk files/disk images, but there seemed to be a handful of caveats so I decided to convert the vmdk’s over to a native format.


HP ProLiant MicroServer Flexibility

I’ve been meaning to put some of my thoughts on the HP MicroServer N40L for quite some time and just haven’t made the time to do it, so here goes.

Long ago I was searching for a reason to purchase and play with HP’s MicroServers and got my chance when a client asked for an affordable backup device. I jumped at the chance and ordered one of the N40L’s. These units are listed as part of the ProLiant family of servers which sounded promising, but being the skeptic that I am, I didn’t expect much for the seemingly measly $350 price tag.

The unit comes with an AMD dual core CPU, 2GB of RAM, 250GB HDD, and a 1Gbps NIC. The system has a mini-PCIe slot for a remote access/iLO/DRAC type card, and a second standard PCIe slot. Although the system ships with only a single drive, all four bays have “hot swap” trays/carriers, making adding additional disks no problem. I say “hot swap” because I am pretty sure that the backplane/controller do not allow actual hot swapping in its true sense, YMMV. Another note on the hardware; the motherboard can be easily removed from the system by disconnecting a few cables and backing out two thumb screws. The board is on a simple and quite brilliant tray assembly which makes removal, upgrade, and insertion simple. Do yourself a favor when you purchase the system by maxing out the RAM at 8GB(DDR3/ECC) and adding the optional iLO/remote access card. For basic NAS and low end Linux server duties the 2GB will work fine and you will have no regrets, but going to 8GB really opens the doors, more on that next.

Before I jump into exactly what it can do, it is worth mentioning what YOU should not do with it. For instance, don’t try and be a hero to your clients by touting this as an ultra affordable server solution. I have read of several people putting SBS on this box and then using it as the primary file and mail server for 20+ users. Don’t be a dummy, if you’re trying to service your clients properly get them a truly redundant system with hardware RAID, dual PSU’s and things of that nature. You are providing a disservice to your clients if you use this in a place it should not be used. Responsibility rant over…

With the remote access card, 8GB of RAM, and a couple of SATA drives, you are ready to play. This is the little server that could and it shows. The thing runs VMware ESXi5, Linux, Windows, FreeBSD(FreeNAS) and many other things. An important thing to remember is that the included disk controller uses fake RAID/driver assisted RAID so don’t expect RAID support outside of Windows. With that limitation in mind, this makes the ideal small business backup device, home virtualization lab, or any other number of roles you can through at it.

Fast forward to today and the device has served me and many others quite nicely. Although not a comprehensive list of installs, I can confirm successful installation on the following operating systems:

  • Debian Lenny (i386/AMD64)
  • Debian Squeeze (i386/AMD64) Currently Debian stable release
  • Debian Wheezy (i386/AMD64) Currently Debian testing release
  • Ubuntu 10.04 (i386/AMD64)
  • FreeNAS 0.7 (i386)
  • FreeNAS 8 (i386/AMD64)
  • VMware ESXi 4.1
  • VMware ESXi 5.0
  • Windows Server 2008 R2
  • Windows Small Business Server 2011
  • Whew! What a list and that just touches the surface of what you can run. Those just happen to be the configurations that I have tested with success. My current configuration consists of the base system running 8GB of RAM, iLO card, 1x64GB SSD and 4x1TB RAID edition drives. I’ve got Debian stable AMD64 running on / and have 4x1TB RE drives using Linux md RAID in level 5 mounted on /home. This acts as my internal NFS server and virtualization lab. The system runs vm guests well through KVM although you will have to watch the CPU. Being a dual core 1.5GHz, the system will usually run out of CPU before you hit any other bottlenecks.

    In conclusion, if you need a flexible and affordable storage device for most small business or home needs, a cheap virtualization lab in a box, or similar configuration, you will not be disappointed by this device.


    Debian Squeeze & Broadcom b43 etc

    So you like Debian, and why wouldn’t you, it is great after all. Unfortunately, many laptops come from the factory sporting Broadcom-based chipsets. So inevitably I complete a Debian install and Broadcom takes the wind out of my sales. I then trudge over to http://wiki.debian.org/wl#Squeeze and go through the paces. Why? I do it over and over. Well enough is enough, I mean this isn’t a tricky script to write. So for your enjoyment, I have put it all together into a small bash script to simplify things for future installs. First, be sure to add the non-free repo to your /etc/apt/sources.list file.
    Then create and run a .sh file containting:

    aptitude update
    aptitude install module-assistant wireless-tools
    m-a a-i broadcom-sta
    echo blacklist brcm80211 >> /etc/modprobe.d/broadcom-sta-common.conf
    update-initramfs -u -k $(uname -r)
    modprobe -r b44 b43 b43legacy ssb brcm80211
    modprobe wl



    Got old-buntu? Ubuntu EOL 9.10 to 10.04 Upgrade Mini HowTo

    So several months ago, I like the rest of the world, was notified that end of life (EOL) for Ubuntu 9.10 Karmic Koala would happening. In the news blurb/mailing list, wherever I found it, I walked away thinking that security updates would cease to exist.

    In preparation for the upgrade, I went ahead and cloned the 9.10 server and proceeded to upgrade the server to Ubuntu 10.04 Lucid Lynx. This went off without a hitch from what I could tell and I scheduled the upgrade of the production server with my last client running 9.10.

    Without fail, life happens, clients have things come up, and the upgrade never happened. Fast forward to present day and time, and my client tried installing a package using apt-get and received a slew of errors. Looking into the issue a bit further and I found the repositories gone. Interestingly enough, when EOL occurs for an Ubuntu release, it really ends, and not just for the security patches.

    So one is left wondering, “how can I sudo apt-get install update-manager-core & sudo do-release-upgrade when I can’t even do a simple sudo apt-get update?” Solution: EOL upgrade. There are several different ways to go about this, the best are detailed here. At the time of this writing, the link is a little unclear about how to get 9.10 to 10.04 so here is the quick and easy way:

    1. Backup your current sources.list:
    sudo mv /etc/apt/sources.list ~/sources.list

    2. Create a new sources.list:
    sudo vim /etc/apt/sources.list

    3. Add/paste in archive release repositories substituting CODENAME for release jaunty, karmic, etc:

    ## EOL upgrade sources.list
    # Required
    deb http://old-releases.ubuntu.com/ubuntu/ CODENAME main restricted universe multiverse
    deb http://old-releases.ubuntu.com/ubuntu/ CODENAME-updates main restricted universe multiverse
    deb http://old-releases.ubuntu.com/ubuntu/ CODENAME-security main restricted universe multiverse

    # Optional
    #deb http://old-releases.ubuntu.com/ubuntu/ CODENAME-backports main restricted universe multiverse

    4. Update repositories and install update manager
    sudo apt-get update
    sudo apt-get install update-manager-core

    5. Initiate the upgrade
    sudo do-release-upgrade

    6. Enjoy!


    Ubuntu Maverick Meerkat 10.10 Netbook Performance Issues

    Being that it is my job and my nature to keep systems running, I generally don’t upgrade OS’ quickly. Doing so introduces change which in turn breaks things. After performing an install of the latest version of Ubuntu Netbook 10.10 I found the performance to quite poor. After a quick Google search I found that I was far from the only one with the issue. You can follow more on that here. It is worth mentioning that I had this installed on an HP Mini 311 which is one of the faster netbooks available at the time of this writing. I went back to 10.04 and it is now a useful system again.


    Crontab Generator Makes Scheduling Even Easier

    For those that have never used crontab, it can be a daunting task to schedule a simple script. As with all things, I highly recommend that you learn the meanings of CLI programs and their usage etcetera. With that said, I wanted to check my crontab job against a generator of sorts just to be sure I had it right. If you want a simple click and go on crontab generator, I recommend using the one provided by HTML Basix. Enjoy!


    Calling all Ubuntu fans

    This week I joined the Ubuntu LoCo Florida Team and participated in last night’s team meeting (via IRC).  Seems like a great group of people AND an excellent way to get more involved with Ubuntu (and really any Linux).

    In addition to the IRC meetings, there are scheduled meetups to perform various activities such as installing networks for youth homes/schools, bug testing, documentation writing, and just plain fun. Anyone out there enjoy bar-b-que and beer???

    I look forward to greater involvement!

    If you have no idea what IRC is and need a Linux client to get started, I recommend xchat (sudo apt-get install xchat)

    For more information and to join:

    – habanero_joe

    Open Source for Schools

    Why Linux and open source matters for small businesses and schools Hans Knobloch, Philadelphia Information technology Examiner

    This blog was shared with me last night and I think the points made for using open source (linux) are right on target. The general public may or may not choose to accept this but business use of open source products continues to rise. Especially in this economic climate. (the reason this blog was started!) A quick Google search will reveal that there is an open source tool for just about any business need. This means freedom from initial software purchase, recurring license fees, etc.

    Rockin’ on without Microsoft David Becker, Staff Writer, CNET News

    This post is from 2003 and shows that even six years ago it was possible to convert to open source and continue as a successful business. It is easier today.
    Linux is no longer relegated to the dark recesses of IT Geekdom. Major hardware vendors sell desktops and laptops pre-loaded with various distributions of Linux. A non-technical co-worker recently bought a mini-notebook loaded with Linux “because it was cheaper” and learned how to use it.
    As virtualization projects grow in the SMB and education markets, there is often a natural progression towards open source related tools. Advanced configuration and troubleshooting of VMware ESX or Citrix XenServer hosts requires understanding and use of SSH and linux-based file systems.

    Quoted from the blog post:

    ” Here are some facts about free and open source software and Linux:

    • A typical Linux and free open source software equipped PC will cost up to 60 – 70% less to operate over a typical three year write off time.
    • A typical PC hardware suited for Linux does not need to be as expensive as a typical Windows or Mac OS X PC. Linux requires much less resources. As a result, Linux PCs have an extended average lifetime.
    • Linux with typically installed quality programs, used for graphics, office, music, and Internet, are freely available as downloads from the Internet.
    • Linux versions, like Ubuntu, come with a host of no charge business software.
    • Pre-configured Linux versions, like the Ubuntu derivate Edubuntu, come with a host of no charge educational software, including teacher and student administration programs.
    • Linux installations can be upgraded and maintained without additional costs – ever.
    • Linux is much more stable and usually safer than its proprietary alternatives.
    • Linux is much less virus endangered than Windows or Apple OS X.
    • Linux is easy to learn and behaves in many ways just like Windows or Mac OS X.
    • Company specific software solutions are available where needed from commercial vendors.
    • Vendor supplied or vendor independent support programs are available if the need for professional support arises.
    • Hundreds of Linux end user and administrator forums on the Internet provide cost free support, configuration and installation how-to information, and help desk services.
    • Linux, with its open source character, is ideally suited to teach students the working of a modern computing system, better then any of its proprietary competitors. “