VMware Cloud Community
BillStirling
Enthusiast
Enthusiast

hostname problem enabling HA

We have two ESX servers (v3.5U2) "server01.mydom.local" and "server02.mydom.local" and manual entries were made in DNS for these.

We then added these to servers to VC (currently v2.5U1) using the FQDN. VirtualMachines work OK and we can VMotion. We then created a cluster and added the two servers and enabled the cluster for DRS - again all fine.

Finally we tried to enable the cluster for HA but got the error on server02 saying that it could not resolve the short name "server2". Investigation showed that when the server was built one character was omitted from the hostname!.

I used esxcfg-advcfg -s server02.mydom.local /Misc/HostName to correct the hostname

I then edited "/etc/hosts"and "/etc/sysconfig/networks" to again correct the hostname.

I changed the current hostname using "hostname server02.mydom.local"

I finally did a service network restart.

Back in the VC when I now try to enable HA I get that error that server2 and server02 resolve to the same IP address - what have I missed?

Regards Bill

Tags (4)
0 Kudos
12 Replies
mike_laspina
Champion
Champion

Hello,

There are some aam config values that will remain intact.

You should disable HA at the cluster level and let it completely uninstall. Do not enable it yet. DNS will have a TTL value and it will cache the name for up to 1hr.

on the VC run a command prompt with

ipconfig /flushdns

I believe the hosts file is immediate but don't qoute me on that one.

Then enable HA.

http://blog.laspina.ca/ vExpert 2009
0 Kudos
BillStirling
Enthusiast
Enthusiast

Hi Mike,

Had already disabled the HA on the cluster about 90 mins ago. Tried on the VC ipconfig /flushdns.

Then on the VC and on both the ESX servers tried pinging "server2" by name (failed on all three) then pinging "server02" (reply on all three).

Tried re-enabling the HA again with the same result.

Regards

Bill

0 Kudos
mike_laspina
Champion
Champion

Could be from an environment variable.

Check it by running

set

if it's wrong just use

HOSTNAME=yourhost

http://blog.laspina.ca/ vExpert 2009
0 Kudos
BillStirling
Enthusiast
Enthusiast

Hi Mike,

Nope HOSTNAME environment variable is set to the new server name.

Regards

Bill

0 Kudos
mike_laspina
Champion
Champion

Hmm.

ttl - check

esxcfg - check

full name - check

short name - check

DNS server - check

Are you in a position to reboot the host?

Wait a second. Where is your short name entry. In hosts file it should be.

172.16.0.1 longname.domain.com shortname

http://blog.laspina.ca/ vExpert 2009
chill
Hot Shot
Hot Shot

Have you tried removing the ESX host from VC and re-adding it with the FQDN again?

If you find this information helpful or correct, please consider awarding points.
0 Kudos
mike_laspina
Champion
Champion

Removing it is a good idea. It may be referencing the registered name in your VC DB. Removing the host and re-adding it would fix that.

http://blog.laspina.ca/ vExpert 2009
0 Kudos
BillStirling
Enthusiast
Enthusiast

Hi Mike,

Yes when I edited the /etc/hosts I changed the line:

172.16.0.1 server2.mydomain.com server2

to 172.16.0.1 server02.mydomain.com server02

I noticed that the entries in the /var/log/messages file are still going in with the old short name.

I tried a service mgmt-vmware restart but no change.

I guess I will need to try to arrange a reboot.

Regards

Bill

0 Kudos
BillStirling
Enthusiast
Enthusiast

Will try to arrange a reboot and if that does not fix it will try removing the host from the VC and re-adding

Regards

Bill

0 Kudos
max_inglis
Enthusiast
Enthusiast

When you ping from the others to server2, you should get "temporary failure in name resolution", not no reply from host - have you checked the hosts file on the other host in the cluster as well? I usually change my /etc/host.conf to "order bind,hosts" so that my ESX boxes use DNS over hosts files, that way if you check DNS and its right, its right in all 3 places, hosts files are just a backup.

It does mean that you can't virtualize your DNS servers though - just a warning.

http://ITangst.blogspot.com
0 Kudos
BillStirling
Enthusiast
Enthusiast

No if I ping from server01 (or indeed anywhere else such as the VC) eg "ping server2" I get "unknown host server2" "ping server02" all is fine.

The only place that seems to know about the old short name is server02 (or server2) itself.

Regards

Bill

0 Kudos
harunsahiner
Contributor
Contributor

Hi,

I'm hosts files including following configuration, as such no problem enabling HA.

ESX1 cat /etc/hosts

127.0.0.1 localhost.localdomain localhost

10.10.60.51 ESX1.domain.local ESX1

10.10.60.50 ESX2.domain.local ESX2

10.10.60.56 vcenter.domain.local

ESX2 cat /etc/hosts

127.0.0.1 localhost.localdomain localhost

10.10.60.50 ESX2.domain.local ESX2

10.10.60.51 ESX1.domain.local ESX1

10.10.60.56 vcenter.domain.local

Regards

Harun

http://harunsahiner.blogspot.com
0 Kudos