DNS在虚拟化环境里必须是标准配置,在VMware很多稍微复杂点的软件中如vcloud director,View,都需要DNS服务器。而在最最基本的ESXi的配置里面,
很多场景也需要DNS。
但很多用户环境中,不太方便做DNS,比如一个空白的DC,需要做基础的虚拟化平台,应用什么的还都没有部署,先行贸然部署一个DNS是不恰当的。下文VMware official KB给出了一个解决方案。
另外,需要额外腔调的,在ESXi中配置的任何IP,如网关、DNS服务器等,都必须是可ping通的,在很多功能中如HA,Vmotion,都会自动检测网关和DNS服务器的状态,如果没有响应,功能是无法开启的。
Identifying issues with and setting up name resolution on ESX/ESXi Server
Symptoms
- Unable to configure VMware High Availability (HA)
- Configuring VMware HA fails at about 97% completion
- Configuring VMware HA fails between 85 to 91%.
- Reconfiguring VMware HA fails
- Adding an ESX host to a cluster fails
- Enabling VMware HA in a cluster fails
- These errors are generated when attempting to configure VMware HA:
·
- An error occurred during configuration of the HA agent on the host
- HA agent on <ESX> in cluster <cluster> in <Datacenter> has an error
- Error: Cannot complete the configuration of the HA agent on the host. Other HA configuration error
- cmd addnode failed for primary node:/opt/vmware/aam/bin/ft_startup failed
- Host fails to remediate or exit Maintenance Mode.
- You see the error:
Operation timed out - In the Tasks view of VirtualCenter/vCenter Server, you see the error:
There are errors during the remediation operation
Failed to find host
- Update Manager is unable to scan ESX/ESXi hosts.
Purpose
The errors listed in the Symptoms section are generated as a result of name resolution issues.
This article guides you through identifying issues with name resolution which can seriously impact the normal operation of ESX/ESXi, particularly in HA clustered environments. The article also details correctly configuring host files when there is no DNS server in the environment or if the DNS server is incorrectly configured.
Resolution
Identifying issues
There is a problem with name resolution if any of the following tests fail. ESX/ESXi hosts must be able to find each other by:
- IP address
- Short Name
- Fully Qualified Domain Name (FQDN)
If an issue with name resolution has been identified it must be resolved either on the DNS server or by using hosts files.
Note: After making any changes to DNS or hosts files, ensure to delete the file /etc/FT_HOSTS (or/etc/opt/vmware/aam/FT_HOSTS and /var/run/vmware/aam/FT_HOSTS) on all affected ESX/ESXi hosts.
1. Verify that all ESX/ESXi hosts can ping each other by short name. All ESX/ESXi hosts in the environment must be able to ping each other by using short name only. For more information, see Testing network connectivity with the Ping command (1003486).
2. Verify that all ESX/ESXi hosts can nslookup each other.
Use nslookup to verify that the right name is being associated to a particular IP address.
For example:
[root@esx-server-1 /]# nslookup 192.168.0.5
Server: 192.168.0.7
Address: 192.168.0.7#53
5.0.168.192.in-addr.arpa name = esx-server-2.domain.com.
3. Verify that all ESX/ESXi hosts can reverse nslookup each other.
Use nslookup to verify that the right IP address is being associated to a particular name.
For example:
[root@esx-server-1 /]# nslookup esx-server-2
Server: 192.168.0.7
Address: 192.168.0.7#53
Name: esx-server-2.domain.com
Address: 192.168.0.5
Additional checks for VMware High Availability (HA) environments
The following are additional checks for VMware High Availability environments:
1. Verify that the reported host name is in lowercase when you run:
[root@esx-server-1 /]# hostname
[root@esx-server-1 /]# hostname –s
2. Verify that all host names in /etc/hosts are in lowercase.
3. Verify that search domain in /etc/resolv.conf is in lowercase.
4. Verify that the host name in /etc/sysconfig/network is a fully qualified domain name, and is lowercase.
5. Verify that the host name in /etc/vmware/esx.conf is a fully qualified domain name, and is lowercase.
6. If your ESX/ESXi hosts are registered in DNS, verify that your system host name is lowercase. Run the following command to ensure the FQDN is resolvable and all lowercase:
nslookup <short hostname>
7. Verify that all primary Service Consoles in the VMware HA cluster have the same name.
8. Verify that all primary Service Consoles are in the same IP subnet.
Note: If a VMotion VMkernel port is on same vSwitch as the primary Service Console, or if a host has multiple Service Consoles, refer to After installation or upgrade to VirtualCenter 2.5.0 Update 2 an Incompatible HA Networks error is generated (1006541).
Configuring hosts files on ESX/ESXi
The hosts file on the ESX host is located at /etc/hosts.
Open the file for editing using a text editor such as nano or vi .
Below is an example hosts file.
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1 localhost.localdomain localhost
# Any line beginning with a pound sign is a comment and will not be read.
192.168.0.5 esx-server-1.domain.com esx-server-1
192.168.0.6 esx-server-2.domain.com esx-server-2
# The VMware Virtual Center Server must also have an entry here
192.168.0.20 virtualcenter.domain.com virtualcenter
Note: localhost must always be present in the hosts file. Do not modify or remove the entry for localhost.
- The hosts file must be identical on all ESX/ESXi hosts in the cluster.
- There must be an entry for every ESX/ESXi host in the cluster.
- Every host must have an IP address, Fully Qualified Domain Name (FQDN), and short name.
- The hosts file is case sensitive. Be sure to use lowercase throughout the environment.
转载于:https://blog.51cto.com/51cloud/641111