November 13, 20169 yr Description: The "Shutdown time-out" value of 60 seconds is too short to let the rc.libvirt script finish. How to reproduce: Shutdown with a VM that hangs. This happens when a Windows 10 VM is processing updates. Expected results: The VM would at least be forced to shutdown and unRAID shutdown processing would continue normally. Actual results: The VM is shutdown with the equivalent of pulling the plug and stopping services events are not processed. Other information: The rc.libvirt script is used to shutdown VMs and has a 60 second timer it uses to allow VMs time to shutdown normally. If the timer runs out, VMs are forced to shutdown. The "Shutdown time-out" value of 60 seconds is not enough time for the rc.libvirt script to complete causing shutdown processing to be abruptly terminated. rc.libvirt snippet: TIMEOUT=${TIMEOUT:-60} OPTS=${OPTS:-" -f /etc/libvirt/libvirtd.conf -p $PIDFILE "} check_running_machines() { count=0 for machine in $(/usr/sbin/virsh list --uuid --state-running | grep -v ^$); do /usr/sbin/virsh shutdown $machine done echo -n "Waiting on VMs to shutdown" while [ $(/usr/sbin/virsh list --name --state-running | grep -v ^$ | wc -l) -gt "0" ]; do if [ "$count" -ge "$TIMEOUT" ]; then break fi echo -n "." count=$(expr $count + 1) sleep 1 done echo "" if [ $(/usr/sbin/virsh list --name --state-running | grep -v ^$ | wc -l) -gt "0" ]; then echo "The following VMs are still running, forcing shutdown: $(/usr/sbin/virsh list --state-running --name | grep -v ^$ | paste -sd ',')" for machine in $(/usr/sbin/virsh list --state-running --uuid | grep -v ^$); do /usr/sbin/virsh destroy $machine done sleep 2 fi } Suggestion: - Set default "Shutdown time-out" to 90 seconds. - Do not let a value of less than 90 seconds be used.
Archived
This topic is now archived and is closed to further replies.