14 Jan 2010

VMware ESX 3.5 and Storage VMotion

We're in the process of expanding the capacity of our production SAN and consequently have to do some shuffling of data between disk groups and LUNs. The first step in the migration was to move the VMs on our production cluster to some newly provisioned LUNs. Initially I envisaged powering down each VM and then selecting to Migrate it and selecting to relocate it's disks as part of the migration process from within the VI client. I didn't fancy this option too much due to the time it would take and the incurred downtime and therefore it would also be more than likely have to be done at a weekend, of which I have very few of as it is.

I'm just cutting my teeth on VMware's PowerCLI so decided to see if I could at least script the process rather than drowning in GUI hell. I found that I could go one better and summon Storage VMotion using PowerCLI. The blurb in the VMware PDF states that;

VMware® Storage VMotion™ enables live migration for running virtual machine disk files from one storage location to another with no downtime or service disruption.

Sounds exactly what i'm after. You have the choice of leveraging Storage VMotion using either an unofficial VI Plugin (not ideal for production), VMware's RemoteCLI or PowerCLI. I mapped out the source and destination LUN's and moved a few VM's at a time by running the following PowerCLI command. While this took sometime to run for each VM, I didn't want to push my luck and was careful of the additonal I/O on the LUN's source LUNs.


Get-VM "VM_Name" | Move-VM -Datastore "New_DataStoreName" -RunAsync

A new task should appear in the VI Client indicating that the VM's storage is being relocated. While this is happening the VM is available and able to function as expected.

No comments: