When trying to query VMs
Invoke-VrGetLocalVms -pairingId {pairing UUID} -vcenterId {vCenter UUID}
to configure replication on vSphere replication, it fails with 503 Service unavailable.
vSphere Replication 9.x
The issue is that the request to retrieve all VMs is taking too long, probably because of too many VMs.
In order to optimize things a bit, use suitable_for_replication=true query parameter. It will filter only VMs which are suitable for replication and are not already replicated.
Apply the following steps to increase the timeouts of the REST API.