Friday, February 06, 2009

building virtualized servers on a dell T100

This is yet another looong post. Starting from scratch, had to do everything from changing bios settings to adding and removing virtual machines. Maybe I'll skip over the many days of trial and error and will just summarize the actual steps to be taken here.

  1. The lights 1 2 3 4 on the front panel are only for diagnostics according to the Dell manual and do not indicate hard disks or anything like that.
  2. Warning message "Alert! cover was previously removed" and not booting till F1 or F2 is pressed. Solution as given here - Bios setup -> System Security -> Chassis Intrusion -> Enabled Silent.
  3. Much later, while installing KVM, found virtualization needs to be enabled in Bios as given here. So, as mentioned in the dell manual, went into Bios setup -> CPU Information -> Virtualization -> Enable. Also enabled the CPU info reporting to OS, which also was disabled by default.
  4. PB wanted to do JeOS as given here, the installation on the base machine was Ubuntu server 8.10 Intrepid amd64 build.
  5. Installed gui with sudo apt-get install ubuntu-desktop since I wanted to try out virt-manager. The installation of ubuntu-desktop stalled at 99% after downloading files for more than an hour, probably due to some network glitch. Did Ctrl-C, again ran the same command, this time it downloaded a few kB more and then finished the install with no more problems. The install itself took around 6 minutes. 4 GB RAM, amd64 kernel. Did apt-get remove gdm so that it would not boot into X.
  6. While installing virtual machines from CD with virt-manager as given here, wizard would not proceed until CD was unmounted in host OS. Then, the CD could be selected.
  7. Had to install qemu, without which install of virtual machines was failing. Listed in Ubuntu docs here, here and here.
    sudo apt-get install kvm libvirt-bin ubuntu-vm-builder qemu bridge-utils
  8. Trying to install from the same Ubuntu server CD using virt-manager was hanging at the point where it installs and configures grub. Tried the install in expert mode and installed Lilo instead, this works. For expert mode, hit F4 when booting from CD after choosing English (language of install).
  9. Virtual machines created with network options with virt-manager were not able to access the network. Only later did I know that all these machines needed was to be set to DHCP. QEMU has a strange and wonderful user mode virtual network which has a firewall / gateway / dhcp server at 10.0.2.2, DNS at 10.0.2.3. Since each instance of Qemu is a separate process, if set to DHCP, each Qemu virtual machine will get the address 10.0.2.15 ! And they are automatically NATed.
  10. Now tried the commandline vmbuilder, since the virt-manager based installs were taking so much time and user interaction.Did the install according to the docs, some find the install to take just a minute! But in my case, found it took two hours. Reason was that it was downloading from ubuntu.com instead of using CD.
  11. The --iso option for vmbuilder does not work, so the install was going to ubuntu.com for each package.
  12. Also found that lines separated by \ for a multiline command works if typed in, but takes only the first line if copy-pasted!! So, my first vmbuilder image was a basic default one. Luckily, the default made a run.sh filein the same directory, which gave the syntax to run the vm as
    kvm -m 128 -drive file=disk0.qcow2 -net nic -net user $@
    The trailing $@ is equivalent to $1 $2 $3..., which means that you can add any more commandline arguments to the script (run.sh) and they will be passed on to the kvm program. Man kvm says it takes the same arguments as kvm-qemu - and man kvm-qemu redirects to the qemu man page.
  13. Again another trial - the commandline virt-install (since the vmbuilder was using so much network and time). . It complained of "Unsupported virtualization type" - apparently had to put --hvm in the arguments. Bridge mode causes it to crash. Reason seems to be that the bridging, tap interface etc should be manually set up beforehand. So, removed the bridge option --network bridge:eth1. Then, it has qemu-system-x86 running at 100% cpu for a long time - indefinitely? - with no disk activity, as seen with top. So abandoned this attempt. The command used was
    virt-install --name testX3 --ram 512 --file testX3 file-size 6 --nographics --hvm --cdrom ubuntu-8.10-server-amd64.iso
  14. The images created with vmbuilder could be copied and run using the kvm command. So, concentrating on those. Found the wonderful world of Qemu virtual networking! Redir seems to be the way to go, given at wikibooks. btm.geek says be sure to use bridging, but let's see how it goes with the user mode qemu. Now calling the virtual machines with
    kvm -m 128 -hda disk0.qcow2 -hdb disk1.qcow2 -redir tcp:5555::22
    for example exposes the ssh port 22 of the guest on the host machine's interfaces (localhost and eth0).
    ssh -p 5555 user@localhost connects to the guest vm's sshd. We've to see if this method continues to work under load.

2 comments:

  1. How about the performance? Is it good?

    ReplyDelete
  2. Finally decided not to go for a virtualized server after all:
    this post
    and
    this one.

    So I did not run any actual benchmarks.

    ReplyDelete