From bff0e6c73a9c93ee7d272cd671b0d70f75ee3038 Mon Sep 17 00:00:00 2001 From: Ilya Etingof Date: Thu, 14 Feb 2019 11:13:12 +0100 Subject: [PATCH] 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 --- .../ignore-start-if-running-c9a8f6c0514624a1.yaml | 7 +++++++ virtualbmc/manager.py | 10 ++++++++-- 2 files changed, 15 insertions(+), 2 deletions(-) create mode 100644 releasenotes/notes/ignore-start-if-running-c9a8f6c0514624a1.yaml diff --git a/releasenotes/notes/ignore-start-if-running-c9a8f6c0514624a1.yaml b/releasenotes/notes/ignore-start-if-running-c9a8f6c0514624a1.yaml new file mode 100644 index 0000000..d6004c2 --- /dev/null +++ b/releasenotes/notes/ignore-start-if-running-c9a8f6c0514624a1.yaml @@ -0,0 +1,7 @@ +--- +fixes: + - | + Ignores instance "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. diff --git a/virtualbmc/manager.py b/virtualbmc/manager.py index 974a081..0994562 100644 --- a/virtualbmc/manager.py +++ b/virtualbmc/manager.py @@ -286,8 +286,14 @@ class VirtualBMCManager(object): return 1, str(ex) if domain_name in self._running_domains: - return 1, ('BMC instance %(domain)s ' - 'already running' % {'domain': domain_name}) + + self._sync_vbmc_states() + + if domain_name in self._running_domains: + LOG.warning( + 'BMC instance %(domain)s already running, ignoring ' + '"start" command' % {'domain': domain_name}) + return 0, '' try: self._vbmc_enabled(domain_name,