Convert Thick Virtual Disks to Thin

When working with virtual machines, it is often advantageous to over allocate and under utilize resources. When it comes to virtual hard disks, this is even more common place. On low use or low demand servers, I always use thin provisioning. This saves disk space by only using physical disk space when the guest actually uses the virtual disk. But what about those disks that were created using the thick option, or brought over as thick automatically during a P2V conversion? Time to convert your thick virtual disk to thin.

As always, I recommend backing up all of your data and knowing what you are doing. Test this in a non-production environment.

Converting disks from thick to thin is actually quite easy and can be accomplished using these steps:

1. Log into your ESX host using SSH and cd into the VM directory that contains your virtual disk.

2. Shutdown the VM so that we can get exlusive access to the virtual disk.

3. Run vmkfstools -i yourthickdisk.vmdk -d thin yourthindisk.vmdk

4. Edit the settings for your VM and remove the existing drive. Add a new hard drive and choose the existing drive option.

5. Boot the VM and enjoy.

Note: Dont forget to go back to ESX server and remove the old .vmdk and -flat.vmdk files once you are sure that your VM is operating normally off the thin disk.

–Himuraken

Virtualization Lab: Part 2 – Concepts and Terminology

Virtualization Lab: Part 2 – Concepts and Terminology

Welcome to part two of my Virtualization Lab series. If you haven’t read part one, I would recommend reading it first.

In this post I want to go over the concepts and terms that are used so frequently. Understanding the gist of virtualization will help lay a steady foundation upon which advanced topics seem more natural and intuitive.

Commonly used terms:
Host – This term is used to describe the operating system and physical computer that exists and runs virtual software/hardware.

Guest – This term is used when referring to a virtual computer or operating system which is running on a host system.

VM – a Virtual Machine is the same thing as a guest and is used much more frequently.

Hypervisor: A hypervisor is a lower level operating system that exists somewhere between the physical hardware and the VM’s. A hypervisor usually takes the place of your user system and is essentially a small highly optimized operating system for running virtual machines.

P2V: This acronym stands for Physical to Virtual. P2V conversions are great when they work and help convert current systems into a VM.

There are many other terms and acronyms out there, but these are the most common.

Where to start:
For the absolute beginner and most others, I recommend installing VirtualBox which can be downloaded here. Go ahead and get VirtualBox installed since we will be going over it in more detail in part three of this series. You will also need to download a .iso file for next weeks post. I will be installing Ubuntu 9.04 Jaunty Jackalope 32bit which can be downloaded from here.

–Himuraken

Virtualization Lab: Part 1 – The Basics

Virtualization Lab: Part 1 – The Basics

Many people are wondering what virtualization is really all about, and for good reason. In this multi-part series, I will take the virtualization novice from the ground up to a working lab/light production system.

I’ll start with a bit of a rant: It seems that people on the Internet and everyone in the tech industry in general never seem to run out of buzz words. Everything is virtual, or it is green, or it is in the cloud. As my friend Numchuk would say, “Set my hair on fire and put it out with a sledge hammer.” I hate it for the most part, and for good reason. Everyone starts flapping their jaws about this and that and all reality goes out the window. That is to say, principals and baselines are momentarily forgotten.

With that being said, virtualization is here to stay. Albeit a popular buzz word at the moment, it is the most usable and beneficial thing that I can think of at the moment.

Most technicians and engineers have used some sort of virtualization product at this point. If you haven’t that is fine, but it is time to catch up with the rest of the pack.

My first experience was with VMWare’s Workstation product running on Windows 98 or 2000, I honestly cannot recall. But back then, it was all about installing Linux and BeOS and still being able to use my Windows box when I got stuck somewhere. Nowadays, I have ditched VMWare’s Workstation and started using Sun’s VirtualBox. What I virtualize has also changed, I now use VM software to virtualize Windows for the very few applications I use that don’t run properly in Linux, which I now use exclusively. Products of this type are excellent for running older or differing operating systems so that you can access that Windows application on your Macintosh, or that Linux application on your Windows box.

While that is all very convenient and good, the real fun starts when you start virtualizing servers. With a single high-powered physical server you can run 3-10 virtual servers depending on their types. Your company only has one domain controller and it is running WINS, DNS, and DHCP? What if that one installation of Windows goes south? Spread it out across physical and virtual servers.

But before we get ahead of ourselves we must learn the in’s and out’s of such a system prior to putting it into a production environment. You have heard the old adage along the lines of “with great power comes great responsibility” or something like that right? Well that is most certainly the case with virtualization.

–Himuraken

New Dell PowerEdge R610 on the way.

We recently purchased Kaseya and needed a better server to put it on. After deciding to setup Kaseya as a VM on a ESX host and a little capacity planning, I determined that a new server would be needed. After getting the corporate overlords to approve, I ordered up a new Dell PowerEdge R610 with 12GB of RAM and six HDD’s. I’m thinking RAID 10 for this box, but a little research will make the final call.

–Himuraken

VirtualBox and cloning virtual hard disk drives

After breaking my VMWare Workstation install by upgrading to the latest kernel, I decided to give VirtualBox a try. VirtualBox comes in two flavors, the full version and the open source edition (OSE). I have had a great time creating virtual machines in VirtualBox, the application really is quite solid. I am seeing performance similar to what I am use to with VMWare.

I primarily use virtual machines for testing production type systems in an environment that I can experiment with. Something about trying out new products and ideas seems to worry my clients and end users, no surprise there. With that being said, I have created a Windows 2008 Standard addition VM, a Windows XP Professional VM, and a Windows Vista Business VM. That is about where I would like the creation to stop, I want to simulate multiple client machines, but I do not want to manually load all of the client systems. In VMWare it is quite straight forward, you simply shut the VM down, highlight it and click on Clone. Well VirtualBox is almost that straight forward, but you have to do the cloning from the command line, and more importantly, you must use absolute paths.

The command is documented in many places across the web, but most if not all of them that I found were something like this:

VBoxManage clonevdi yourvirtualhdd.vdi yourclonedvirtualhdd.vdi

The problem with this is that the above command uses relative paths which is kind of standard for most apps, not VirtualBox. So in my case the command would actually look like this:

VBoxManage clonevdi /home/himuraken/VM/VirtualBox/BaseInstalls/yourvirtualdd.vdi /home/himuraken/VM/VirtualBox/BaseInstalls/yourclonedvirtualhdd.vdi

This may appear complex or difficult to understand for some but just understand it this way, you need to provide the full path to the image you want to clone and the full path to the location you want to store the cloned VDI to.

–Himuraken