Skip to content

Instantly share code, notes, and snippets.

@hugoduncan
Created June 2, 2011 19:20
Show Gist options
  • Save hugoduncan/1005093 to your computer and use it in GitHub Desktop.
Save hugoduncan/1005093 to your computer and use it in GitHub Desktop.
vmfest manager with sata
(defn attach-hard-disk [m uuid]
{:pre [(model/Machine? m)]}
(session/with-vbox (:server m) [_ vbox]
(let [medium (vbox/find-medium vbox uuid)]
(session/with-session m :shared [_ vb-m]
(try
(attach-device vb-m "SATA Controller" 0 0 :hard-disk medium)
(catch clojure.contrib.condition.Condition _
(attach-device vb-m "IDE Controller" 0 0 :hard-disk medium)))
(.saveSettings vb-m)))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment