VMware – how best to remove an extent from an iscsi volume

iscsivmware-esxi

In our dev/test environment, I have a vSphere 5 ESXi server running. I have one particular vm on it that went into a panic state because one of it's virtual disks was hosted on a volume that ran out of space.

That particular volume happened to be on an iSCSI device that had had one extent bound to it. It turns out there was an available extent not in use, which I added to the volume, and this resulted in enough space to light the vm back up and get service restored.

Anyhow, after restoring service, upon inspection of the files on the out-of-space disk, I found a huge abandoned .vmdk which ate up most of the disk space . I deleted that abandoned .vmdk, and now there is more than enough space on the original extent to do everything I need.

But, at this stage, the volume has both extents in it, and it's certain that the .vmdk on my previously stalled vm has spanned across both extents.

I'm certain that while the vm is back in service, it can't possibly be a good solution as both extents are on the same physical storage and i'm envisioning insane disk thrashing as it hops between the two extents.

What is the best way to get that extra extent unbound from the iSCSI volume?

Best Answer

Once you've expanded a VMFS filesystem onto a new extent, you don't go back - an extent cannot be removed. You'll need to format a new VMFS filesystem onto the original extent to get back to having a single-extent datastore.