[kwlug-disc] Virtualization technology

Khalid Baheyeldin kb at 2bits.com
Mon Jul 28 17:05:01 EDT 2014


Although I have used VPSs for many years, I have not hosted them
myself. Rather I let others deal with the complexity in return for a
fee.

But in the lab, I have been playing around with VirtualBox to create
test VMs. Things that I can test certain things then roll back to a
previous state.

VirtualBox works, and does the job, and is free/open source.

I used the following script to create images for Ubuntu Server LTS,
one for 12.04 and the other for 14.04, both from the stock
downloadable DVD media.

mkdir virtualbox/
cd virtualbox/

#!/bin/sh

if [ $# = 2 ]; then
  VM=$1
  ISO=$2
else
  echo "Usage: `basename $0` vm_name install_iso_path"
  exit 1
fi

if [ ! -r $ISO ]; then
  echo "Cannot find ISO install media!"
  exit 2
fi

# Create the VM
vboxmanage createvm --name $VM --ostype Ubuntu_64 --register
# Modify the VMs parameter
vboxmanage modifyvm $VM --memory 512 --cpus 1 --pae off --acpi on
--hpet on --ioapic on --hwvirtex on --hwvirtexexcl on --vtxvpid on
--accelerate3d off --audio none --chipset ich9 --nic1 bridged
--bridgeadapter1 eth0 --nictype1 82543GC --clipboard bidirectional
# Create a hard disk for the VM
vboxmanage createhd --filename ./$VM-sda.vdi --size 4096
# Create storage for the VM
vboxmanage storagectl $VM --name storage --add sata --controller
IntelAHCI --sataportcount 4 --hostiocache off
# For the hard disk image
vboxmanage storageattach $VM --storagectl storage --port 1 --medium
./$VM-sda.vdi --type hdd
#And for the DVD, so we can boot from it
vboxmanage storageattach $VM --storagectl storage --port 2 --medium
$ISO --type dvddrive
# Make the VM boot from the DVD
vboxmanage modifyvm $VM --boot1 dvd
# Now start the VM, and install Linux on it
vboxheadless --vnc -startvm $VM
# Make the VM bootable from the hard disk
vboxmanage modifyvm $VM --boot1 disk
# Finally remove the DVD, it is not needed
vboxmanage storageattach $VM --storagectl storage --port 2 --medium none
# Now start the VM normally
vboxheadless -startvm $VM &

There are other comments for snapshot management, disk cloning ...etc.

As you can see the commands tend to be too verbose.

Also, I saw even when the VMs are idle (quiescent system), the the
number of context switches and interrupts on the host (physical) go up
significantly (130 per second to over 2,000 per seconds). That may be
unescapable overhead, and therefore I am asking ...

If you want to reproduce/compare this, stop all the VMs for a few
hours, take a baseline graph using Munin or Cacti, then start the VMs,
and leave them idle for a few hours, then stop them, and compare the
graph before/during/after.

So, while staying within the free and open source alternatives, what
are the options that people use? KVM? Xen? What else? With a bit of
details on what you like and what you don't like where possible.
-- 
Khalid M. Baheyeldin
2bits.com, Inc.
Fast Reliable Drupal
Drupal optimization, development, customization and consulting.
Simplicity is prerequisite for reliability. --  Edsger W.Dijkstra
Simplicity is the ultimate sophistication. --   Leonardo da Vinci
For every complex problem, there is an answer that is clear, simple,
and wrong." -- H.L. Mencken





More information about the kwlug-disc mailing list