我在esx3.02的操作过程,大家需要做的是打开防火墙的端口161。
[root@esx02 root]#esxcfg-firewall –enableService ntpClient
[root@esx02 root]# vi /etc/ntp.conf
# Prohibit general access to this service.
restrict default ignore
# Permit all access over the loopback interface. This could
# be tightened as well, but to do so would effect some of
# the administrative functions.
restrict 127.0.0.1
restrict 127.0.0.1
restrict default kod nomodify notrap
server 0.vmware.pool.ntp.org
server 1.vmware.pool.ntp.org
server 2.vmware.pool.ntp.org
driftfile /var/lib/ntp/drift
# — CLIENT NETWORK ——-
# Permit systems on this network to synchronize with this
# time service. Do not permit those systems to modify the
# configuration of this service. Also, do not use those
# systems as peers for synchronization.
# restrict 192.168.1.0 mask 255.255.255.0 notrust nomodify notrap
“/etc/ntp.conf” 83L, 2970C written
[root@esx02 root]# vi /etc/ntp/step-tickers
re.pool.ntp.org
1.vmware.pool.ntp.org
2.vmware.pool.ntp.org
~
~
“/etc/ntp/step-tickers” 4L, 61C written
[root@esx02 root]# vi /etc/hosts
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1 localhost.localdomain localhost
172.16.1.130 esx02.vmware.cn
0.vmware.pool.ntp.org
1.vmware.pool.ntp.org
2.vmware.pool.ntp.org
~
~
~
~
~
~
~
~
~
“/etc/hosts” 8L, 244C written
[root@esx02 root]# service ntpd restart
Shutting down ntpd: [ OK ]
ntpd: Synchronizing with time server: [ OK ]
Starting ntpd: [ OK ]
[root@esx02 root]#
设置ESX开机, NTP服务自启动:
chkconfig –level 345 ntpd on
指定ESX关机时, 硬件时钟与系统时钟同步:
hwclock –systohc
关于vmware 客户机的配置
VM时间同步十分重要. 普通计算机一般都可以通过硬件所提供的时钟中断(CLOCK INTERRUPT)或时钟标记(CLOCK TICK), 来计算出系统时间. 对于运行在ESX上的VM来说, 它们并不直接使用ESX硬件, 时钟中断或时钟标记是由ESX的虚拟提供的. 在ESX繁忙的时候, 常常无法准时准确的为所有VM提供时钟中断和.时钟标记. 这样VM就很根据这些信号计算出准确的时间. 所以需要与时间源同步.
VM可以选择与ESX服务器做时间同步, 或是采用惯常的同步方式与其他时间源同步.
VM与ESX时间同步. 是由ESX直接提供时间给VM(而不是上述的时钟中断, 标记, 由VM自己计算出时间). VM必需安装VMWARE TOOLS. 然后在VMWARE TOOLS的配置中选择: 与ESX HOST同步. 如果是WINDOWS VM, 必需关闭WINDOWS TIME SERVICE, 否则WINDOWS TIME SERVICE将霸占UDP 123口, 使与ESX的时间同步无法正常进行.
VM与ESX时间同步, 只有当VM的时间>>落后<<于ESX时才能起到校正的作用!
如果不采用VM与ESX进行时间同步. VM可以与其他NTP时间源同步. 加入了WINDOWS AD的WINDOWS PC/服务器, 一般莫认与PD同步. 其他的需要手动设置.
1、windows os关闭时钟同步功能,安装vmware-tools,设置同步为开。
2、linux os 关闭ntpd服务,安装vmware-tools ,设置同步为开,或者直接编辑vmx文件,并加入:
tools.syncTime = “TRUE”。
Share This