       (let [{:keys [image target]} domain]
         (clone-domain connection image target)))) 
 
-  (delete [this])
+  (delete [this]
+    (with-connection 
+      (.destroy (get-domain connection (domain :name))))
+    )
 
-  (start [this])
+  (start [this]
+    (with-connection 
+      (.create (get-domain connection (domain :name)))))
 
-  (stop [this])
+  (stop [this]
+    (with-connection 
+      (.shutdown (get-domain connection (domain :name)))))
 
-  (status [this])
+  (status [this]
+    (with-connection 
+      (state (get-domain connection (domain :name))) 
+      ) 
+    )
 
   (ip [this]))
 

   (-> machine
     (mappings {:os :image :hostname :name})
     (transform (machine-ts machine))
     (selections [[:name :user :image]])))

(defmethod vconstruct :kvm [{:keys [kvm machine system-id] :as spec}]
   (let [[domain] (translate spec) {:keys [node]} kvm]
     (provider-validation domain)
     (->Domain system-id (hypervisor* :kvm :nodes node) domain))
  )



(timbre/refer-timbre)

(defn connection [{:keys [host username port]}] 
  (connect (<< "qemu+ssh://~{username}@~{host}:~{port}/system")))

(defmacro with-connection [& body]
  `(let [~'connection (connection ~'node)] (do ~@body)))
