Removing a VMFS extent

Until vSphere 4, the only way to add space to an existing VMFS was to add an extent. This means creating a new partition, most of the time on a new LUN, and extend the VMFS there (vSphere 4 is now able to resize a partition on a grown LUN). This is somehow equivalent to adding a physical volume in a volume group under LVM. But contrary to LVM, once you added an extent to a VMFS, it is impossible to remove it.

Well, until now, it was.

I just pushed my lvm branch of vmfs-tools (get a git snapshot tarball), which includes a new tool named vmfs-lvm, allowing to just do that. For the moment, the tool is not cluster-safe, which means you’d better run it on an offline VMFS (i.e. make sure no server is using it). Data should not be at risk because the tool checks the removed extent doesn’t contain any data, but it also assumes the filesystem is in a consistent state beforehand.

The command line to remove an extent looks like the following:

# vmfs-lvm extent0 extent1 ... extentn remove

This will remove the last extent.

Update: There was a bug when setting some values at volume level. The git snapshot link above has been updated accordingly.

2009-12-02 16:40:55+0000

vmfs-tools

You can leave a response, or trackback from your own site.

Leave a Reply