Shutting down VM from Cloudmin does not do proper shutdown

I have noticed that using the Cloudmin menu option Shutdown System simply does a KVM shutdown, it does not execute the normal shutdown sequence on the virtual host itself. This has caused some MySQL corruption for us. I had seen that it shuts down in a second or two, seemed too fast, so, looked in the /var/log directory on the Vm and sure enough, not shut down normally.

So, I guess I need to log into each VM and execute shutdown -h now, however, shouldn't Cloudmin do this?

Status: 
Closed (fixed)

Comments

Yes, Cloudmin should do this, if it can.

Before you shut down the VM, what state is it shown as on the left menu? It has to be something like "SSH" or "Webmin" for Cloudmin to be able to login and perform a clean shutdown.

It shows status "VIrtualmin" in green.

Ok .. and when you perform the shutdown in Cloudmin, did you have the "Force immediate termination" box checked? If so, that will bypass the clean shutdown.

Also, which Linux distribution and version is on the VM?

Same, Centos 6.3, current.

I had a look at the code, and found that Cloudmin uses the command poweroff -f to shut down the VM.

If you run that manually, does it perform an immediate shutdown?

Yes, executing that command on the VM does in fact kill it immediately. Which is much different than a shutdown -h now which DOES execute the rc scripts to shut things down properly.

Ok, it looks like the -f flag to poweroff is a mistake - it causes the clean shutdown process to be skipped. I will remove this in the next Cloudmin release.

Actually, that's fine (-f) if the user checks the box that says "Force Immediate Termination". Which of course I am not!

The force option is even more brutal - it just kills the KVM process, which is the equivalent of pulling the plug on a physical machine. I only recommend using that if the VM is totally hung.

I agree, just saying the code should still support -f if you check that box. Assuming you keep the box. If you do not check the box, which should (almost) always be the case, yes, please remove -f.

Automatically closed -- issue fixed for 2 weeks with no activity.