Esxi6.7 修改时区及时间

1、开启shell进行连接主机

Esxi6.7 修改时区及时间

 2、从其他一台Linux主机拷贝一个 /usr/share/zoneinfo/Asia/Shanghai 文件到ESXI主机

查看主机时间

[root@localhost:~] date
Thu Jul 23 10:14:13 UTC 2020

 

查看主机信息

[root@localhost:~] uname -a
VMkernel localhost 6.7.0 #1 SMP Release build-13644319 May  9 2019 21:20:34 x86_64 x86_64 x86_64 ESXi

 

从其他一台Linux主机拷贝一个 /usr/share/zoneinfo/Asia/Shanghai 文件到ESXI主机的数据卷目录(即存储虚拟机文件的那个目录,其他目录重启ESXI会被还原掉)。

[root@localhost:~] ls /etc/
SHAC_Config.ini                  environment                      krb5.keytab                      ntp.keys                         rc.local                         ssh
X11                              group                            krb5.mkey                        openwsman                        rc.local.d                       vSphereProvisioning-resolv.conf
banner                           host.conf                        krb5.realms                      opt                              resolv.conf                      vmotion-resolv.conf
chkconfig.db                     hosts                            likewise                         pam.d                            security                         vmsyslog.conf
config                           init.d                           localtime                        passwd                           services                         vmsyslog.conf.d
dhclient-vmk0.conf               inittab                          motd                             passwdqc.conf                    sfcb                             vmware
dhclient-vmk0.leases             issue                            nscd.conf                        profile                          shadow                           vmware-tools
dhclient6-vmk0.conf              keymap                           nsswitch.conf                    profile.local                    shells
dhclient6-vmk0.leases            krb5.acl                         ntp.conf                         protocols                        shutdown.d
eToken.conf                      krb5.conf                        ntp.drift                        random-seed                      slp.reg
[root@localhost:~] mv /etc/localtime /etc/localtime.bak
[root@localhost:~] ls /etc/
SHAC_Config.ini                  environment                      krb5.keytab                      ntp.keys                         rc.local                         ssh
X11                              group                            krb5.mkey                        openwsman                        rc.local.d                       vSphereProvisioning-resolv.conf
banner                           host.conf                        krb5.realms                      opt                              resolv.conf                      vmotion-resolv.conf
chkconfig.db                     hosts                            likewise                         pam.d                            security                         vmsyslog.conf
config                           init.d                           localtime.bak                    passwd                           services                         vmsyslog.conf.d
dhclient-vmk0.conf               inittab                          motd                             passwdqc.conf                    sfcb                             vmware
dhclient-vmk0.leases             issue                            nscd.conf                        profile                          shadow                           vmware-tools
dhclient6-vmk0.conf              keymap                           nsswitch.conf                    profile.local                    shells
dhclient6-vmk0.leases            krb5.acl                         ntp.conf                         protocols                        shutdown.d
eToken.conf                      krb5.conf                        ntp.drift                        random-seed                      slp.reg
[root@localhost:~]
[root@localhost:~]
[root@localhost:~] mv Shanghai /etc/localtime
[root@localhost:~]
[root@localhost:~]
[root@localhost:~] ls /etc/
SHAC_Config.ini                  environment                      krb5.keytab                      ntp.drift                        random-seed                      slp.reg
X11                              group                            krb5.mkey                        ntp.keys                         rc.local                         ssh
banner                           host.conf                        krb5.realms                      openwsman                        rc.local.d                       vSphereProvisioning-resolv.conf
chkconfig.db                     hosts                            likewise                         opt                              resolv.conf                      vmotion-resolv.conf
config                           init.d                           localtime                        pam.d                            security                         vmsyslog.conf
dhclient-vmk0.conf               inittab                          localtime.bak                    passwd                           services                         vmsyslog.conf.d
dhclient-vmk0.leases             issue                            motd                             passwdqc.conf                    sfcb                             vmware
dhclient6-vmk0.conf              keymap                           nscd.conf                        profile                          shadow                           vmware-tools
dhclient6-vmk0.leases            krb5.acl                         nsswitch.conf                    profile.local                    shells
eToken.conf                      krb5.conf                        ntp.conf                         protocols                        shutdown.d

 

修改时间命令

[root@localhost:~] esxcli system time set --help
Usage: esxcli system time set [cmd options]

Description:
  set                   Set the system clock time. Any missing parameters will default to the current time

Cmd options:
  -d|--day=<long>       Day
  -H|--hour=<long>      Hour
  -m|--min=<long>       Minute
  -M|--month=<long>     Month
  -s|--sec=<long>       Second
  -y|--year=<long>      Year

 

手动设置时间

[root@localhost:~] esxcli system time set -H 10 -m 34 -s 18

 

end

参考网站:

Esxi 修改时区及时间

https://blog.51cto.com/8686505/2418571

ESXI6.0 时间显示不正确

http://www.fyluo.com/index.php?post=208

上一篇:看这里:Java核心卷第十版—— 包含一卷二卷(阿里云盘分享)


下一篇:webservice cxf学习