I have long since relied on the /sbin/shutdown.sh && /sbin/poweroff combo to gracefully shut down ESXi hosts and it's never had an issue. After upgrading from 6.0 to 6.5 however my scripts ceased to work.
I SSH'd into the server and ran shutdown.sh manually, only to get the following:
Errors:
Invalid operation requested: This ruleset is required and connot be disabled
Saving current state in /bootbank
Clock updated.
Time: 06:27:02 Date: 12/27/2017 UTC
I stepped through the shutdown script and found that the issue appears when the following is run:
/sbin/services.sh stop
Any ideas what could be causing this?
Although it throws that message, it still should shutdown the host. It does for me in ESXi 6.5 at least.
Hello,
I am on 6.5 ESXi GA and tried the same and it worked. From the error message, this is 6.5 issue with services.sh restart and is mentioned in this services.sh restart problem - This ruleset is required and connot be disabled
It worked for me as below output but I am using 6.5 GA. What is the ESXi 6.5 build number you have?
[root@hostname:~] /sbin/shutdown.sh
Saving current state in /bootbank
Clock updated.
Time: 16:31:12 Date: 12/27/2017 UTC
Thanks,
MS
I'm running 6.5.0 Update 1 (Build 7388607)
Out of interest what are the contents of your shutdown.sh? Mine is as follows:
#!/bin/ash
log() {
echo "$1"
logger init "$1"
}
#Extract and save the random seed
dd if=/dev/urandom of=/etc/random-seed count=1 2>/dev/null
#Power off autostart configured VMs
/sbin/vmware-autostart.sh stop
#Stop running services
/sbin/services.sh stop
#Backup the config (including the random seed)
/sbin/backup.sh 1
#Shutdown syslog daemon
/usr/lib/vmware/vmsyslog/bin/shutdown.sh
Unfortunately while it does run and shuts down my VM's etc, it doesn't actually shut down the server.
Take a look at this:
Hi all,
It is kind of strange that this question is still not answered. Anyway, here is how it worked for me on ESXi 6.5
To shutdown:
sbin/host_shutdown.sh
To startup:(the host would be in maintenance mode when it wakes up)
vim-cmd /hostsvc/maintenance_mode_exit
vim-cmd vmsvc/power.on 1
vim-cmd vmsvc/power.on 2
In the above example, I have powered on my first two VMs after the server exited the maintenance mode.
Hope this helps someone.
Regards.