From 0c0f834db4209b3b4ae18a1163cfced6b926ec77 Mon Sep 17 00:00:00 2001
From: Iustin Pop <iustin@google.com>
Date: Tue, 13 May 2008 09:48:07 +0000
Subject: [PATCH] Watcher: do not activate disks for admin_down

Currently the watcher does activate disks (via bootid mechanisms) even
for admin_down instances.  This patch logs and skips over these
instances.

Reviewed-by: ultrotter
---
 daemons/ganeti-watcher | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/daemons/ganeti-watcher b/daemons/ganeti-watcher
index 8b2b18303..b81e7e812 100755
--- a/daemons/ganeti-watcher
+++ b/daemons/ganeti-watcher
@@ -367,6 +367,12 @@ class Watcher(object):
       # Activate disks for all instances with any of the checked nodes as a
       # secondary node.
       for instance in GetInstanceList(with_secondaries=check_nodes):
+        if not instance.autostart:
+          self.messages.append(Message(NOTICE,
+                                       ("Skipping disk activation for"
+                                        " non-autostart instance '%s'." %
+                                        instance.name)))
+          continue
         try:
           self.messages.append(Message(NOTICE, ("Activating disks for %s." %
                                                 instance.name)))
-- 
GitLab