首页 > 其他分享 >ESXI设置时区,时间校准

ESXI设置时区,时间校准

时间:2023-07-31 12:00:29浏览次数:44  
标签:校准 ESXI Shanghai etc 设置 NTP 物理 localtime

相信会考虑这个问题的人,都是因为要设置虚拟机的调度任务吧:)

一开始我还是想着打开NTP服务,通过NTP服务校准时间,不过后来经过了解,NTP漏洞也比较多,如果在物理机上开放NTP服务和端口,风险比较大

权衡之后,还是觉得:1.修改物理机ESXI系统时区,2修改物理机ESXI为正确时间即可

废话不多说,直接上操作

1.拷贝一份时区正常的虚拟机的文件

/usr/share/zoneinfo/Asia/Shanghai

date命令查看时间和时区
CST即为中国时区

 

2.上传Shanghai文件至要配置的物理机上的 /vmfs/volumes/*** 磁盘目录下

注意:一定要上传到数据存储目录,其它目录ESXI重启系统都会还原,文件也会丢失

我这里上传的目录如下

 

3.重命名/etc/localtime,并给/etc/localtime建立软连接

mv /etc/localtime /etc/localtime_bak
ln -s /vmfs/volumes/5be449f9-281acc6a-2bf4-20040fec50ba/zoneinfo/Asia/Shanghai  /etc/localtime

4.把以上步骤加入开机启动脚本

/etc/rc.local.d/local.sh

#!/bin/sh

# local configuration options

# Note: modify at your own risk!  If you do/use anything in this
# script that is not part of a stable API (relying on files to be in
# specific places, specific tools, specific output, etc) there is a
# possibility you will end up with a broken system after patching or
# upgrading.  Changes are not supported unless under direction of
# VMware support.

# Note: This script will not be run when UEFI secure boot is enabled.


mv /etc/localtime /etc/localtime_bak
ln -s /vmfs/volumes/5be449f9-281acc6a-2bf4-20040fec50ba/zoneinfo/Asia/Shanghai  /etc/localtime



exit 0

 

5.校准物理机时间

可以在物理机控制台操作

配置>时间配置>编辑>编辑时间配置

 

 也可以直接命令行操作

esxcli system time set -d 08 -H 16 -m 01 -M 03 -y 2016

我是直接界面操作的

6.检查修改结果

 重启物理机后,时间依旧正常

 

参考文档:

https://blog.51cto.com/jdonghong/1957118

https://www.pianshen.com/article/42901992875/

标签:校准,ESXI,Shanghai,etc,设置,NTP,物理,localtime
From: https://www.cnblogs.com/allay/p/17593076.html

相关文章

  • intellij idea 设置java快捷输出
    file-》setting-》Editor-》liveTemplate-》java 输入sout,回车: 就会自动生成System.out.println()语句 ......
  • 如何判断网卡是千兆还是万兆,以及设置万兆网卡的方法
    判断网卡是千兆还是万兆的命令为:ethtool网卡名,例如:ethtoolenp125s0f0VMware网卡速率改为万兆:1、打开虚拟机系统安装目录,找到*.vmx这个文件,配置前最好备份一份,免得后面搞坏还能及时恢复。2、用记事本打开这个文件,将ethernet0.virtualDev="e1000"这行改为ethernet0.virtualD......
  • 设置轮播图的高度和宽度一样
     设置轮播图的高度和宽度一样不能用height:100%,只能是页面加载后取当前窗口宽度,再设置样式高度为取到的值 this.winWidth=uni.getWindowInfo().windowWidthconsole.log("当前窗口宽度:"+this.winWidth);<swiperclass="swiper":style="{height:winWidth......
  • typora自动编号设置,pdf导出也带编号
    鉴于目前网上的baser.use.css文件配置都无法在pdf导出时保存编号,所以列出baser.use.css文件内容(之前在网上找的,找不到链接了),该配置可以在导出pdf的时候保存编号,亲测。/***author:LPZ*email:[email protected]*/h1,h2,h3,h4,strong{font-weight:600;}/*......
  • IDEA设置
    IDEA设置1.字体大小设置File->Settings->Editor->Font2.取消自动更新File->Settings->Appearance&Behavior->SystemSettings->Updates3.代码提示忽略大小写File->Settings->Editor->CodeCompletion->Matchcase4.修改项目文件等......
  • uniapp Ucharts 横向bar图 每个设置颜色不同
    代码-------》》》arr=[80,80,80]letvalueList=arr.map((item,index)=>{ letcolor='' letnewNumber=Number(item) if(index==0)color='#5593FE' if(index==1)color='#93b6f8' if(ind......
  • uniapp 移动端axisLabel 设置formatter无效的解决方法
    pc端是直接在option里配置移动端在renderjs里的监听变化的时候去设置updateEcharts(newValue,oldValue,ownerInstance,instance){//监听service层数据变更try{newValue.xAxis.axisLabel.formatter=function(......
  • RectTransform的两个设置大小的api
     varrtf=GetComponent<RectTransform>();rtf.SetSizeWithCurrentAnchors(RectTransform.Axis.Horizontal,200);SetSizeWithCurrentAnchors不会改变anchorMin和anchorMax设置大小会根据pivot的值,往两边扩充 varrtf=GetComponent<RectTransform>();rtf.SetInset......
  • 【Python】使用 pyecharts 模块绘制动态时间线柱状图 ① ( 列表排序 | 使用 sorted 函
    文章目录一、列表排序1、使用sorted函数对容器进行排序2、使用list.sort函数对列表进行排序3、使用list.sort函数对列表进行排序-设置排序函数4、使用list.sort函数对列表进行排序-设置lambda匿名排序函数pyecharts画廊网站:https://gallery.pyecharts.org/#/......
  • 使用StoryBoard设置Scrollview的横向滚动不用一行代码
    1).创建一个空工程Single类型的工程,然后打开故事版(StoryBoard)在ViewController上添加scrollview2).然后对scrollview添加约束,上下左右全部都是0就可以(注意:在添加上下左右约束的时候一定要取消Constraintomargins,否则添加完的约束会出现左右各缺少20像素的边距)3).添加完......