LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Virtualization and Cloud
User Name
Password
Linux - Virtualization and Cloud This forum is for the discussion of all topics relating to Linux Virtualization and Linux Cloud platforms. Xen, KVM, OpenVZ, VirtualBox, VMware, Linux-VServer and all other Linux Virtualization platforms are welcome. OpenStack, CloudStack, ownCloud, Cloud Foundry, Eucalyptus, Nimbus, OpenNebula and all other Linux Cloud platforms are welcome. Note that questions relating solely to non-Linux OS's should be asked in the General forum.

Notices


Reply
  Search this Thread
Old 09-20-2017, 02:20 AM   #1
Marco2G
LQ Newbie
 
Registered: Aug 2016
Posts: 16

Rep: Reputation: Disabled
KVM taking too long to kill vm on host shutdown


Hello everyone

I just noticed that my observium vm wasn't shutting down even after 120 seconds so in turn the zfs storage didn't unmount cleanly.

Is there an option to set kvm to force shutdown a vm that didn't go down in time? I would prefer not to have to edit the libvirt-guests init script if at all possible but if it's the only way, that would work too.

In that case I'd need a bit of help since I'm not very familiar with bash scripting.

Thank you!

Regards,

Marco
 
Old 09-22-2017, 01:30 PM   #2
Pearlseattle
Member
 
Registered: Aug 2007
Location: Zurich, Switzerland
Distribution: Gentoo
Posts: 999

Rep: Reputation: 142Reputation: 142
Hi
KVM doesn't try to do anything on its own with the VMs (doesn't try to shut them down e.g. when you shut down the host).

Are you using "libvirt" to handle the VMs or are you using your own scripts/commands?

I'm using "libvirt" and I integrated in my server's shutdown sequence this script (for this to work the VM has to have the service "acpid" running).

Cheers
 
Old 09-22-2017, 01:40 PM   #3
Marco2G
LQ Newbie
 
Registered: Aug 2016
Posts: 16

Original Poster
Rep: Reputation: Disabled
Hmmm I could replace the libvirt-guests portion that stops vms with this code. That ought to work I expect.
 
Old 09-22-2017, 01:47 PM   #4
Pearlseattle
Member
 
Registered: Aug 2007
Location: Zurich, Switzerland
Distribution: Gentoo
Posts: 999

Rep: Reputation: 142Reputation: 142
Quote:
libvirt-guests portion that stops vms
Eeehhh, sorry I wasn't aware that something like that exists => maybe then it's just a matter of starting "acpid" in the guests?
 
Old 09-22-2017, 03:04 PM   #5
Marco2G
LQ Newbie
 
Registered: Aug 2016
Posts: 16

Original Poster
Rep: Reputation: Disabled
The acpid service is running on both vms that won't shut down. Both are ubuntu 16.04s.

What does shut down is the untangle vm.

All of these machines shut down in a matter of seconds when issuing virsh shutdown DOMAIN on the shell. As far as I can see, libvirt-guests uses exactly the same command...
 
Old 09-22-2017, 03:57 PM   #6
Pearlseattle
Member
 
Registered: Aug 2007
Location: Zurich, Switzerland
Distribution: Gentoo
Posts: 999

Rep: Reputation: 142Reputation: 142
What's the "untangle vm"?
I integrated the script in my shutdown sequence (OpenRC) because I basically thought (and tested with my local PC) that libvirt did not care about the running hosts, which I admit being weird (as libvirt aims to be a mgmt engine for the VMs and should therefore take care of such basic things like the host going down), but which was kind-of-confirmed after finding the github post, but which does not make sense seeing the presence of "libvirt-guests.conf"... .

Mmmhhh and I see now that I do not start any "libvirt-guests" on my server when I boot - not sure if I don't because it did not work or else => do you start "libvirt-guests" when your server/PC boots?

Thx
 
Old 09-22-2017, 04:15 PM   #7
Marco2G
LQ Newbie
 
Registered: Aug 2016
Posts: 16

Original Poster
Rep: Reputation: Disabled
Untangle is a debian based virtual firewall appliance.

And yes, my vms would start automatically if it weren't for the fact that the zfs filesystem they're residing doesn't come up cleanly due to not being able to unmount cleanly due to vms still running on it when it shuts down .

That's a checkmark you can set in virt-manager, if you're using that one.

I have created a script that runs after boot to clean zfs, mount everything and start all domains. However, instead of cleaning up what gets broken on every reboot, I'd rather it not break in the first place, you know?

I have incorporated parts of your script into libvirt-guests but I can only test it when the wife is done watching movies off the server
 
Old 09-23-2017, 11:04 AM   #8
Pearlseattle
Member
 
Registered: Aug 2007
Location: Zurich, Switzerland
Distribution: Gentoo
Posts: 999

Rep: Reputation: 142Reputation: 142
Got it, thanks
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
mysqld taking to long to shutdown? shams Linux - Server 2 03-09-2017 09:16 AM
firewalld help: trying to forward https from kvm host to kvm guest on same port GaWdLy Linux - Networking 4 07-15-2016 02:27 PM
FORCE SHUTDOWN -> Auto-Kill apps that prevent Shutdown - HOW ?? ttiihone Linux - General 3 01-19-2015 08:19 AM
DHCP IP not taking by KVM based host Vm cheers Red Hat 4 07-05-2014 12:38 AM
ssh taking too long to find the host avdhesh Fedora 2 04-17-2008 12:46 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Virtualization and Cloud

All times are GMT -5. The time now is 10:56 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration