NTP na vCenter 6

Zapomenout na vCenter 5.x a jeho bravurní setting web na portu 5480 🙁

moc pěkný článek:
http://blog.ukotic.net/2015/03/23/modifying-vcenter-server-appliance-6-vcsa-ntp-settings/

1. Nastavíme a zapneme NTP (přes ssh/putty):
login as: root

VMware vCenter Server Appliance 6.0.0

Type: vCenter Server with an embedded Platform Services Controller

root@vcenter’s password:
Last login: Tue Oct 13 13:50:17 2015 from reddragon.brno.amcobex.cz
Connected to service

* List APIs: „help api list“
* List Plugins: „help pi list“
* Enable BASH access: „shell.set –enabled True“
* Launch BASH: „shell“

Command> ntp.server.add –servers 10.9.1.1
Command> timesync.set –mode NTP
Command> timesync.get
Config:
Mode: NTP
Command> ntp.get
Config:
Status: Up
Servers: 10.9.1.1

2. Nastavit timezone a  hrátky s časem v cmd pro masochisty:

Command> shell.set –enabled True
Command> shell
    ———- !!!! WARNING WARNING WARNING !!!! ———-
Your use of „pi shell“ has been logged!
The „pi shell“ is intended for advanced troubleshooting operations and while
supported in this release, is a deprecated interface, and may be removed in a
future version of the product.  For alternative commands, exit the „pi shell“
and run the „help“ command.
The „pi shell“ command launches a root bash shell.  Commands within the shell
are not audited, and improper use of this command can severely harm the
system.
Help us improve the product!  If your scenario requires „pi shell,“ please
submit a Service Request, or post your scenario to the
https://communities.vmware.com/community/vmtn/vcenter/vc forum and add
„appliance“ tag.

vcenter:~ # vi /etc/sysconfig/clock
vcenter:~ # tail /etc/sysconfig/clock

SYSTOHC=“yes“
## Type:                string(Europe/Berlin,Europe/London,Europe/Paris)
## ServiceRestart:      boot.clock
#
# Timezone (e.g. CET)
# (this will set /usr/lib/zoneinfo/localtime)
#
TIMEZONE=“Europe/Prague“
DEFAULT_TIMEZONE=“CET“

vcenter:~ # vi  /etc/ntp.conf
vcenter:~ # tail /etc/ntp.conf
tinker panic 0
restrict default kod nomodify notrap nopeer noquery
restrict 127.0.0.1
restrict -6 ::1
driftfile /var/lib/ntp/drift/ntp.drift
server 10.9.1.1
restrict -6 default kod nomodify notrap nopeer noquery

vcenter:~ # date 06051117
Fri Jun  5 11:17:00 CEST 2015

vcenter:~ # /sbin/hwclock –systohc
vcenter:~ # /etc/rc.d/ntp restart
Shutting down network time protocol daemon (NTPD)                                                                                                                                 done

Time synchronized with 10.9.1.1
Starting network time protocol daemon (NTPD)                                                                                                                                      done

vcenter:~ # /usr/sbin/ntpq -p
   remote                    refid      st t when poll reach   delay   offset  jitter

==============================================================================
 beta12.brno.amc .LOCL.           1 u   58   64    1    0.440    0.983   0.001

vcenter:~ # date
Tue Oct 13 14:22:17 CEST 2015

3. taková zajímavost (možná už je to opraveno):

VCSA nekomunikuje se zadaným ntp, ale s jeho reverzem(PTR). Takže pozor jak skutečně vypadá PTR záznam pro NTP server (nám ho nechal provider po nějakém předchozím zákazníkovi, kterýmu bohužel běžel na adrese kam doputoval dotaz NTP server a to je pak duchařina, než člověk přijde nato co se děje)

Command> ntpq -p
     remote           refid      st t when poll reach   delay   offset  jitter

==============================================================================
brno.braillnet. .STEP.          16 u 4971   64    0    0.000    0.000   0.001

 Command> ping -a  cisco.amcobex.cz
PING cisco.amcobex.cz (194.213.35.210) 56(84) bytes of data.
64 bytes from brno.braillnet.cz (194.213.35.210): icmp_seq=1 ttl=253 time=1.63 ms

 

 

About Author:

Error! Keyboard not detected. Press any key to continue.