[color=rgb(51, 51, 51) !important]ESXi主机常年不关机、不重启,管理员平时会很少登录ESXi主机进行维护,时间一长,密码就会忘记了。 [color=rgb(51, 51, 51) !important]一、ESXI主机没有加入vCenter恢复方法:
[color=rgb(51, 51, 51) !important]1.1重新安装ESXi系统,保留VMFS数据库 [color=rgb(51, 51, 51) !important]重新安装ESXi系统会将原来的虚拟机列表等配置清空,使用vSphere Client连接ESXi主机,浏览存储将虚拟机添加到清单。 [color=rgb(51, 51, 51) !important]1.1.1加载安装光盘,步骤略 [color=rgb(51, 51, 51) !important]  [color=rgb(51, 51, 51) !important]“ESXi and VMFS Found”有三种安装模式: [color=rgb(51, 51, 51) !important]第一个升级ESXi并保留数据文件; [color=rgb(51, 51, 51) !important]第二个安装ESXi并保留数据文件; [color=rgb(51, 51, 51) !important]第三个安装ESXi并覆盖数据文件; [color=rgb(51, 51, 51) !important]根据需要选择对应安装模式,如果是恢复密码选择第二种模式。 [color=rgb(51, 51, 51) !important]1.2使用Linux、CentOS启动光盘进入恢复模式,清空密码 [color=rgb(51, 51, 51) !important]不影响ESXI主机里面的虚拟机配置、网络配置 [color=rgb(51, 51, 51) !important]1.2.1加载CentOS光盘镜像,选择Rescue installed system,如下图: [color=rgb(51, 51, 51) !important] 
[color=rgb(51, 51, 51) !important]  [color=rgb(51, 51, 51) !important]  [color=rgb(51, 51, 51) !important]  [color=rgb(51, 51, 51) !important]  [color=rgb(51, 51, 51) !important]  [color=rgb(51, 51, 51) !important]  [color=rgb(51, 51, 51) !important]1.2.2 已经进入到救援模式,执行以下命令: [color=rgb(51, 51, 51) !important]mkdir /mnt/sda5
mount /dev/sda5 /mnt/sda5
cp /mnt/sda5/state.tgz /tmp/
cd /tmp
tar xvfz state.tgz
tar xvfz local.tgz
vi /tmp/etc/shadow(救援模式下只能使用vi,不能使用vim,直接使用x进行删除,不要按i键进入编辑模式删除)
将光标移动到root及第一个冒号后,按x键,将第一个冒号与第二个冒号之间的内容删除,删完之后按esc键,输入wq保存退出 [color=rgb(51, 51, 51) !important]  [color=rgb(51, 51, 51) !important]rm /tmp/state.tgz /tmp/local.tgz
tar czvf local.tgz etc/
tar czvf state.tgz local.tgz
cp state.tgz /mnt/sda5/
输入esxi返回,选择reboot Reboot重新启动;进入ESXI系统后,按F2,重新设置密码 [color=rgb(51, 51, 51) !important]二、ESXI主机加入到vCenter恢复密码方法: [color=rgb(51, 51, 51) !important]使用vcenter server的“主机配置文件”来重置ESXI主机密码
使用vsphere client登录vcenter,点击主页-主机配置文件-创建主机配置文件-从现有主机中创建配置文件-选择要重置密码的主机-输入名称
创建配置文件完成,选择编辑配置文件-安全配置-管理员密码-选择配置固定的管理员密码,如下图: [color=rgb(51, 51, 51) !important]  [color=rgb(51, 51, 51) !important]
将主机进行维护模式,右击主机选择主机配置文件-管理配置文件-选择刚刚创建的配置文件,点击确定;
在将配置文件进行应用,应用完成后将主机退出维护模式,如下图: [color=rgb(51, 51, 51) !important]  [color=rgb(51, 51, 51) !important]审核编辑:黄飞
https://www.elecfans.com/d/2735461.html
|