Shutdown VM

Hello,

on my Cloudmin GPL server is Ubuntu VM. As backup app is using Bacula, which is set to shutdown Ubuntu VM by cloudmin shutdown command (cloudmin shutdown-system --host ubuntu.domain.local).

Cloudmin has full access to VM (SSH, webmin), but all shutdown by this command is forced. No nice shutdown by SSH, webmin or ACPI.

I tested to send ACPI shutdown in qemu monitor (system_powerdown) and it’s working as nice properly shutdown.

Please, can anybody explain me how shutdown command works?

Anybody not know?

There’s some documentation on how the Cloudmin shutdown-system command works:

http://www.virtualmin.com/documentation/cloudmin/devel/cli/shutdown_system

It sounds like it just uses the “shutdown” command to handle that.

So it should be a clean shutdown.

One thing you may want to check is to make sure that manually running “shtudown” on that system actually does perform a clean shutdown.

-Eric

Sorry for late answer,

I found where is my problem hidden. In function type_kvm_shutdown (webmin/server-manager/kvm-type-lib.pl) is written try to run POWEROFF -F by executing command on VM as a first point. But poweroff with argument -f not run gracefully shutdown. If I change to only POWEROFF or SHUTDOWN -P NOW system is shutting down properly.

And why not shutdown by ACPI?
ACPI shutdown would be executed if cloudmin execute_command_on_server is not working at all.

Please correct me if I’m wrong.

(Sorry for my English, it’s not my native language).

My system is not shutting down in 30 seconds, so cloudmin kill it. And why new clean image of Ubuntu server 12.04 is not down in 30 second? Answer is webmin. Webmin service shutdown time is more than 15 seconds.

I solve this by this change (webmin/server-manager/kvm-type-lib.pl):

# Try poweroff command my ($out, $ex, $err) = &execute_command_on_server($server, "poweroff >/dev/null 2>&1 </dev/null &", 5); #<-- remove -f argument return $err if ($err); return $out if ($ex);
    # Wait 60 seconds for shutdown #<-- change from 30 to 60 seconds
    my $tries = 0;
    while($tries < 180) { #<-- change from 30 to 180 seconds, good choice if You have Windows VM

Do not forget to restart webmin (cloudmin) service.