A Small Virtual Machine for a Test LabPosted: February 5, 2012
Get my 57MB Damn Small Linux OVA here (rename file extension from .doc to .ova): DOWNLOAD
While I’m traveling, I use my laptop as a mobile test lab. To do anything of significance, I like to run two VMware ESXi 5 hosts, vCenter Server 5, a domain controller (both on x64 Windows Server 2008 R2) and for my recent study focus, a NetApp DataONTAP 8.1 simulator, all on VMware Workstation 8. All these things are great, but with “only” 8 GB RAM to pull from, my resources are limited and I’m pushing RAM utilization to the max before I even start running VMs, as you can see below. The only thing saving me is an Intel 320 Series SSD.
What I’ve been looking for is a VM that would use as few resources as possible. I also wanted something I could clone and from which to create a template. I also wanted to be able to practice using PowerCLI against these VMs – nothing in particular, but perhaps start with a script to deploy a certain number of VMs from a template automatically. I haven’t gotten around to the PowerCLI part yet, but I have found an excellent start. It’s Damn Small Linux and I’ve created the smallest OVA I could.
For the purposes of my test lab, the least possible RAM utilization was the most important feature I was looking for. Hard disk space consumed by the running VM wasn’t necessarily important, but while making the VM as small as possible, I decided not to include a swap partition. The installation uses about 123 MB thinly provisioned on a 128 MB .vmdk because SSD space is valuable. It also runs on 64 MB of RAM, using a fraction of that when idle and only bit more while executing a continuous ping. In this blog post, I’d like to walk through installing Damn Small Linux (DSL) 4.4.10 to hard disk and then creating an OVA. You can also download my OVA from here. This blog is hosted by WordPress and because WordPress only allows certain file types to be uploaded, the OVA is saved with a .doc file extension. Please rename the .doc to .ova before attempting to use it.
Create a DSL Virtual Machine
I won’t walk you through creating the whole VM. Instead, I’ll hit the high points that are unique to DSL. As a note, I’m creating this inside ESXi 5. Feel free to keep the defaults for everything not mentioned here.
1. Choose a custom installation
2. Guest Operating System – choose “Other 2.4.x Linux (32-bit)”
3. Memory – 64 MB, was way too slow with only 32 MB
4. Create a 128 MB thin provisioned disk
5. Disk type must be IDE, not SCSI
In this example, I’m using the latest DSL build, 4.4.10. I didn’t test other builds. Boot the VM to this ISO.
Close the web browser that opens automatically and left-click the desktop, choosing XShells > Root Access > Transparent.
You’ll have to prepare the .vmdk to accept the OS install. To do this, you’ll use cfdisk and create an ext2 partition. At the prompt, type cfdisk /dev/hda.
The system will see a clean disk. Type ‘y.’
Using the arrow keys, select ‘New.’
The system sees the 134 MB for some reason. This is fine, just hit enter.
At the next screen, highlight ‘Bootable’ and you’ll see the flag entered above next to hda1.
Highlight, ‘Type,’ and hit enter.
Press enter at the next screen…
…and type in 83, then enter.
Highlight, ‘Write,’ then enter. Follow the prompts and type, ‘yes.’
That’s it. You’ve finished preparing the disk. Highlight, ‘Quit,’ and press enter.
At the prompt, type, ‘reboot.’ Boot once more from the ISO.
Once you’ve booted back into the DSL ISO, open another root shell and type, ‘dsl-hdinstall.’ The prompts are as follows:
Enter the target partition: hda1
Do you wish to support multi-user logins: no
Use journalized file system: no
Proceed to install a boot loader? Yes
Use Grub or Lilo: Either is fine, I use Grub
Reboot now: yes
After this last reboot, you’ll be prompted to set the root and normal user (dsl) passwords. Do this, then boot to the desktop.
The VM sees RAM utilization as less than 17 MB and full, 128 MB disk usage. Not bad for a test VM.
What I like to do with the DSL VM is start a continuous ping from a root shell while I perform vMotions and Storage vMotions. Of course, running inside VMware Workstation 8, the host-only network can deploy DHCP so your DSL VMs will automatically pull IP addresses.
Creating an OVA or OVF from here is easy. Issue the ‘halt’ command to shut down your DSL VM. Make sure it’s powered down before continuing.
Create an OVA
Highlight your DSL VM in the left hand pane. Choose File > Export > Export OVF Template… Fill out the appropriate information. Remember that an OVF file will export the .vmdk’s that make up the VM, along with descriptor files for deploying the OVF. I like the OVA format because it’s a single file to manage.
You can see that our VM takes up about 57 MB as an OVA. An OVF is about the same, although you may want to zip up the OVF package for ease of portability.
One thing that would make this VM more useful is getting VMware Tools installed. If anyone has a good walkthrough of that I’d love to see it.
In the end, with six virtual machines running, Windows registers about an 80 MB increase in memory utilization compared to no VMs running inside ESXi.
Looking at my disk performance with Resource Monitor inside my Windows 7 Ultimate host, my Active Time % is hovering above 50%. Again, this is on a solid-state drive. The only other application I’m running is Microsoft Word, but all systems still seem responsive. In fact, according to Resource Monitor, my Response Time is zero or one millisecond for every process and Disk Queue Length is averaging 0.50. Not too shabby. After several minutes of letting the system settle, Active Time is less than 20% and Disk Queue Length is less than 0.20 with response times staying the same. If I quit Microsoft Word, I’m sure I’d see an improvement.
I used this ArsGeek article as a reference when installing DSL