   (:import 
     java.net.URL
     com.vmware.vim25.mo.InventoryNavigator
+    com.vmware.vim25.VirtualMachineRelocateTransformation
     com.vmware.vim25.mo.ServiceInstance
     com.vmware.vim25.VirtualMachineCloneSpec
     com.vmware.vim25.VirtualMachineRelocateSpec

  ([type name within] (.searchManagedEntity within type name)))

(defn resource-pools [dcname]
  (first (find-all "ResourcePool" (navigator (find* "Datacenter" dcname)))))

(defn relocation-spec [dcname]
  (doto (VirtualMachineRelocateSpec.) 
    (.setPool (.getMOR (first (resource-pools dcname))))))

(defn clone-spec [dcname]

      (wait-for (.cloneVM_Task vm (.getParent vm) vmname (clone-spec dcname))))))

(comment
  (clone "ubuntu-13.04_puppet-3.1" "foo" "playground")
  )


