amt template gives up way too easily
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
MAAS |
Fix Released
|
High
|
Dustin Kirkland | ||
maas (Ubuntu) |
Fix Released
|
High
|
Unassigned | ||
Trusty |
Fix Released
|
High
|
Unassigned |
Bug Description
In my (extensive) experience with MAAS and AMT systems, the etc/maas/
In the current code, it tries the amttool command merely twice.
I find that the first invocation of the command is usually necessary to nudge the AMT awake. The second one then usually succeeds, but it does occasionally get dropped too.
Upping that retry count to ~10 actually makes AMT work about 95% of the time, in my testing.
=== modified file 'etc/maas/
--- etc/maas/
+++ etc/maas/
@@ -25,10 +25,16 @@
}
state() {
- state=`{
- # Retry the state if it fails because it often fails the first time.
- amt 2> /dev/null || amt
- } | grep '^Powerstate:' | awk '{print $2}'`
+ # Retry the state if it fails because it often fails the first time.
+ local count=0
+ local state=
+ while true; do
+ state=$(amt info | grep '^Powerstate:' | awk '{print $2}')
+ [ -n "$state" ] && break
+ count=$((count+1))
+ [ $count -gt 10 ] && break
+ sleep 1
+ done
echo $state
}
@@ -46,7 +52,7 @@
echo desired $desired_state
current_
-for i in `seq 0 1`; do
+for i in `seq 0 10`; do
echo found current_state $current_state
if [ "$current_state" '=' "" ]; then
echo Cannot get current state
Related branches
- Graham Binns (community): Approve
-
Diff: 46 lines (+12/-6)2 files modifiedetc/maas/templates/power/amt.template (+11/-5)
src/provisioningserver/power_schema.py (+1/-1)
tags: | added: patch |
Changed in maas: | |
status: | Triaged → Fix Committed |
Changed in maas: | |
milestone: | none → 1.6.0 |
assignee: | nobody → Dustin Kirkland (kirkland) |
Changed in maas (Ubuntu): | |
status: | Triaged → Fix Committed |
Changed in maas (Ubuntu Trusty): | |
status: | Triaged → Fix Committed |
Changed in maas (Ubuntu): | |
status: | Fix Committed → Triaged |
Changed in maas (Ubuntu Trusty): | |
status: | Fix Committed → Triaged |
Changed in maas: | |
status: | Fix Committed → Fix Released |
Changed in maas (Ubuntu): | |
milestone: | trusty-updates → none |
Changed in maas (Ubuntu): | |
status: | Triaged → Fix Released |
Changed in maas (Ubuntu Trusty): | |
status: | Triaged → Fix Released |
Targeting at trusty-updates. This fix is essential to a properly functioning MAAS/AMT setup.