From c9a5c4b943d12cc4d1149b12cf1d3a4b6d33046d Mon Sep 17 00:00:00 2001 From: Paul Holzinger Date: Wed, 13 Mar 2024 15:00:28 +0100 Subject: [PATCH] pkg/machine: CheckExclusiveActiveVM should also check for starting Also make the error message there better. Signed-off-by: Paul Holzinger --- pkg/machine/shim/host.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/machine/shim/host.go b/pkg/machine/shim/host.go index 1080874619..4a302bb7b1 100644 --- a/pkg/machine/shim/host.go +++ b/pkg/machine/shim/host.go @@ -285,8 +285,8 @@ func CheckExclusiveActiveVM(provider vmconfigs.VMProvider, mc *vmconfigs.Machine if err != nil { return err } - if state == machineDefine.Running { - return fmt.Errorf("unable to start %q: machine %s already running", mc.Name, name) + if state == machineDefine.Running || state == machineDefine.Starting { + return fmt.Errorf("unable to start %q: machine %s: %w", mc.Name, name, machineDefine.ErrVMAlreadyRunning) } } return nil