Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Jaime Melis
committed
Jul 10, 2012
1 parent
265a6da
commit 76ecc25
Showing
7 changed files
with
121 additions
and
0 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
NAME = ds_user | ||
DS_MAD = fs | ||
TM_MAD = shared | ||
|
||
SAFE_DIRS = "/" | ||
|
||
DEFAULT = YES |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
IM=im_kvm | ||
VMM=vmm_kvm | ||
NET=dummy |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#!/bin/bash -e | ||
|
||
# This script downloads an ubuntu image for KVM and creates an image template | ||
# for it, which can be used later in the onebootstrap script. | ||
|
||
REALPATH=$(readlink -f $0) | ||
cd `dirname $REALPATH` | ||
|
||
ID=4fc76a938fb81d3517000001 | ||
NAME="ubuntu-server-12.04" | ||
|
||
URL="https://marketplace.c12g.com/appliance/$ID/download" | ||
|
||
curl -sLk $URL | bunzip2 -c > $NAME.img | ||
|
||
cat <<EOF > $NAME.image | ||
NAME = "$NAME" | ||
PATH = $(pwd)/$NAME.img | ||
PUBLIC = YES | ||
EOF |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
NAME = ubuntu | ||
|
||
CPU = 1 | ||
VCPU = 1 | ||
MEMORY = 512 | ||
|
||
OS = [ arch = "x86_64" ] | ||
|
||
DISK = [ | ||
IMAGE = "ubuntu-server-12.04" | ||
] | ||
|
||
NIC = [ NETWORK = "net_172" ] | ||
|
||
GRAPHICS = [ | ||
TYPE = "vnc", | ||
LISTEN = "0.0.0.0" | ||
] |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
NAME = "net_172" | ||
TYPE = fixed | ||
BRIDGE = br0 | ||
|
||
LEASES = [ IP = 172.16.0.200 ] | ||
LEASES = [ IP = 172.16.0.201 ] | ||
LEASES = [ IP = 172.16.0.202 ] | ||
LEASES = [ IP = 172.16.0.203 ] | ||
LEASES = [ IP = 172.16.0.204 ] | ||
LEASES = [ IP = 172.16.0.205 ] | ||
LEASES = [ IP = 172.16.0.206 ] | ||
LEASES = [ IP = 172.16.0.207 ] |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
#!/bin/bash | ||
|
||
REALPATH=$(readlink -f $0) | ||
cd `dirname $REALPATH` | ||
|
||
for host in $(ls bootstrap/host/*.host 2>/dev/null); do | ||
unset IM VMM NET | ||
source $host | ||
|
||
HOSTNAME=$(basename $host) | ||
HOSTNAME=${HOSTNAME%%.host} | ||
|
||
onehost create $HOSTNAME -i $IM -v $VMM -n $NET | ||
done | ||
|
||
for vnet in $(ls bootstrap/vnet/*.vnet 2>/dev/null); do | ||
onevnet create $vnet | ||
done | ||
|
||
unset DEFAULT_DS | ||
for datastore in $(ls bootstrap/datastore/*.datastore 2>/dev/null); do | ||
DS_ID=$(onedatastore create $datastore|awk '{print $2}') | ||
|
||
# If it's the first registered datastore, mark it as default | ||
[ -z "$DEFAULT_DS" ] && DEFAULT_DS=$DS_ID | ||
|
||
# If it has DEFAULT inside the template mark it as default | ||
if cat $datastore | grep -q DEFAULT; then | ||
DEFAULT_DS=$DS_ID | ||
fi | ||
done | ||
|
||
# If no datastore was created, used DS 1 as the default | ||
[ -z "DEFAULT_DS" ] && DEFAULT_DS=1 | ||
|
||
for image in $(ls bootstrap/image/*.image 2>/dev/null); do | ||
oneimage create $image -d $DEFAULT_DS | ||
done | ||
|
||
for template in $(ls bootstrap/template/*.template 2>/dev/null); do | ||
onetemplate create $template | ||
done |