VMware Cloud Community
nec_coty
Contributor
Contributor

Expand Clustered VMDK File

I'm trying to use vmkfstools to expand a disk that is shared between two VMs.  The VMs each have a SCSI controller set in "Physical" share mode, and then a VMDK file attached to that controller.  Both systems see the VMDK just fine.  I'd like to be able to expand the VMDK on-the-fly, without shutting down the VMs, but when I try to run vmkfstools -X 100G to bring it from 50G to 100G, I get the following error:

Unable to access file [DATASTORE1] CLUSTEREDVM1/CLUSTEREDVM1_1.vmdk since it is locked.

What do I need to do differently to add space to a clustered VMDK without shutting down the VMs?

5 Replies
a_p_
Leadership
Leadership

I might be wrong, but with the controller set to physical mode, I'd actually think the .vmdk file is a RDM mapping file rather than a .vmdk virtual disk file!? In case of a physical mode RDM, it should be sufficient to increase the mapped LUN, do a rescan within the guest's Disk Manager, and finally increase the partition size.

André.

0 Kudos
nec_coty
Contributor
Contributor

Thank you for the response.  I am not using a RDM, I'm using a VMDK file.  However, I changed the SCSI Bus Sharing Mode from "Physical" to "Virtual" for both of those SCSI adapters (with VMs powered off, since that's required to change the mode), and then powered the VMs back up and tried the resize operation, again, and I get exactly the same error about the VMDK file being locked.

0 Kudos
rcporto
Leadership
Leadership

Since the .vmdk is used by MSCS virtual machine, I will assuming that you're using EagerZeroed vmdks, and unless I'm missing something new, you cannot expand a eagerzeroed vmdk using the UI, and the supported way to do is using the vmkfstools and with all machines that access that disk powered off.

Read more:

Extending an EagerZeroedThick Disk - VMware vSphere Blog

Attempts to extend the size of an EagerZeroedThick VMDK from the vSphere Client might result in a La...

And using shared vmdk you should use SCSI Bus Sharing as "virtual" and not "physical", see: https://pubs.vmware.com/vsphere-55/topic/com.vmware.ICbase/PDF/vsphere-esxi-vcenter-server-55-setup-...

virtual.JPG

From page #15.

And a final tip: since you may already try expand the vmdk from UI, try do a storage vMotion to another datastore and select the destination type as eagerzeroed to make sure all the .vmdk will be converter to eargerzero.

---

Richardson Porto
Senior Infrastructure Specialist
LinkedIn: http://linkedin.com/in/richardsonporto
nec_coty
Contributor
Contributor

- Yes, I am using EagerZeroed Thick provisioning.  Failing to use that method results in not even being able to boot the VMs.  The VMs both boot just fine with the shared disks.

- Yes, I am already using the vmkfstools utility to run the expansion command.  The GUI gives me a warning and doesn't even try, the vmkfstools command is the one failing on me with the noted error message about file locking.

- Yes, I have already tried setting the SCSI controller sharing mode to both Virtual and Physical.  I realize that Physical + VMDKs is not Supported by VMware, but I tried, anyway.  The behavior is identical no matter which setting is selected.

- I've also, using the web GUI, set the multi-writer mode on the VMDK file itself in both VMs to make sure this wasn't causing issues.  Again, behavior remains the same.

- I can try storage vMotion; however, I've created multiple VMDKs trying this out, all with the eagerzero thick provisioning model, and the behavior remains the same.  Also, again, as noted above, if it isn't provisioned correctly it prevents the VM from even booting, so I really don't think that's the issue.

Thank you for the suggestions!

-Nick

0 Kudos
swpnl
Contributor
Contributor

You need to shutdown both cluster nodes before expanding the vmdks from command line using vmkfstools.

0 Kudos