        (throw+ {:type ::machine-exists :msg "can't create an existing machine"})) 
     (let [vm* (.create vm)]  
       (.start vm*) 
-      (assert (= (.status vm*) "running")) ; might not match all providers
+      (running! vm*)
       (info "done system setup"))))
 
 (deflow destroy 

  (let [vm (vconstruct spec)]
    (info "stopping" machine)
    (.stop vm) 
    (assert (not (= (.status vm) "running"))) ; might not match all providers
    ))

(deflow start 
  "Start a vm instance"
  [{:keys [machine] :as spec}]
  (let [vm (vconstruct spec)]
    (assert (not (= (.status vm) "running"))) ; might not match all providers
    (info "starting" machine)
    (.start vm) 
    (assert (= (.status vm) "running")) ; might not match all providers
    ))

(deflow create

           (run-hooks ~hook-args ~(keyword name*) :error) 
           (throw t#))))))

(defn updated-system 
   "grabs system and associates system id" 
   [system-id]
   (assoc (s/get-system system-id) :system-id system-id))

(defn running! 
  "Asserts that a VM is running"
  [vm]
  (assert (= (.status vm) "running")) ; might not match all providers
  )
 
(defn not-running!
  "Assert that a vm is not running"
   [vm]
  (assert (not (= (.status vm) "running"))) ; might not match all providers
  )

(deflow reload 
  "Reloads a machine if one already exists, will distroy the old one"
  [{:keys [machine system-id] :as spec}]
