自动关闭esxi主机及所有虚拟机
2013-01-02 13:32
561 查看
This script would be using two commands available on the esxi.
/sbin/powerOffVms (Stop the current’s running vms)
/bin/poweroff (Stop the Esx host)
I have called it: auto-shutdown.sh
----------
Details:
#! /bin/ash
echo "shutting down VMs..please wait.."
/sbin/powerOffVms
echo "done."
echo "shutting down the host now.."
/bin/poweroff
———-
Apply the execution’s rights :
chmod +x /vmfs/volumes/datastore1/auto-shutdown.sh
Add this script in /etc/rc.local
/bin/echo “0 22 * * * /vmfs/volumes/datastore1/auto-shutdown.sh” >> /var/spool/cron/crontabs/root
This script would stop the vms and the Esxi host everyday at 22h.
/sbin/powerOffVms (Stop the current’s running vms)
/bin/poweroff (Stop the Esx host)
I have called it: auto-shutdown.sh
----------
Details:
#! /bin/ash
echo "shutting down VMs..please wait.."
/sbin/powerOffVms
echo "done."
echo "shutting down the host now.."
/bin/poweroff
———-
Apply the execution’s rights :
chmod +x /vmfs/volumes/datastore1/auto-shutdown.sh
Add this script in /etc/rc.local
/bin/echo “0 22 * * * /vmfs/volumes/datastore1/auto-shutdown.sh” >> /var/spool/cron/crontabs/root
This script would stop the vms and the Esxi host everyday at 22h.
相关文章推荐
- 在ESXi主机上关闭无响应的虚拟机
- 在ESXi主机上关闭无响应的虚拟机
- 全手工打造ESXI6.0 自动关闭虚拟服务器及ESXI主机脚本
- 在ESXi主机上关闭无响应的虚拟机
- 在ESXi主机上关闭无响应的虚拟机
- 用javascript实现始终保持打开同一个子窗口以及关闭父窗口同时自动关闭所有子窗口
- Eclipse取消或者关闭tomcat所有自动发布(部署)方法
- 使用 ESXi esxcli 命令关闭虚拟机电源
- VMware所在主机系统开机自动启动并引导虚拟机操作系统
- 针对ESXi主机下面虚拟机的完整命令行操作手册
- 为ESXi主机上的虚拟机安装VM tools
- 使用Azure CLI实现自动关闭Azure虚拟机的脚本
- ESXI5.5设置主机的时间自动同步服务 NTP
- ubutnu 自动登出 logout 所有程序关闭
- 添加ESXi主机并创建虚拟机 推荐
- Windows 7的VPC虚拟机自动不与主机时间同步的解决办法
- 厂区停电IT方面注意点&远程关闭虚拟机主机
- Windows下关闭所有驱动盘的自动播放
- 始终保持打开同一个子窗口以及关闭父窗口同时自动关闭所有子窗口
- [ESXi 6.5] 设置ESXi宿主机开机自动启动虚拟机