CA-124981: Port the fix of HFX-1078 from clearwater-sp1-lcm to trunk

The fix of HFX-1078 has been merged in clearwater-sp1-lcm with pull request https://github.com/xapi-project/xen-api/pull/1638

This pull request is to port the fix to trunk branch to address SCTX-1635.