Virtual Machine Trials - p3

Posted by JD 09/01/2008 at 11:30

Back to Part 2

So why would you want to run your desktop in a VM?

There are many reasons. Most of them have to do with the way that Virtual Machines aren’t connected directly with the hardware they run on.

  1. Virtual Hardware: By virtualizing the actual hardware away, gone are the days of searching for funny drivers. You can make every VM use the same virtual hardware.
  2. Easy, complete, full, backup. Since the VM is just 1 or 2 files on the disk of the host, backup is as simple as shutting down the DomU and copying the file(s) off to another media. You can burn a 20GB image to DVDs, CDROMS, or just copy it over a network to another box. There are 3 ways the disks can be setup
    1. Raw disk access – you create a partition outside the normal Dom0 disks and place the DomU filesystem their. This will provide the best disk performance since you are using just a very thin layer between the DomU and Dom0 disk system.
    2. Pre-Allocated Disk – this is a file that is pre-allocated to the maximum size requested. If you ask for 20GB, then the file size is 20GB to start. The performance is good since Dom0 won’t be modifying that file as it grows. The bad is that when it comes time to backup the file, it will be 20GB even if you are currently using just 1GB of space. Compression should reduce this greatly for backups, but that is just an extra step you’ll want to take.
    3. Automatic growth Disk – this is the most efficient from a disk use perspective, but the worst performing for the disk subsystem. Backups will be just a tiny bit larger than the actually used space. For trying out VMs, this is usually the first way to go since it doesn’t require a big investment in disk or backup effort.
  3. Easy full, complete, restore; Since you backed up the COMPLETE VM, restoring that file under another VM host will put you back to exactly where you were with all settings intact. Your laptop gets dropped in the airport before the largest meeting of your life? No problem, buy another at Best Buy and load your VM overnight from your backup. When you startup the DomU, everything is just as you left it. Emails, contacts, programs, and data. Everything.
  4. Snapshots – these are internal backups managed by the virtualization host. I create a snapshot before installing a new program or going on a trip or trying a new driver. If anything goes bad, I drop back to the old point. Imagine you’re going on a trip where internet connectivity may be forced through undesirable hotel connections. Virus risk is high. Do a full backup before you leave home and a snapshot before you hop on that network. Any issues? drop back.
    1. Think about that just a little. You can go back to where you were … afraid of viruses? Create a snapshot – do the dangerous thing, then drop back. No worries.

What’s the downside?

  1. Complexity – obviously, setting up Dom0 and DomU isn’t as easy as setting up a normal PC. However, once it is setup, you don’t need to know very much about it. Don’t forget to backup your DomU.
  2. Possibly performance, but probably not. This is less of an impact now that new CPUs have virtualization hooks in them. You probably just need to enable them in the BIOS of your system before booting.
  3. High End Gaming – Yep, if you run games that need direct access to the video card, then VM isn’t for you. However, if you run Real-Time Strategy Games or games from 5 years ago, then at lease VirtualBox has you covered.
  4. Higher Hardware Requirements. This is true. You’ll need more disk, more CPU and definitely more RAM to use VMs instead of not. Let’s look at each of these.
    1. More Disk – a VM needs another copy of your OS. Everything else related to disk is the same as what you’d need to run the programs and have the data without a VM.
    2. More CPU – Just a tiny bit more, say 5% so I wouldn’t worry about this. Modern PCs with dual core CPUs are faster than you can use except for video editing. Well, if you’re running Vista, call that 10% – it really is a hog.
    3. More RAM – this is the biggest issue. Unless your computer has 4GB or more of RAM, you will probably need to be careful running VMs. I’m setup with 2GB for Vista and 2GB for WinXP on my DomU. My main concern was giving each DomU the amount of RAM is needs for the workload I perform. No more, no less. Vista on Dom0 will get whatever is left, but no less than 512MB. A Dom0 with resource problems isn’t good for any of the other domains.

The Future

I plan to load Ubuntu Hardy on my laptop soon, but that OS runs very nicely with just 256MB of RAM and 5GB of disk.

I may setup DSL and PuppyLinux DomUs too, just to have them for family and friends who’ve never seen Linux. They each run with 64MB of RAM and 150MB of disk. With checkpoints, I can let them go crazy in the DomU and drop back to a fresh startup when they are done.

Back to Part 1 |
Back to Part 2

What other people have to say

Virtual Machine Trials - p2

Posted by JD 09/01/2008 at 11:03

Continued from Virtual Machine Trials – p1

  • Xen
    Xen has a host, Dom0, and a client, DomU. I’ve been using Xen on my Linux hosts for about 8 months. Unfortunately, it wouldn’t load WinXP without a fairly recent x86 CPU – something within the last 2 years. At the time, I was using an Athon 1800+ for this blog and a few other services.
    Setting up Xen after installing Ubuntu 8.04 LTS “Hardy” is almost trivial. A single `apt-get install ubuntu-xen-server’ was it. Next create a small DomU for testing so you get the hang of running under Xen. Starting, stopping, checkpointing, etc.
    I like Xen. It is stable, maintainable and, in theory, you can run almost any x86 OS if you have current CPU. As with all VM technologies, RAM will probably be the first limit to your number of running VMs. Today. I’m running:
    • Hardy Dom0
      • Hardy DomU – blog
      • Hardy DomU – mail
  • VMWare Server
    I used VMWare Server a few years ago on different machines in the house, a laptop and a server Linux machine.
    On the linux server, there were issues since it must attach internally to the kernel. That means you have to relink the kernel whenever the kernel or vmware server changes. At a point, that became too much of a hassle to continue.
    On the Laptop, the only issue was with performance. VMs under it were slow. The Dom0 was WinXP and the DomU was ‘DSL’ and ‘Puppy Linux’ – both distributions are designed to run on minimal hardware with very low resource requirements. Since I had performance issues, I stopped using them after a few days and uninstalled VM-Server.
  • VMWare ESXi
    My experience with this host is extremely limited. VMWare announce they were making it free to use, so I registered and pulled a copy down. It is known for being an extremely tight host with minimal overhead. I don’t know. It wouldn’t install on either of my servers or on my laptop. It couldn’t find any disk drives in those machines. Free is nice, but not when your hardware isn’t supported AND doesn’t work at all.
  • MS-Virtual PC
    Free. I hate MS, but with Vista this was an obvious choice for supporting VMs. I loaded it, it worked mostly, but the video performance was poor. Uninstalled.
  • Sun VirtualBox
    I tried this solution about a year ago. It took a little tweaking to get the networking right and didn’t honor my laptop power settings. Basically, the DomU was always “on” which cased the fan to run 24/7. Performance was good, better than any of the other solutions. I had high hopes for this solution. After re-reading the license again, I determined it was safe to use on my laptop and installed it.
    • Vista-64 Dom0
      • WinXP DomU

It is fast – like native fast. Graphics are good enough to perform video editing. Wether running in full screen or window-ed mode, it performs very nicely. Again the networking took a little to get configured properly. The trick seems to be to use the Intel 1000 Pro network adapter. WinXP doesn’t come with a driver for this, so you need to pull it down from Intel.com. I’m running in “host” network mode. I’m very happy with VirtualBox.

See why you’d want to run your desktop in a VM in Virtual Machine Trials – p3

Virtual Machine Trials - p1

Posted by JD 09/01/2008 at 10:46

So mein laptop ist kaput. It fell about 16" to the carpet and never worked again. The disk drive seems ok – I’ve pulled all the data from it already. I also had a backup from the night prior to this accident stored on another server here.

I purchased a new laptop using a huge discount" – it should be blazing fast; core 2 duo, 4GB ram, 320gb drive. It has more memory than either of my servers! The only issues is Vista-64bit. The suckage is high.

Anyway, that’s how I got where a virtual machine setup became necessary. WinXP is the right answer for a business, not Vista and certainly not Vista-64 bit. When I first booted this laptop, I was shocked on how slow this new machine was. It really was slow. Simply amazing. I shutdown as many services, set the desktop to “classic mode” and installed antivirus software.

So, which Virtual Machine Host should you use?

Virtual Machines, VMs, are a good answer for running other operating systems without a big commitment in hardware or disk. Google will help you understand them better.

There are a large number of VM hosts out there. I’ve used many of them. Most for just a few hours, but occasionally for months. We will only worry about x86 compatible VM hosts, not that IBM, HP, and Sun don’t make excellent VMs. I’ve personally used VPAR, NPAR, LPAR, Containers and Domains – they work within the fairly minor limitations. x86 VM Hosts are mostly free for personal use and some can be used in a business for free too.

That’s enough setup in the next article. I’ll go into these VM Hosts in the next.

  • Xen
  • VMWare Server
  • VMWare ESXi
  • MS-Virtual PC
  • Sun VirtualBox

Part 2

Xen and Zimbra

Posted by JD 08/21/2008 at 12:09

What I need:

  1. Zimbra server running under Xen
  2. Prefer Ubuntu 8.0x LTS as Dom0

The problems seen doing this so far are:

  1. Prefer an Ubuntu-based DomU – <— couldn’t get the zimbra supported version to load
  2. file: needs to be replace by aio:tap: for some reason in the cfg file
  3. Tried CentOS-5 via bootstrap – didn’t work
  4. Tried CentOS-5 via rinse – didn’t work – stuck at maintenance boot but didn’t know the root password
  5. Replaced the CentOS image file with another … and got further after switching from hda2 into sda1 in the cfg file based on error. But the start up had many, many issues – missing modules – i.e. FATAL problems
  6. Along the way, there have been numerous other issues to be solved (NIC drivers, vbd device limits, etc)

There needs to be an easier way and one that actually works with the scripts would be really nice too.

BTW, getting a xen hardy DomU installed is trivial. It will be nice when Zimbra supports the current 8.04.x LTS, which they have committed to do … someday.

Ok, someday seems to be TODAY! YIPPY! 8.04 supported!

10/18/2008 Update

It has been a few months since we started using Xen for our infrastructure. The jury is still out on whether it is a success or not. Two days ago, I would have said it was a complete success … until more of the MAJOR network issues happened yesterday – a Friday.

Some of the DomUs became really slow to access over both the network and by the console. The Dom0 became nearly impossible to access. Ping had 88% packet loss both from other machines and between DomU and Dom0 attempts (once I finally got a connection). Not good. Long periods of un-responsiveness to/from both Dom0 and DomU from other non-virtual machines got really, really bad. It is terrible this morning as I write this.
Last night, I implemented these changes:

  1. to the /etc/network/interface file
    • DomUs: post-up /usr/sbin/ethtool -K eth0 tx off
    • Dom0: post-up /usr/sbin/ethtool -K eth0 tx on
  2. to the /etc/rc.local
    • mv /lib/tls /lib/tls.disabled

So every reboot will reset tls to the desired value – gone. That last command is part of the server setup. It came back, probably due to an apt-get upgrade.

Neither of these changes appear to matter this morning.

How to install Zimbra on Ubuntu 10.04 LTS

Xen and WindowsXP? Huh?

Posted by JD 06/06/2008 at 17:20

Ok, so I’m migrating my servers from Ubuntu 6.xx to 8.xx and adding Xen virtualization along the way.
So far:

  1. Regulus – Athlon 1800+
    1. Xen Dom0 (reg0/regulus) running 8.04 and Xen from the Ubuntu repository.
    2. 1.2GB RAM
    3. 2×250GB Disks (sw mirrored)
      1. Dom1 – reg1 256MB RAM w/ 2GB Virt Disk
      2. Dom2 – reg2 256MB RAM w/ 2GB Virt Disk
  2. Romulus – Core 2 Duo still at 6.xx
    This blog is running on reg1 at near native speed.

Next, we will:

  1. Migrate the old website from romulus —> Dom2 (it will still be slow)
  2. Update our load balancer to use the new xen1/2 domains for all traffic
  3. Validate that email, web, SIP, and other traffic works without romulus powered on. Romulus has an external array attached to it, so we’ll lose most of our protected storage.
  4. Unplug the external array, do an upgrade upgrade from 6.0x → 7.10 → 8.04 with Xen – not touching the HOME directories. We hope no data lose happens, but it will. It will just be OS related data loss, not HOME or external array stuff.
  5. Bring Xen up on romulus Dom0, rom1, rom2, rom3, rom4.
  6. Romulus is an Intel Core 2 Duo E6600 that is only pressed into real CPU service running 2 mencoder jobs at the same time. Hardly a worthwhile experience for a CPU like this. It also has 2GB of RAM and well over a TB of external storage in RAID5 config.

There is a risk that we could lose access to the external array – it uses software RAID, not hardware.

As I’m writing this, it seems I’ll need a better method for naming servers with Xen domains on them to limit confusion. – Romulus – rom0, rom1, rom2, rom3 …. Regulus – reg0, reg1, reg2, etc. With matching IP addresses .41, .42, , .51, .52, .53 ….

Why bother with all this?

  1. WinXP runs under Xen iff the processor supports VT in hardware. My Athlon doens’t, but the E6600 does. Having an XP machine available will be nice – that is, besides my aging laptop that’s almost 4 years old and still going, but has been beeping every 30-45 minutes for over 2 years.
  2. Protected storage – all the Dom1-Dom2 will be on RAID5 storage.
  3. Nice monitor, keyboard, mouse -
  4. Lower noise
  5. Lower heat means lower power consumption – my server room/office gets really warm during the summer.