During replication, when increasing the size of a virtual machine disk files (.vmdk files) of a virtual machine that is protected by vSphere Replication, you see the error:
vSphere Replication does not support changing the length of a replicated disk
Following error could also be observed in vSphere Client in a case where virtual disk extend is attempted:
Invalid or unsupported virtual machine configuration.
Note: With any disk modification, there is always the chance of data loss, but it is minimal in this procedure.
To work around this issue, perform these steps:
At the recovery site, rename the actual replicated vmdk files with a temporary prefix. This prevents the replicated data from removing when removing replication from the virtual machine. Do not rename the hbr*.vmdk disks.
Navigate to the directory containing the virtual machine.
For example:
# cd /vmfs/volumes/<DatastoreName>/<VMName>
Rename the virtual disk (VMDK) files using the vmkfstools -E
command:
# vmkfstools -E "originalname.vmdk" "newname.vmdk"
Disable replication of the virtual machine you want to resize.
At the recovery site, rename the replicated vmdk files back to their original names.
At the protected site, increase the size of the desired virtual machine disk file.
At the recovery site, log in to an ESXi host that can access the datastore in which the virtual machine is replicated.
Run this command to change the directory to the datastore and folder in which the replicated disk is stored:
cd /vmfs/volumes/virtual_machine_datastore/virtual_machine_folder/
Run this command to increase the size of the replicated vmdk
using vmkfstools
:
vmkfstools –X 50G virtual_machine.vmdk
A file with the name ‘[<datastore>] <folder>/<filename> already exists. Press Yes to use file as an initial copy.
Note: If you are using Cisco HyperFlex replication, disable the replication from Cisco side. Expand the vmdk and then re-enable the replication.
Note: If vSphere replication is no longer running but the replication services are still running on the virtual machine, follow these steps:
vim-cmd vmsvc/getallvms
vim-cmd hbrsvc/vmreplica.disable <vm-id>