Technical

vSphere Replication Without DNS

I believe most individuals know proper DNS configuration is essential to a smooth operating VMware environment – or pretty much any environment, for that matter. However, there are a few cases where certain components must be deployed to an environment that does not have DNS servers. I had a question about this specific to vSphere Replication so I decided to do some testing. My test environment consists of vCenter Server 6.0 running on Windows Server 2012 R2 in a virtual machine, a couple of local vSphere 6.0 hosts, and another vCenter Server 6.0 environment about 800 miles away from the local environment. I deployed a vSphere Replication 6.0 virtual appliance to the environment and removed the DNS server entries. It did not take long to see warnings and error messages in the UI.

vr_not_available

To be sure DNS was indeed “broken” in the vSphere Replication virtual appliance, I opened a console connection to the appliance and pinged a fully qualified domain name (FQDN). Naturally, I received the following response: unknown host pod02vm01.pml.local (that is my vCenter Server). I also noticed the VRM service was stopped in the virtual appliance management interface (VAMI) of the vSphere Replication appliance. I clicked the start button, it showed as running, and then after a few moments, it went back to stopped. Looking at the HMS log in the virtual appliance, I found this: “Optional service LookupService will not be available due to: com.vmware.vim.vmomi.client.exception.ConnectionException: java.net.UnknownHostException: pod02vm01.pml.local: Name or service not known” – again, no surprise.

The question is can I configure the appliance using FQDN to work without DNS configuration? Here is my vSphere Replication appliance configuration:

vr_network_config

vr_appliance_config

I started by taking a look at the hosts file in the /etc directory of the virtual appliance by typing cat /etc/hosts at the command line. Here is what it looked like before I started making modifications:

# VAMI_EDIT_BEGIN
127.0.0.1 localhost
10.20.181.226 pod02vm02.pml.local pod02vm02
# VAMI_EDIT_END

To get vSphere Replication and vCenter Server talking again, I simply added a line to the hosts file for vCenter Server (pod02vm01.pml.local) using the VI editor – see this web page for help on using VI editor, if needed.

# VAMI_EDIT_BEGIN
127.0.0.1 localhost
10.20.181.226 pod02vm02.pml.local pod02vm02
# VAMI_EDIT_END
10.20.181.225 pod02vm01.pml.local

After the change was saved, I restarted the network service in the appliance by typing /etc/init.d/network restart at the command line and I hit the refresh button in vSphere Web Client. I verified vSphere Replication was working by configuring replication to the local environment and then recovering the replicated virtual machine, both of which were successful.

Next, I turned my attention to replicating to a remote vCenter Server environment. The vSphere Replication UI in vSphere Web Client was reporting a connection issue. I started by adding a line in the hosts file for the remote vSphere Replication virtual appliance and restarted the network service. However, that was not enough – I was still seeing the connection issue warning message after refreshing vSphere Web Client. I added another line for the remote vCenter Server virtual machine:

# VAMI_EDIT_BEGIN
127.0.0.1 localhost
10.20.181.226 pod02vm02.pml.local pod02vm02
# VAMI_EDIT_END
10.20.181.225 pod02vm01.pml.local
10.144.106.127 wdcpod06vm02.pml.local
10.144.106.126 wdcpod06vm01.pml.local

After a network service restart in the local vSphere Replication appliance and a refresh of vSphere Web Client, the status showed “Connected”. I configured replication and recovered the replicated virtual machine at the remote site to confirm everything was working as expected. I also replicated a virtual machine from the remote site to the local site and recovered it. All of these operations were successful. After a bit more research, I found there was no need for the remote vSphere Replication appliance hosts file entry as vSphere Replication uses the vCenter Server proxy system for communication. Below is what my final hosts file looked like – a line for the local vCenter Server and another line for the remote vCenter Server. Keep in mind all other components – local vCenter Server, vSphere hosts, remote vCenter Server, etc. – all had DNS properly configured.

# VAMI_EDIT_BEGIN
127.0.0.1 localhost
10.20.181.226 pod02vm02.pml.local pod02vm02
# VAMI_EDIT_END
10.20.181.225 pod02vm01.pml.local
10.144.106.126 wdcpod06vm01.pml.local

More details on connections and TCP ports used by vSphere Replication can be found in VMware KB article Port Numbers that must be open for vSphere Replication 5.8.x and 6.0 (2087769)

This blog article only covers the basics of name resolution without DNS being configured in a vSphere Replication virtual appliance. If the entire environment lacks DNS, more entries to hosts files on the vCenter Server, vSphere, SRM, etc. machines will certainly be required. There are several VMware KB articles that detail these requirements. A quick search on Google for VMware network port diagram will also produce several additional resources. Proper DNS configuration is always recommended, but in the few cases where that is not possible, it appears vSphere Replication handles it just fine with a few addition to the local hosts file.

@jhuntervmware