Archive for July, 2011

Growing a Disk is *ALWAYS* a Bad Idea if You Have Snapshots

Never grow a disk if the machine has snapshots.  Even if the GUI lets you.

This morning I got a request to grow a virtual disk on a vm.  What you should do is look at the machine and see if it has any snapshots.  If it does, then you should delete them before attempting any disk grow operations.  In fact, what should happen is is if you try it, the GUI will give you an error stating that the “machine has snapshots, grow is not allowed”.  I was going too fast (and didn’t have enough coffee) and tried growing it with the machine on.  It failed.  I didn’t check for snapshots, I just turned the machine off.  Then I grew the disk.  It allowed me to do this.  (Really, the GUI should have refused to do this.)  This did *NOT* do what I expected…

Read more

Be Careful When Putting an VMware ESX Host in Maintenance Mode With A vCLI Script

If your VMware ESX hosts are like our ESX hosts, the hosts are in clusters and you have Distributed Resource Scheduling (DRS) enabled.  So in the vCenter GUI, when you right click a host and select “Enter Maintenance Mode”, DRS evacuates all running virtual machines to other hosts in the cluster.

I’m learning more about scripting actions like this with the vSphere Command-Line Interface (vCLI).

Specifically, the book says that the vCLI command “vicfg-hostops –operation enter” (“Entering and Exiting Maintenance Mode with vicfg-hostops”, page 28) does exactly the same thing.  In fact that page in the manual says “If VMware DRS is in use, virtual machines that are running on a host that enters maintenance mode are migrated to another host automatically.”

This is *NOT* true.  When you run this command, runnings vm’s are SUSPENDED, not migrated.

As far as I can tell, I’m doing everything correctly.  Others have seen the same thing.

I’m not sure if it’s a “feature” or what, but be careful.  Telling a host to enter maintenance mode with a vCLI script may not migrate running machines.

(If it matters, I’m running ESX 4.1, Update 1.)