Thursday, October 09, 2008

F10-beta VM Memory Management

Sadness. Gone is the ability to dynamically change the memory allocation for a VM. Previously, we could change the RAM on the fly:
# xm mem-set 7 256
This was a nice feature, especially for loading new software packages. Since the xm command is gone, the new format is:
# virsh setmem vinci 256000
libvir: QEMU error :
this function is not supported by the hypervisor:
cannot set memory of an active domain

The first thing to notice is the memory must be stated in kilobytes rather than megabytes (how very 80's.) Second, the big nasty error message. In passing, the xm command was issued on an FC6 system, and used the domain number rather than name. In F7 and F8, you would use the name, as in F10.

Will there be a significant impact? Yes. This will impact the density of VMs on a host, but that's assuming the sysad is a perfectionist, like myself. In production, its probably not a big deal. After all, Vmware does not allow dynamic RAM allocation... Until 2009.

Wednesday, October 08, 2008

First Impressions: F10-beta Virtualization

My first impression of Fedora 10 Beta's virtualization suite is:
            WOW!

Somebody did something right.

1. We no longer must build a VM at 256Mb of RAM. I don't know what the low limit is, but that's nice.
2. Via GUI, ability to autostart a VM at boot.
3. VM's that Pixie boot. Mind boggeling!
4. Via GUI, connect to a CD in the host or a shared ISO.
5. VM sound support.
6. The ability to define infrastructure storage.
7. Via GUI, create new LVM's for VM images.
8. Ability to run TLS encrypted console windows.
9. Flat text config files under /etc/libvirt/qemu. Oh, how I hated having to export the XML from F7.
10. An F8 VM up in under 10 minutes.
11. Via GUI, take a VM screen shot... NOT a snap shot!
12. Ability to close virt-manager, and keep VM console connections.

Installs and works like a dream.

Tuesday, October 07, 2008

Fedora 10-beta Virtualization

It seems I am the first person on Earth to ever work with Fedora 10's virtualization technology (and Kickstart, too, which is totally FUBAR.) If you don't believe I'm the only person using it, try to search out a HowTo. So where are the HowTo's? Seems we are on our own while F10 is rawhide. At issue is the fact the Red Hat Virtualization has had to be completely redesigned, as evident by its removal from F9.

So how do we use this puppy? Let's find out:

The first thing you may notice is the lack of a Xen kernel. The good new is that we just install and select the Virtualization group. The bad news is that instead of a traditional hypervisor, we now have more of a virtualization engine. Among other things, this means no para-virtualization, and we must have VMX/SVM CPUs Once the system is up, we start virt-manager.

First, we connect to the virtualization engine (I'm going to coin the new term VE) by clicking File / Add Connection. Choose QEMU and Local, click Connect. Don't bother trying to connect to Xen.

I think one of the most complicated parts of this is going to be getting the network on line. First thing I noticed was that it was bridged to the 192.168.122.0 subnet. The easiest way to fix this is to right click the qemu connection and select Details. On the Virtual Networks tab, click the + symbol at the lower left. Walk through the wizard using the same subnet as one of your physical network cards. Initially this will provide a NAT'ed outbound only connection.

Back at virt-manager, click New, and walk through the VM creation wizard. Click Finish, and... Son Of A Bitch! It worked. The first time! It worked. I can't believe it! It worked.

Just for fun, lets hit the command line:
# virsh list
Id Name State
----------------------------------
2 Virgil running
Slightly different than what I'm use to. Notice the xm command is gone (remember Xen is a naughty word now.) Needless to say it will take some time to figure out the new commands, but virsh has always been in the background, so it shouldn't be too difficult.

Friday, September 26, 2008

USB Flash Raid for VM

Because I have entirely too much time on my hands, and this is entirely too cool, I have granted one of my Xen VM's access to two USB thumb drives as a Raid Level 1 mirror. Turns out, this taught me a solution to previous problem, as well.

I inserted the two drives in the Dom0 system, where they appeared as /dev/sda and /dev/sdb. I used fdisk to set their types to FD = Linux raid autodetect. Next, I assigned them to the DomU:
# virsh attach-disk valkyrie /dev/sda hdc
# virsh attach-disk valkyrie /dev/sdb hdd
From DomU, define the raid
# fdisk -l 2>/dev/null | grep "/dev/hd.1"
/dev/hdc1 1 489 31270+ fd Linux raid autodetect
/dev/hdd1 1 489 31270+ fd Linux raid autodetect
# mdadm -C /dev/md0 -l 1 -n 2 /dev/hdc1 /dev/hdd1
mdadm: /dev/hdc1 appears to contain an ext2fs file system
size=31268K mtime=Fri Feb 9 13:12:40 2007
mdadm: /dev/hdd1 appears to contain an ext2fs file system
size=31268K mtime=Fri Feb 9 13:12:40 2007
Continue creating array? y
mdadm: array /dev/md0 started.
# mke2fs -j /dev/md0
Mount per SOP.

Unfortunately, this is not persistant across reboots. For this, we need to edit the VM's config file and change the disk line to include:
disk = [ "tap:aio:/xen/valkyrie.img,xvda,w",
      "phys:/dev/sda,hdc,w",
      "phys:/dev/sdb,hdd,w"
]
That should get it.

Friday, September 19, 2008

Windows 98 under Xen: Pt 3

Another "I give up". This is one of those "of course it works... so why bother testing it" situations. From all indications and documentation, it should be supported. Having said that, I can find no evidence of anyone successfully running W98 under Xen.

Maybe if I continued to try, I could get it to work. But you know what? Its just not worth it, because I have a plan. Let's paravirt Fedora, VNC in, and run our W9x application in Wine, instead.

Wednesday, September 17, 2008

Windows 98 under Xen: Pt 2

Oops. That didn't work as well as I'd hoped. This should teach me not to post simply because the install started. (Probably not.)

Once the W98 VM rebooted, it reported Invalid system disk. I did two things to correct this. First, I ensured the LVM partition was set to 500M, as W98 did not provide native support for disks over 512M. Second, I booted from the CD, and rather than installing, selected recovery mode. From there, I fdisk'd the partition to ensure the MBR was set properly.

After a second install, the VM booted (better than before), but crashed as a result of VCACHE: Windows protection error failure.

I Got A Promotion


Apparently, Verisign says I'm the CEO of RedHat. Pretty good trick, considering I've not worked for them for about a year. What's really amazing is the deal they are offering: A 2G falsh drive! Wow!

Click image for full resolution.

Windows 98 under Xen

As I continue to have more and more fun with Xen, I wanted to virtualize a couple old Windows systems. You won't believe my motivation... I only have one license for Windows XP, but wanted a couple other machines. Yes, that's right: I didn't want to pirate XP. Imagine that.

Since I have a couple copies of 95 and 98SE in the filing cabinet, it was time to give them a try. I couldn't get the wizard to work, but had better luck from the command line. The first trick was to add another packager, virt-viewer. The following launched an install:
# virt-install -n VM02-w98 -r 270 -f /dev/vg0/vm2w98 -l /net/scully/var/ftp/iso-w98se/w98se.iso -v --vnc

The first pass required that the virtual disk be intialized, and required a reboot of the guest. The reboot failed, however, forcing me to issue:
# virsh destroy VM02-w98; virsh undefine VM02-w98
This was followed by a second install command, which proceeded as normal.

Monday, September 08, 2008

Cosmic Motors Gallery

Check out Daniel Simon's Super Cool Sci-Fi Cars From Another Galaxy. Great pictures, but I still think aliens shouldn't be speaking English.

Saturday, September 06, 2008

No "Raw Device Mapping" for Xen

One invaluable feature of the Vmware ESX architecture, is the Raw Device Mapping (RDM). This allows a virtual machine to access a partitions and format it using the "native file system of the guest operating system." (In other words, a Windows VM would format it as NTFS. A Linux VM would format it as EXT3.) The advantage to this is that a physical machine could easily access the same data, should the VM crash or become corrupted.

Unfortunately, this doesn't seem to work as I had hoped under Xen. I carved a partition out of Dom0's hard drive and mapped it to the VM:
# virsh attach-disk valkyrie /dev/hda7 xvdb
This failed, until I formatted the partition. That makes sense.

Once the partition attached, the DomU could see the partition as a separate drive, but not as file system. It was necessary to fdisk /dev/xvdb, then mke2fs -j /dev/xvdb1. So far, so good. The tricky part came when I tried to access partition from Dom0:
]# virsh detach-disk valkyrie xvdb
# mount /dev/hda7 /mnt
mount: wrong fs type, bad option, bad superblock on /dev/hda7,
missing codepage or other error
In some cases useful info is found in syslog - try
dmesg | tail or so
Now, it doesn't recognize that the partition is formatted. What a bummer. This seems to imply that the avoid data loss due to a corrupted image file, we need to place the data on Dom0, then cluster to the local VMs through the local bridge, virbr0.