Browse Source

Ignore "start" command if instance appears to be running

This helps preserving backward-compatible behaviour, as previous
implementation has required the user to explicitly "start" enabled
instances. With current virtualbmc, only the master process needs to
be started.

Change-Id: I3f95cdbd497f7ae3e06d37bb6afac17331f0469b
Ilya Etingof 2 months ago
parent
commit
bff0e6c73a

+ 7
- 0
releasenotes/notes/ignore-start-if-running-c9a8f6c0514624a1.yaml View File

@@ -0,0 +1,7 @@
1
+---
2
+fixes:
3
+  - |
4
+    Ignores instance "start" command if instance appears to be running. This
5
+    helps preserving backward-compatible behaviour, as previous implementation
6
+    has required the user to explicitly "start" enabled instances. With current
7
+    virtualbmc, only the master process needs to be started.

+ 8
- 2
virtualbmc/manager.py View File

@@ -286,8 +286,14 @@ class VirtualBMCManager(object):
286 286
             return 1, str(ex)
287 287
 
288 288
         if domain_name in self._running_domains:
289
-            return 1, ('BMC instance %(domain)s '
290
-                       'already running' % {'domain': domain_name})
289
+
290
+            self._sync_vbmc_states()
291
+
292
+            if domain_name in self._running_domains:
293
+                LOG.warning(
294
+                    'BMC instance %(domain)s already running, ignoring '
295
+                    '"start" command' % {'domain': domain_name})
296
+                return 0, ''
291 297
 
292 298
         try:
293 299
             self._vbmc_enabled(domain_name,

Loading…
Cancel
Save