Results 1 to 9 of 9

Thread: libvirtd doesnt shutdown virtual machines

  1. #1
    Join Date
    Apr 2007
    Beans
    44

    Question libvirtd doesnt shutdown virtual machines

    Hello,

    I setup an Ubuntu 9.10 server with libvirtd. I configured a machine, set it up with Ubuntu 9.10 as well via virt-manager from my client. I had to install acpid to bring the shutdown button of virt-manager to work. But when I shutdown the host, the client is just destroyed, not properly halted. How can I fix that? (I checked it by doing a echo `date` > /root/time in the stop part of a init.d script. The file is never created. Also the host machine shutdown real fast, ~2-3sec!). How should it work? Should the KVM process itself fire the acpi event or should libvirtd talk to the KVM processes?

    ATM I use a solution documented here http://docs.google.com/Doc?id=drjq7vn_0ctn8k3dd

    But it can't be that the default virtualization solution doesnt provide a working shutdown solution, can it? Did anyone have the same problem?

    Thanks
    falstaff

  2. #2
    Join Date
    May 2009
    Beans
    1
    Distro
    Kubuntu 9.10 Karmic Koala

    Re: libvirtd doesnt shutdown virtual machines

    I'm having the same problem on a 8.04 host, and currently using some scripts to shutdown the domains prior to host shutdown

    Have you managed to make it work without the help of customised script?

  3. #3
    Join Date
    Jul 2008
    Beans
    10

    Re: libvirtd doesnt shutdown virtual machines

    With kvm as the virtualisation solution, it doesn't even support reboot (which ought to be trivial to fix, really -- a shutdown followed by a start after the vm actually stops). I suspect xen might allow a reboot signal to be communicated kernel to kernel, and there is no equivalent in kvm, being that there is no reboot switch in hardware.

    An rc script that upon the server going into shutdown or reboot sends a shutdown command to any running domains, then waits n seconds or until everything's dead, and then continues would probably be the neatest way of doing this, and it might be worth making that a part of the standard libvirt package once it's properly developed.

    It still won't help with non-acpi clients, which is why you need the wait max n seconds by default (otherwise shutdown hangs entirely on the server, which sucks), and because of that requirement it'll be a problem for really slow clients. But overall, it would make virtualisation on ubuntu easier to deal with, and clients would be subject to fewer randomised Issues.

    The script linked to earlier is not Open Source, as far as I can tell (unless anything on google docs automatically goes GPL), so would be unsuitable for direct inclusion. It does seem to work, although the save state process is incredibly slow, apparently -- a 128M memory VM already takes ages to do. The script being sequential doesn't help there -- depending on what exactly is the bottleneck, it might be faster to save states for multiple domains simultaneously.
    Last edited by DuronForever; March 13th, 2010 at 11:13 PM.

  4. #4
    Join Date
    Nov 2005
    Location
    Allentown, PA
    Beans
    123
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: libvirtd doesnt shutdown virtual machines

    Is there any new information on this issue now that 10.10 is out and it is 10 months later?

    Also, is this why virt-manager can't take these actions?

  5. #5
    Join Date
    Dec 2006
    Beans
    Hidden!

    Re: libvirtd doesnt shutdown virtual machines

    wow, this is still a problem. I remember from over a year ago it was doing this.
    why not go with vbox 4.0? has usb 2.0 now.
    With vbox, you can save the machine state. Then when you restart, it comes back in less than 10 seconds.

  6. #6
    Join Date
    Nov 2005
    Location
    Allentown, PA
    Beans
    123
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: libvirtd doesnt shutdown virtual machines

    Further research shows that with a simple 'sudo apt-get install acpid' (not just acpi) on the guest machine the shutdown process works as expected rather than destroying (aka forced power-off) the machine. Apparently certain parameters in the xml config of the machine may also need to be set to identify acpi compatibility.

    A reboot still is not performed when requested, but I understand this can be scripted around if desired.

    I'd not move to VBox because I'm already well invested in the current solution and a conversion isn't worth the effort, especially since these machines shouldn't be going up and down very often in a production environment. That would be a much bigger problem. This is minor.

    I also have some concern about VBox related to who has control of it (see the MySQL drama) and the separate license for Extension packs (the PUEL) which are required for USB 2, PXE, etc. It is only GPL on the base. I hesitate when the first hit is free. Otherwise, I recognize it as a valid and interesting virtualization technology.
    Last edited by flickerfly; January 6th, 2011 at 07:50 PM. Reason: moved sentence I misplaced

  7. #7
    Join Date
    Aug 2011
    Beans
    1

    Re: libvirtd doesnt shutdown virtual machines

    Installed acpid. Still just shuts down the vm's

  8. #8
    Join Date
    Dec 2007
    Beans
    82

    Re: libvirtd doesnt shutdown virtual machines

    sudo apt-get install acpid
    works for me like a charm! thanks!

  9. #9
    Join Date
    Feb 2008
    Location
    Texas
    Beans
    15,010
    Distro
    Ubuntu 12.04 Precise Pangolin

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •