Had to extend a VM disk today and got the above error. This is because the VM is replicated via vSphere Replication so you can’t simply extend the disk as you would do for any regular VM.
Here’s a top level summary of how you do it (based on this KB article).
- You have to break the replication. Stop it that is. But doing so deletes the replicated files, so first you want to work around that (as below).
- Note the current settings of the replication.
- Then pause the replication.
- Find out which datastore holds the replicated VM disks.
- Rename the replicated VM folder.
- Now you can stop the replication because you have kept a copy of the data.
- SSH into any ESX host that has access to the above datastore and extend the disk associated with the VMDK via
- Rename the folder back to what it was before.
- Recreate the replication, but point the destination to the same datastore as above and select the folder above. vSphere Replication will ask whether you want to use the existing data as seed – answer yes.
That’s it basically.
In terms of the details, I didn’t know how to find which datastore had the replicated VM files. So I SSH’d into one of the hosts in the replicated VM cluster and ran the following:
~ # find /vmfs/volumes/ -type d | grep PROFILES
There must be some better way, but what the heck. Once I found the path above I did the following to find other VMs in it, and using that info I was able to find the datastore name from vSphere client.
~ # ls /vmfs/volumes/567aa09d-5fbeac2c-eb69-0017a4770c10
VS-XXXXXX01 VS-YYYYYY01 VS-ZZZZZ02 VS-VMNAME01
You need this datastore name for when setting up a new replication, so you can point to that.
Some more things to keep in mind are the following.
- Since we pause the replication rather than stop it, the folder will contain a bunch of
hbr*files. Delete those.
-Xswitch takes the new size of the disk. Not the additional amount. So if the disk is 10GB and you want to add 20GB, you specify it the argument as 30GB. If you are getting a “Failed to extend disk : One of the parameters supplied is invalid (1).” error with
vmkfstoolsthat’s probably why.