Created
October 12, 2012 12:50
-
-
Save ianrumford/3879064 to your computer and use it in GitHub Desktop.
VMFest VBox 4.2 examples blog_vmfest_image0.clj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns vmfest_examples.blog_vmfest_image0 | |
(:require [vmfest.manager :as vman])) | |
;; First connect to the VBox web service. | |
(def my-server (vman/server "http://localhost:18083" "ian" "<password goes here>")) | |
;; Name of the machine | |
(def my-server-name "blog-vmfest-image0") | |
;; Where the machine should be created | |
(def my-node-path "/path/to/vmfest/nodes") | |
;; Details of the OS image to use | |
(def my-image-map | |
{:uuid "/path/to/vmfest/images/image_ubuntu_1204_64.vdi" | |
:os-family :ubuntu | |
:os-version "12.04" | |
:os-type-id "Ubuntu_64" | |
:os-64-bit true | |
}) | |
;; Details of the machine to create and its options | |
(def my-machine-map | |
{:description "Ubuntu 12.04 64bit by blog_vmfest_image0" | |
:memory-size 512 | |
:cpu-count 1 | |
:vram-size 16 | |
:accelerate-3d-enabled? true | |
:network [{:attachment-type :host-only | |
:host-only-interface "vboxnet0"} | |
{:attachment-type :nat}] | |
:storage [{:name "IDE Controller" | |
:bus :ide | |
:devices [nil nil {:device-type :dvd} nil]} | |
{:name "SATA Controller" | |
:bus :sata | |
:devices [nil nil nil nil] | |
}] | |
:boot-mount-point ["SATA Controller" 0] | |
:boot-order [[2 :dvd] [1 :hard-disk] ] | |
:utc-time true | |
:clipboard-mode :bidirectional | |
}) | |
;; Create the machine | |
(def my-machine | |
(vman/instance | |
my-server | |
my-server-name | |
my-image-map | |
my-machine-map | |
my-node-path)) | |
;; Start the machine | |
(vman/start my-machine) | |
;; Other example actions | |
(comment | |
(vman/stop my-machine) | |
(vman/destroy my-machine) | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment