kvm does not shut down

RobFantini

Famous Member
May 24, 2012
2,085
117
133
Boston,Mass
Hello
I have one kvm that will not shutdown for backups or when restarting the node.

restarting the pve host hangs when trying to shutdown the qm . for instance:
Code:
ps -ef|grep shutdown
29085 ?  Ss  0:00  \_ task UPID:sys3:0000719D:020BCE53:568BAC55:qmshutdown:106:root@pam:
kill 29085

here is the .conf :
Code:
#turnkey system
agent: 1
balloon: 1024
bootdisk: virtio0
cores: 4
memory: 4096
name: mediawiki
net0: virtio=26:25:86:15:82:3C,bridge=vmbr1
numa: 0
onboot: 1
ostype: l26
protection: 1
smbios1: uuid=d7722525-6011-47ea-85fd-a942eff31a12
sockets: 1
virtio0: kvm-zfs:vm-106-disk-1,cache=writeback,size=32G

Any clues on how to make it so this KVM can be shutdown from pve ?
 
What type of OS runs inside that KVM ?

if "stop" does not work via GUI, check "qm stop vmid" via CLI - if it throws errors (as in "i cant do that Rob"), then they normally point to the issue by way of error message.
 
Hi Rob, I think the vm dosnt have acpid installed and running . So you should have running acpid inside the vm.
cu peje
 
What type of OS runs inside that KVM ?

if "stop" does not work via GUI, check "qm stop vmid" via CLI - if it throws errors (as in "i cant do that Rob"), then they normally point to the issue by way of error message.

I tried that before, and again for fun it just hangs and does not return anything.
 
Hi Rob, I think the vm dosnt have acpid installed and running . So you should have running acpid inside the vm.
cu peje
apcid is installed and is running. I compared config files at /etc/acpi and they are the same as another kvm .
and there is a acpi process running.
 
Why here is

turnkey system

at your config? Have you migrated some LXC or Openvz to KVM? What debian do you use as VM. Debian8. How the VM is installed? I would like to readjust your config.
 
Why here is

turnkey system

at your config? Have you migrated some LXC or Openvz to KVM? What debian do you use as VM. Debian8. How the VM is installed? I would like to readjust your config.

the system was originally installed using an iso from turnkey. just a lamp template.

at first it ran wheezy then was upgraded to jessie .

that "# turnkey system ' is just a note i put in pve > summary > Notes
 
does syslog show anything when you try to execute "qm stop id" ?
it just hangs :
Code:
Jan  6 03:28:00 sys3 qm[23442]: <root@pam> starting task UPID:sys3:00005B93:0070F7DD:568CD010:qmshutdown:106:root@pam:
Jan  6 03:28:00 sys3 qm[23443]: shutdown VM 106: UPID:sys3:00005B93:0070F7DD:568CD010:qmshutdown:106:root@pam:
Jan  6 03:34:14 sys3 pmxcfs[6981]: [status] notice: received log
Jan  6 03:35:01 sys3 CRON[25944]: (root) CMD (command -v debian-sa1 > /dev/null && debian-sa1 1 1)
it has been 8 minutes so I'll press ctl + c :
Code:
# qm shutdown 106
^CVM quit/powerdown failed
sys3  ~ # date
Wed Jan  6 03:37:21 EST 2016
and back at the log:
Code:
Jan  6 03:37:16 sys3 qm[23443]: VM 106 qmp command failed - received interrupt
Jan  6 03:37:16 sys3 qm[23443]: VM quit/powerdown failed
Jan  6 03:37:16 sys3 qm[23442]: <root@pam> end task UPID:sys3:00005B93:0070F7DD:568CD010:qmshutdown:106:root@pam: VM quit/powerdown failed

I'll shutdown, backup and try the above on a 3.1 system
 
Code:
sys3  /var/log # pveversion -v
proxmox-ve: 4.1-28 (running kernel: 4.2.6-1-pve)
pve-manager: 4.1-2 (running version: 4.1-2/78c5f4a2)
pve-kernel-4.2.6-1-pve: 4.2.6-28
pve-kernel-4.2.2-1-pve: 4.2.2-16
pve-kernel-4.2.3-1-pve: 4.2.3-18
pve-kernel-4.2.3-2-pve: 4.2.3-22
lvm2: 2.02.116-pve2
corosync-pve: 2.3.5-2
libqb0: 0.17.2-1
pve-cluster: 4.0-29
qemu-server: 4.0-42
pve-firmware: 1.1-7
libpve-common-perl: 4.0-42
libpve-access-control: 4.0-10
libpve-storage-perl: 4.0-38
pve-libspice-server1: 0.12.5-2
vncterm: 1.2-1
pve-qemu-kvm: 2.4-18
pve-container: 1.0-35
pve-firewall: 2.0-14
pve-ha-manager: 1.0-16
ksm-control-daemon: 1.2-1
glusterfs-client: 3.5.2-2+deb8u1
lxc-pve: 1.1.5-5
lxcfs: 0.13-pve2
cgmanager: 0.39-pve1
criu: 1.6.0-1
zfsutils: 0.6.5-pve6~jessie
 
Afaik,

  • Shutdown is like a gracefull shutdown on a Physical machine, ie. hitting the power button.
  • Quit is like holding the power button. So you basically force it to stop by simulating a "power off".


My best bet: there is something on the VM preventing a normal shutdown. Have you checked the VM's internal logfiles, to see which process(es) hang ??
 
on pve 3.1

pressing 'shutdown' times out.

pressing 'stop' it does shutdown.

shutdown: do an acpi shutdown, and if vm is not stopped after X second (shutdown timeout configurable in options), the qemu process is killed (like stop)

stop: kill the qemu process
 
so I'm still running the system at pve 3.1 .
pressed 'shutdown' on pve web page

within the vm,

syslog and kern log show no response to shutdown request.

and the system is running normal. it runs mediawiki . I can access different pages on the wiki... refresh browser cache and pages are good..
 
shutdown: do an acpi shutdown, and if vm is not stopped after X second (shutdown timeout configurable in options), the qemu process is killed (like stop)

stop: kill the qemu process

How can I set ' shutdown timeout ' options. I do not see that on pve menus.
 
you should have an "/proc/acpi" inside your vm, if acpi is working correctly.
(It should be the default unless you disable expllicity acpi , acpi=off or noacpi in vm grub)

yep that is there:
Code:
mediawiki  ~ # ls -l /proc/acpi
total 0
-rw-r--r-- 1 root root 0 Jan  6 05:25 wakeup