Comment 2 for bug 1732883

Revision history for this message
Robie Basak (racb) wrote : Re: uvt-kvm wait command will never return on Trusty with KVM created with uvtool

Thank you for the report.

This is correct. uvtool on Trusty waits for upstart to be ready on the guest. Xenial uses systemd, so upstart never completes there. This couldn't have been known at the time of release of Trusty!

You can work around this by asking uvtool to use a custom wait script using the --remote-wait-script option.

See remote-wait.sh in the source. Here's the difference between Trusty and Xenial:

$ diff -u uvtool-0~bzr9{2,9}/remote-wait.sh
--- uvtool-0~bzr92/remote-wait.sh 2014-04-01 13:06:54.000000000 +0100
+++ uvtool-0~bzr99/remote-wait.sh 2015-04-13 17:32:11.000000000 +0100
@@ -1,8 +1,12 @@
 #!/bin/sh
 set -e

-# Wait for runlevel 2
-while [ "$(runlevel|awk '{print $2}')" != 2 ]; do sleep $UVTOOL_WAIT_INTERVAL; done
+# Wait for runlevel 2 (upstart) or 5 (systemd)
+while :; do
+ runlevel=`runlevel|awk '{print $2}'`
+ [ "$runlevel" = 2 -o "$runlevel" = 5 ] && break
+ sleep $UVTOOL_WAIT_INTERVAL
+done

 # Wait for cloud-init's signal
 while [ ! -e /var/lib/cloud/instance/boot-finished ]; do sleep $UVTOOL_WAIT_INTERVAL; done

This could be SRU'd to Trusty perhaps (I'm not sure how it really fits in with policy, since it's not a regression; rather an attempt to work well with the future from the perspective of Trusty). Someone will need to drive any such SRU. If a volunteer is found, I'll leave it to other SRU team members make the SRU policy decision.