From 8cec852a8737b53967e8ae89f30e94975e5f4f5b Mon Sep 17 00:00:00 2001 From: Sean Whitton Date: Mon, 5 Nov 2018 20:07:22 -0700 Subject: libvirt: don't try to start running VM --- src/Propellor/Property/Libvirt.hs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/Propellor/Property/Libvirt.hs') diff --git a/src/Propellor/Property/Libvirt.hs b/src/Propellor/Property/Libvirt.hs index a1d44e9b..80222248 100644 --- a/src/Propellor/Property/Libvirt.hs +++ b/src/Propellor/Property/Libvirt.hs @@ -116,8 +116,11 @@ kvmDefined imageType mem cpus auto h = ]) started :: Property UnixLike started = case AutoStart of - AutoStart -> cmdProperty "virsh" ["start", hostName h] - `assume` MadeChange + AutoStart -> scriptProperty + [ "virsh list | grep -q \"" + ++ hostName h ++ " .*running\" && exit 0" + , "virsh start " ++ hostName h + ] `assume` NoChange NoAutoStart -> doNothing image = case imageType of -- cgit v1.2.3