uvt-kvm wait command will never return on Trusty with a future guest using systemd such as Xenial
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
ubuntu-kernel-tests |
Fix Released
|
Undecided
|
Po-Hsu Lin | ||
uvtool (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned | ||
Trusty |
Won't Fix
|
Low
|
Po-Hsu Lin |
Bug Description
== SRU Justification ==
[Impact]
* When running a newer guest (which uses systemd) on Trusty, the `uvt-kvm wait` command will never return as the tool is not aware of the newer runlevel 5 for systemd.
[Test Case]
Steps:
1. Install Trusty + X-hwe kernel
2. sudo apt-get install uvtool -y
3. ssh-keygen -f /home/ubuntu/
4. sudo uvt-simplestrea
5. sudo uvt-kvm create test-kvm release=xenial arch=amd64
6. sudo uvt-kvm wait test-kvm --insecure
Result:
* Step no 6. will never return. Even you can already ssh into that KVM
[Regression potential]
* This patch only adds compatibility for Trusty users, and limited to the uvt-kvm wait command on Trusty, therefore the risk for causing a regression is low.
* This patch has been tested on Trusty, with positive test result.
ProblemType: Bug
DistroRelease: Ubuntu 14.04
Package: linux-image-
ProcVersionSign
Uname: Linux 4.4.0-98-generic x86_64
ApportVersion: 2.14.1-0ubuntu3.25
Architecture: amd64
Date: Fri Nov 17 10:13:10 2017
ProcEnviron:
TERM=xterm-
PATH=(custom, no user)
XDG_RUNTIME_
LANG=en_US.UTF-8
SHELL=/bin/bash
SourcePackage: linux-lts-xenial
UpgradeStatus: No upgrade log present (probably fresh install)
Changed in uvtool (Ubuntu Trusty): | |
status: | Triaged → In Progress |
description: | updated |
description: | updated |
description: | updated |
description: | updated |
Changed in ubuntu-kernel-tests: | |
assignee: | nobody → Po-Hsu Lin (cypressyew) |
Changed in ubuntu-kernel-tests: | |
status: | Incomplete → Confirmed |
tags: | added: ubuntu-kvm-smoke-test |
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 0~bzr92/ remote- wait.sh 2014-04-01 13:06:54.000000000 +0100 0~bzr99/ remote- wait.sh 2015-04-13 17:32:11.000000000 +0100
--- uvtool-
+++ uvtool-
@@ -1,8 +1,12 @@
#!/bin/sh
set -e
-# Wait for runlevel 2 WAIT_INTERVAL; done `runlevel| awk '{print $2}'` WAIT_INTERVAL
-while [ "$(runlevel|awk '{print $2}')" != 2 ]; do sleep $UVTOOL_
+# Wait for runlevel 2 (upstart) or 5 (systemd)
+while :; do
+ runlevel=
+ [ "$runlevel" = 2 -o "$runlevel" = 5 ] && break
+ sleep $UVTOOL_
+done
# Wait for cloud-init's signal cloud/instance/ boot-finished ]; do sleep $UVTOOL_ WAIT_INTERVAL; done
while [ ! -e /var/lib/
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.