在虚拟环境(VMware ESXi)上部署了Openstack的Maas和规范分布之后,我发现Maas服务器有一个正确的时钟时间,而用于Openstack的节点有不同的时间。在VMware上,NTP服务器是用ntp.ubuntu.com设置的。


从juju状态来看,我看到容器ntpmaster/0及其ntp.conf是如此配置的:
ubuntu@juju-eba318-3-lxd-1:~$ more /etc/ntp.conf
# juju generated ntp configuration
driftfile /var/lib/ntp/ntp.drift
statistics loopstats peerstats clockstats
filegen loopstats file loopstats type day enable
filegen peerstats file peerstats type day enable
filegen clockstats file clockstats type day enable
restrict -4 default kod notrap nomodify nopeer noquery
restrict -6 default kod notrap nomodify nopeer noquery
restrict 127.0.0.1
restrict ::1
# SERVERS
# LOCAL time source
server 127.127.1.0
fudge 127.127.1.0 stratum 5
# PEERS 为什么是不同的钟?
发布于 2017-07-11 15:56:58
我也有同样的问题,没有找到任何“优雅”或“内置”的解决方案。所以我做了个解决办法:
在/etc/maas/preseeds/curtin_userdata文件中,就在行之后:
late_commands:
maas: [wget, '--no-proxy', {{node_disable_pxe_url|escape.json}}, '--post-data', {{node_disable_pxe_data|escape.json}}, '-O', '/dev/null']添加如下内容:
late_commands:
maas: [wget, '--no-proxy', {{node_disable_pxe_url|escape.json}}, '--post-data', {{node_disable_pxe_data|escape.json}}, '-O', '/dev/null']
setup_timezone_01: ["curtin", "in-target", "--", "sh", "-c", "rm /etc/localtime && ln -s /usr/share/zoneinfo/Europe/Berlin /etc/localtime"]..。并将该Europe/Berlin调整为“欧洲/罗马”或控制器运行的任何位置。
这样,maas将在安装过程中将时区设置到目标计算机中。
再一次,也许不是最好的解决方案,但它做了我的工作。
https://askubuntu.com/questions/930191
复制相似问题