Open kingsd041 opened 5 years ago
I am having the same issue, the guest receives the shutdown command but nothing happens:
proxmox: /var/log/messages
Oct 5 14:22:39 server pve-guests[920]: <root@pam> starting task UPID:server:00000E8A:0CDD36F8:5D98A72F:qmshutdown:107:root@pam:
rancher: /var/log/messages
Oct 5 14:22:39 rancher qemu-ga: info: guest-shutdown called, mode: (null)
rancher: /var/log/boot/shutdown.log
time="2019-10-05T14:22:39Z" level=debug msg="START: [shutdown -h -P +0 hypervisor initiated shutdown] in /"
time="2019-10-05T14:22:39Z" level=error msg="Sorry, can't parse '+0' as time value (only 'now' supported)"
At this point proxmox shows Guest Agent not running
on the VM UI and keeps waiting on the shutdown.
Rancher was installed using rancheros-proxmoxve.iso
1.5.1 and upgraded to 1.5.3 using the ros os
command.
Proxmox version 5.4.
I have the same issue with getting RancherOS to shutdown when run as a VM under Proxmox.
Any chance this may be treated as a bug (and possibly be fixed earlier than an undated 1.6.0 release)?
It makes running RancherOS on Proxmox unfeasible since if my power goes out Proxmox can't shutdown RancherOS and all my containers will in the end be killed or stopped when the UPS runs out of power...
Have the same issue...I think I've found the the problem...the quemu guest agent container shuts down, but it doesn't shut down the host system... I use the apcupsd docker also, and it's developer solved the problem with a cronjob and a script:
https://github.com/gersilex/apcupsd-docker
maybe it helps solving the issue...
I use the apcupsd docker also, and it's developer solved the problem with a cronjob and a script: https://github.com/gersilex/apcupsd-docker maybe it helps solving the issue...
—You are receiving this because you commented.Reply to this email directly, view it on GitHub, or unsubscribe.
I found an even easier solution. Disable quemu-guest-agent in the vm options. It then shuts down the machine via acpi event which seems to work...
Issue seems to be here: https://github.com/rancher/os/blob/7c84c5f7e4f624c1d0229ac92fe2dbbd9c8780a3/cmd/power/shutdown.go#L218
Should just need to update the parser to accept +0
as a valid parameter.
I rebuilt the openstack image variants with this to get around this issue. Others may find it useful (as I still have the issue even with the latest version). Disabling the agent is a non-option for my use case.
#cloud-config
# Giant mess of qemu-guest-agent
# https://github.com/rancher/os-services/blob/master/q/qemu-guest-agent.yml
# https://github.com/qemu/qemu/blob/master/qga/commands-posix.c#L84
# https://github.com/rancher/os/issues/2822
# https://github.com/rancher/os/issues/2647
# https://ezunix.org/index.php?title=Prevent_suspending_when_the_lid_is_closed_on_a_laptop_in_RancherOS
#
# The problem is overly complicated because of 2 things:
# - qemu-ga is hard-coded to invoke /sbin/shutdown (cannot simply create a wrapper higher in the PATH)
# - the rancher qemu-guest-agent service mounts 'volumes_from'
# which bind mount the above path, so it's impossible to use
# the supported image, therefor we've replaced it with a generic
# qemu-guest-agent image
#
# Also note, due to weirdness, we simply bind mount the system-docker
# binary into the contaier and exec ros in *another* container to
# actually trigger the reboot
runcmd:
- sudo rm -rf /var/lib/rancher/resizefs.done
# when the qemu-guest-agent issue is fixed, all agent-related garbage below
# can simply be replaced by this..
#- sudo ros service enable qemu-guest-agent
#- sudo ros service up qemu-guest-agent
rancher:
resize_device: /dev/sda
services:
qemu-guest-agent:
image: linuxkit/qemu-ga:v0.8
command: /usr/bin/qemu-ga
privileged: true
restart: always
labels:
io.rancher.os.scope: system
io.rancher.os.after: console
pid: host
ipc: host
net: host
uts: host
volumes:
- /dev:/dev
- /usr/bin/ros:/usr/bin/ros
- /var/run:/var/run
- /usr/bin/system-docker:/usr/bin/system-docker
- /home/rancher/overlay/qemu-guest-agent/etc/qemu/qemu-ga.conf:/etc/qemu/qemu-ga.conf
- /home/rancher/overlay/qemu-guest-agent/sbin/shutdown:/sbin/shutdown
volumes_from:
- system-volumes
- user-volumes
write_files:
# not required, just here in case I want to enable verbose for testing
- path: /home/rancher/overlay/qemu-guest-agent/etc/qemu/qemu-ga.conf
permissions: "0755"
owner: root
content: |
[general]
daemon=false
method=virtio-serial
path=/dev/virtio-ports/org.qemu.guest_agent.0
pidfile=/var/run/qemu-ga.pid
statedir=/var/run
verbose=false
blacklist=
- path: /home/rancher/overlay/qemu-guest-agent/sbin/shutdown
permissions: "0755"
owner: root
content: |
#!/bin/sh
ARGS=$(echo "${@}" | sed 's/+0/now/g')
system-docker exec console ros entrypoint shutdown $ARGS
Still an issue. travisghansen's solution still works
still seeing this as well.
I (reluctantly) just turned off the qemu agent to get around this
@joshspicer don't expect it to ever be fixed, RancherOS is dead. Look at the official documentation https://rancher.com/docs/os/v1.x/en/
RancherOS Version: (ros os version) v1.5.0 Where are you running RancherOS? (docker-machine, AWS, GCE, baremetal, etc.) Proxmox VE
I can see the following error log in respawn.log