Symptoms
VMware VM replication reaches 100% and hangs. No error or warning is displayed.
Logs from /var/run/log/hostd.log on ESX host contain a message similar to the following :
2021-08-13T22:28:12.116Z error hostd[2100679] [user@6876 sub=Req@vim25/7.0.1.0] length of HTTP request body exceeds configured maximum 100000
Cause
Limitation on the VMware side: it does not allow SOAP API requests longer than 100000 symbols
Solution
To work around the issue, increase the maximum length of API requests in config:
- Login to affected(target) ESXi host via SSH. It is recommended to do it on all hosts
- As a precaution, take a backup of the config file by running the below command:
cp /etc/vmware/hostd/config.xml /etc/vmware/hostd/config.xml-backup
-
Start editing /etc/vmware/hostd/config.xml using vi editor
vi /etc/vmware/hostd/config.xml
Type i to switch to editing mode - Add\change below line in soapRequest of vmomi section:
<maxUnauthenticatedDocSize>600000</maxUnauthenticatedDocSize>
before change
<vmomi>
<soapRequest>
<maxUnauthenticatedDocSize>100000</maxUnauthenticatedDocSize>
</soapRequest>
</vmomi>after change
<vmomi>
<soapRequest>
<maxUnauthenticatedDocSize>600000</maxUnauthenticatedDocSize>
</soapRequest>
</vmomi> - Save and close the file.
Type :wq to save and quit vi - Restart the hostd service by running the following command:
/etc/init.d/hostd restart
-
Check if the replication works correctly
-
In case the issue reproduces after the change, check the hostd.log again.
-
If the message in logs still contains 100000 (or whatever value was there before the change), then changes to the config were not applied properly. Repeat the steps 1-6 again.
-
If the message in logs shows the new value (600000 in our example) then the request is longer than the specified value. Keep increasing maxUnauthenticatedDocSize value until this error disappears from the logs: sometimes the value needs to be increased to 10 000 000.
-