In our lab, we have a server running Ubuntu Linux 8.04.4 x64, with VMware Server 2.1 hosting 4 VM's.
I have a major concern with regards to shutting down the host server. Mostly, how do I ensure that the guest VM's are being shut down safely?
In the VMware web interface console, I have enabled:
- "Allow virtual machines to start and stop automatically with the system"
- I enabled the Default Startup Delay for 15 seconds along with the "Start next VM immediately if the VMware Tools start" option checked
- I enabled the Default Shutdown Delay with a 60 second shutdown delay and a Shutdown Action of "Shut Down Guest"
All VM's have the VMware Tools installed and properly working. All VM's are moved up into the "Specified Order" section of "Startup Order", thus when powering the server back on, all those VM's should start up again in that specified order.
When I went to shut down the server, I used the shutdown -h now
command. Based on the settings I entered above, I was expecting a 4 minute shutdown, as there is an option to delay the shutdown of each VM by 60 seconds. However, that is not what happened. Instead, the server shutdown in under a minute.
When I powered the server back on, only 2 VM's properly loaded. The other 2 showed the following error:
"Power on Virtual Machine" failed to complete
If these problems problems persist, please contact your system administrator.
Details: Cannot open the disk '[location to .vmdk]' or one of the snapshot disks it depends on. Reason: Failed to lock the file.
Obviously, if this error occured, then it is clear to me that the VM's were not properly shutdown, or the server powered off before the VM's were completely shutdown. I have fixed the above error by deleting the .lck files in the respective VM directories.
How would I know if the VM's were properly shut down? I checked the VMware-server logs, but they only seem to display the logs of when the vmware-mgmt service is running in the current session. I'm mostly running Linux VM's, so is there an easy way to know whether or not a server was properly shut down in Linux?
Thank you all for the help!
If you use shutdown -h now, it will shut down immediatly regardless of "default settings" since you override those with the parameter.
That being said, last time we shut down our environment we did each VM seperately, waited until they all showed as powered off, and then shutdown the host (ESXi in this case). This allows you to check for errors during shutdown of the VM's, and in our case shutdown the webservers and THEN the database servers of a specific application to avoid any errors.
We do the same when starting up, and again make sure there's no errors.
I think it's important to figure out a proper shutdown and startup procedure in the case of production environments.
That being said, I think you will need to supply more information on what VM's they are. I think VMware Server won't be able to tell the difference between a shutdown with errors and one without.
P.S. why not use ESXi to begin with?
SSH into each VM and issue
shutdown -h now
. This is the proper way to shut down a linux machine, virtual or not.