Sunday, August 22, 2010

Hot Remove VMDKs in Linux VMs

We glue vHDDs onto VMs like crazy. It's like a sport or something. The awesome part is that I just found an article on Xtravirt showing you how to remove one.

Awesome.  So here's the process:
  1. umount the drive.
  2. pull the drive from /etc/fstab, if necessary.
  3. here's the magic.  Unlink the drive from the HBA:
    echo 1 > /sys/block/sdb/device/delete
    oh yeah. That hits the spot.
  4. remove the VMDK from the VM via the VIC.
And that's it.  Holy crap.


I'm not including this to take credit for it.  Personally, I never knew we had the power in Linux, yet, to yank a drive off the bus like that.  It's awesome, and it shows what kind of awesome power we have here.

Go see the article at its source:

vSphere: Hot Add or Remove a VMDK with a Linux VM | Xtravirt

Labels: , , , ,