deltacloud-core 0.3.0 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- data/LICENSE +145 -0
- data/NOTICE +10 -1
- data/Rakefile +50 -2
- data/bin/deltacloudd +111 -14
- data/config/addresses.xml +14 -0
- data/config/condor.yaml +30 -0
- data/config/drivers/azure.yaml +3 -0
- data/config/drivers/condor.yaml +3 -0
- data/config/{drivers.yaml → drivers/ec2.yaml} +5 -34
- data/config/drivers/eucalyptus.yaml +8 -0
- data/config/drivers/gogrid.yaml +3 -0
- data/config/drivers/mock.yaml +3 -0
- data/config/drivers/opennebula.yaml +4 -0
- data/config/drivers/rackspace.yaml +3 -0
- data/config/drivers/rhevm.yaml +3 -0
- data/config/drivers/rimuhosting.yaml +3 -0
- data/config/drivers/sbc.yaml +2 -0
- data/config/drivers/terremark.yaml +3 -0
- data/config/drivers/vsphere.yaml +8 -0
- data/deltacloud-core.gemspec +13 -5
- data/deltacloud.rb +4 -2
- data/lib/deltacloud/backend_capability.rb +2 -2
- data/lib/deltacloud/base_driver/base_driver.rb +23 -52
- data/lib/deltacloud/base_driver/exceptions.rb +168 -0
- data/lib/deltacloud/base_driver/features.rb +31 -12
- data/lib/deltacloud/base_driver/mock_driver.rb +2 -1
- data/lib/deltacloud/core_ext/string.rb +2 -0
- data/lib/deltacloud/drivers/azure/azure_driver.rb +5 -5
- data/lib/deltacloud/drivers/condor/condor_client.rb +273 -0
- data/lib/deltacloud/drivers/condor/condor_driver.rb +236 -0
- data/lib/deltacloud/drivers/condor/ip_agents/confserver.rb +75 -0
- data/lib/deltacloud/drivers/condor/ip_agents/default.rb +84 -0
- data/lib/deltacloud/drivers/ec2/ec2_driver.rb +326 -95
- data/lib/deltacloud/drivers/ec2/ec2_mock_driver.rb +3 -3
- data/lib/deltacloud/drivers/eucalyptus/eucalyptus_driver.rb +40 -8
- data/lib/deltacloud/drivers/gogrid/gogrid_client.rb +7 -7
- data/lib/deltacloud/drivers/gogrid/gogrid_driver.rb +42 -25
- data/lib/deltacloud/drivers/mock/data/{buckets/blobs → blobs}/blob1.yml +6 -4
- data/lib/deltacloud/drivers/mock/data/{buckets/blobs → blobs}/blob2.yml +7 -5
- data/lib/deltacloud/drivers/mock/data/{buckets/blobs → blobs}/blob3.yml +6 -4
- data/lib/deltacloud/drivers/mock/data/{buckets/blobs → blobs}/blob4.yml +6 -4
- data/lib/deltacloud/drivers/mock/data/{buckets/blobs → blobs}/blob5.yml +6 -4
- data/lib/deltacloud/drivers/mock/data/buckets/bucket1.yml +7 -1
- data/lib/deltacloud/drivers/mock/data/buckets/bucket2.yml +6 -1
- data/lib/deltacloud/drivers/mock/data/images/img1.yml +6 -2
- data/lib/deltacloud/drivers/mock/data/images/img2.yml +6 -2
- data/lib/deltacloud/drivers/mock/data/images/img3.yml +6 -2
- data/lib/deltacloud/drivers/mock/data/instances/inst0.yml +11 -10
- data/lib/deltacloud/drivers/mock/data/instances/inst1.yml +14 -7
- data/lib/deltacloud/drivers/mock/data/instances/inst2.yml +14 -7
- data/lib/deltacloud/drivers/mock/data/storage_snapshots/snap1.yml +3 -2
- data/lib/deltacloud/drivers/mock/data/storage_snapshots/snap2.yml +3 -2
- data/lib/deltacloud/drivers/mock/data/storage_snapshots/snap3.yml +3 -2
- data/lib/deltacloud/drivers/mock/data/storage_volumes/vol1.yml +4 -3
- data/lib/deltacloud/drivers/mock/data/storage_volumes/vol2.yml +4 -3
- data/lib/deltacloud/drivers/mock/data/storage_volumes/vol3.yml +4 -3
- data/lib/deltacloud/drivers/mock/mock_client.rb +101 -0
- data/lib/deltacloud/drivers/mock/mock_driver.rb +367 -429
- data/lib/deltacloud/drivers/opennebula/opennebula_driver.rb +6 -0
- data/lib/deltacloud/drivers/rackspace/rackspace_driver.rb +59 -9
- data/lib/deltacloud/drivers/rhevm/rhevm_client.rb +62 -8
- data/lib/deltacloud/drivers/rhevm/rhevm_driver.rb +100 -45
- data/lib/deltacloud/drivers/rimuhosting/rimuhosting_client.rb +3 -2
- data/lib/deltacloud/drivers/rimuhosting/rimuhosting_driver.rb +8 -11
- data/lib/deltacloud/drivers/sbc/sbc_client.rb +6 -6
- data/lib/deltacloud/drivers/sbc/sbc_driver.rb +16 -0
- data/lib/deltacloud/drivers/terremark/terremark_driver.rb +17 -12
- data/lib/deltacloud/drivers/vsphere/vsphere_client.rb +140 -0
- data/lib/deltacloud/drivers/vsphere/vsphere_driver.rb +405 -0
- data/lib/deltacloud/drivers/vsphere/vsphere_filemanager.rb +182 -0
- data/lib/deltacloud/hardware_profile.rb +1 -1
- data/lib/deltacloud/helpers.rb +2 -1
- data/lib/deltacloud/helpers/application_helper.rb +92 -20
- data/lib/deltacloud/helpers/blob_stream.rb +160 -12
- data/lib/deltacloud/helpers/conversion_helper.rb +6 -2
- data/lib/deltacloud/helpers/json_helper.rb +31 -0
- data/lib/deltacloud/models/address.rb +28 -0
- data/lib/deltacloud/models/base_model.rb +5 -1
- data/lib/deltacloud/models/blob.rb +1 -1
- data/lib/deltacloud/models/bucket.rb +10 -0
- data/lib/deltacloud/models/firewall.rb +22 -0
- data/lib/deltacloud/models/firewall_rule.rb +23 -0
- data/lib/deltacloud/models/image.rb +12 -0
- data/lib/deltacloud/models/instance.rb +20 -2
- data/lib/deltacloud/models/key.rb +1 -1
- data/lib/deltacloud/runner.rb +3 -3
- data/lib/deltacloud/validation.rb +3 -7
- data/lib/drivers.rb +7 -1
- data/lib/sinatra/body_proxy.rb +34 -0
- data/lib/sinatra/lazy_auth.rb +5 -0
- data/lib/sinatra/rabbit.rb +54 -31
- data/lib/sinatra/rack_accept.rb +157 -0
- data/lib/sinatra/rack_date.rb +38 -0
- data/lib/sinatra/rack_etag.rb +2 -3
- data/lib/sinatra/rack_matrix_params.rb +51 -29
- data/lib/sinatra/rack_runtime.rb +1 -1
- data/lib/sinatra/rack_syslog.rb +86 -0
- data/lib/sinatra/url_for.rb +14 -1
- data/public/images/address.png +0 -0
- data/public/images/balancer.png +0 -0
- data/public/images/blob.png +0 -0
- data/public/images/bucket.png +0 -0
- data/public/images/cloud.png +0 -0
- data/public/images/firewall.png +0 -0
- data/public/images/image.png +0 -0
- data/public/images/key.png +0 -0
- data/public/images/machine.png +0 -0
- data/public/images/profile.png +0 -0
- data/public/images/realm.png +0 -0
- data/public/images/snapshot.png +0 -0
- data/public/images/volume.png +0 -0
- data/public/javascripts/application.js +119 -16
- data/public/javascripts/jquery.min.js +18 -0
- data/public/javascripts/jquery.mobile-1.0b1.min.js +146 -0
- data/public/stylesheets/compiled/application.css +8 -0
- data/public/stylesheets/images/ajax-loader.png +0 -0
- data/public/{images → stylesheets/images}/bread-bg.png +0 -0
- data/public/{images → stylesheets/images}/error.png +0 -0
- data/public/{images → stylesheets/images}/grid.png +0 -0
- data/public/stylesheets/images/icon-search-black.png +0 -0
- data/public/stylesheets/images/icons-18-black.png +0 -0
- data/public/stylesheets/images/icons-18-white.png +0 -0
- data/public/stylesheets/images/icons-36-black.png +0 -0
- data/public/stylesheets/images/icons-36-white.png +0 -0
- data/public/{images → stylesheets/images}/logo-wide.png +0 -0
- data/public/{images → stylesheets/images}/pending.png +0 -0
- data/public/{images → stylesheets/images}/rails.png +0 -0
- data/public/{images → stylesheets/images}/running.png +0 -0
- data/public/{images → stylesheets/images}/stopped.png +0 -0
- data/public/{images → stylesheets/images}/topbar-bg.png +0 -0
- data/public/stylesheets/jquery.mobile-1.0b1.min.css +8 -0
- data/public/stylesheets/new.css +53 -0
- data/server.rb +487 -175
- data/support/condor/bash/cached_images.sh +8 -0
- data/support/condor/bash/cloud_exit_hook.sh +17 -0
- data/support/condor/bash/cloud_functions +175 -0
- data/support/condor/bash/cloud_prepare_hook.sh +20 -0
- data/support/condor/bash/libvirt_cloud_script.sh +13 -0
- data/support/condor/config/50condor_cloud.config +37 -0
- data/support/condor/config/50condor_cloud_node.config +37 -0
- data/support/condor/config/condor-cloud +2 -0
- data/support/condor/config/condor_config.local +44 -0
- data/support/fedora/deltacloud-core +48 -26
- data/support/fedora/deltacloud-core-config +26 -0
- data/support/fedora/deltacloud-core.spec +314 -68
- data/support/fedora/deltacloudd-fedora +5 -0
- data/tests/common.rb +34 -4
- data/tests/drivers/mock/api_test.rb +3 -3
- data/tests/drivers/mock/images_test.rb +12 -0
- data/tests/drivers/mock/instances_test.rb +2 -0
- data/tests/rabbit_test.rb +2 -2
- data/views/addresses/_address.html.haml +6 -0
- data/views/addresses/associate.html.haml +12 -0
- data/views/addresses/index.html.haml +9 -0
- data/views/addresses/index.xml.haml +4 -0
- data/views/addresses/show.html.haml +21 -0
- data/views/addresses/show.xml.haml +14 -0
- data/views/api/show.html.haml +6 -11
- data/views/api/show.xml.haml +2 -0
- data/views/blobs/new.html.haml +24 -23
- data/views/blobs/show.html.haml +30 -31
- data/views/buckets/index.html.haml +9 -21
- data/views/buckets/index.xml.haml +3 -7
- data/views/buckets/new.html.haml +13 -12
- data/views/buckets/show.html.haml +22 -22
- data/views/buckets/show.xml.haml +5 -3
- data/views/docs/collection.html.haml +23 -34
- data/views/docs/collection.xml.haml +2 -2
- data/views/docs/index.html.haml +9 -13
- data/views/docs/index.xml.haml +1 -1
- data/views/docs/operation.html.haml +28 -38
- data/views/docs/operation.xml.haml +1 -1
- data/views/drivers/index.html.haml +8 -13
- data/views/drivers/show.html.haml +18 -18
- data/views/error.html.haml +32 -27
- data/views/errors/400.html.haml +41 -0
- data/views/errors/{validation_failure.xml.haml → 400.xml.haml} +0 -4
- data/views/errors/401.html.haml +41 -0
- data/views/errors/{auth_exception.xml.haml → 401.xml.haml} +0 -0
- data/views/errors/403.html.haml +42 -0
- data/views/errors/{not_allowed.xml.haml → 403.xml.haml} +0 -0
- data/views/errors/404.html.haml +29 -0
- data/views/errors/{not_found.xml.haml → 404.xml.haml} +1 -1
- data/views/errors/405.html.haml +29 -0
- data/views/errors/405.xml.haml +5 -0
- data/views/errors/500.html.haml +43 -0
- data/views/errors/500.xml.haml +5 -0
- data/views/errors/502.html.haml +43 -0
- data/views/errors/{backend_error.xml.haml → 502.xml.haml} +1 -2
- data/views/errors/backend_capability_failure.html.haml +27 -9
- data/views/firewalls/index.html.haml +15 -0
- data/views/firewalls/index.xml.haml +28 -0
- data/views/firewalls/new.html.haml +11 -0
- data/views/firewalls/new_rule.html.haml +20 -0
- data/views/firewalls/show.html.haml +42 -0
- data/views/firewalls/show.xml.haml +26 -0
- data/views/hardware_profiles/index.html.haml +15 -23
- data/views/hardware_profiles/show.html.haml +22 -18
- data/views/images/index.html.haml +11 -23
- data/views/images/index.xml.haml +4 -13
- data/views/images/new.html.haml +12 -13
- data/views/images/show.html.haml +26 -20
- data/views/images/show.xml.haml +2 -1
- data/views/instance_states/show.html.haml +21 -25
- data/views/instances/index.html.haml +13 -30
- data/views/instances/index.xml.haml +2 -23
- data/views/instances/new.html.haml +83 -88
- data/views/instances/show.html.haml +53 -55
- data/views/instances/show.xml.haml +12 -10
- data/views/keys/index.html.haml +13 -24
- data/views/keys/new.html.haml +7 -7
- data/views/keys/show.html.haml +26 -21
- data/views/layout.html.haml +28 -27
- data/views/load_balancers/index.html.haml +11 -31
- data/views/load_balancers/index.xml.haml +0 -1
- data/views/load_balancers/new.html.haml +1 -1
- data/views/load_balancers/show.html.haml +33 -34
- data/views/load_balancers/show.xml.haml +2 -2
- data/views/realms/index.html.haml +11 -24
- data/views/realms/index.xml.haml +2 -8
- data/views/realms/show.html.haml +17 -15
- data/views/realms/show.xml.haml +2 -1
- data/views/storage_snapshots/index.html.haml +11 -21
- data/views/storage_snapshots/index.xml.haml +2 -5
- data/views/storage_snapshots/new.html.haml +1 -1
- data/views/storage_snapshots/show.html.haml +21 -13
- data/views/storage_snapshots/show.xml.haml +2 -1
- data/views/storage_volumes/index.html.haml +11 -34
- data/views/storage_volumes/new.html.haml +1 -1
- data/views/storage_volumes/show.html.haml +33 -27
- data/views/storage_volumes/show.xml.haml +2 -1
- metadata +266 -178
- data/lib/sinatra/respond_to.rb +0 -248
- data/support/fedora/deltacloudd +0 -128
- data/support/fedora/rubygem-deltacloud-core.spec +0 -127
- data/views/accounts/index.html.haml +0 -11
- data/views/accounts/show.html.haml +0 -30
- data/views/errors/auth_exception.html.haml +0 -8
- data/views/errors/backend_error.html.haml +0 -22
- data/views/errors/not_allowed.html.haml +0 -6
- data/views/errors/not_found.html.haml +0 -6
- data/views/errors/validation_failure.html.haml +0 -11
@@ -0,0 +1,17 @@
|
|
1
|
+
#!/bin/sh
|
2
|
+
|
3
|
+
source /usr/libexec/condor/cloud_functions
|
4
|
+
|
5
|
+
while read line; do
|
6
|
+
name="${line%% =*}"
|
7
|
+
value="${line#*= }"
|
8
|
+
case $name in
|
9
|
+
VM_XML ) VM_XML="$line" ;;
|
10
|
+
esac
|
11
|
+
done
|
12
|
+
|
13
|
+
DISK=$(echo $VM_XML | sed "s:.*<source file='\([^']*\)'/>.*:\1:")
|
14
|
+
|
15
|
+
rm -f $DISK
|
16
|
+
|
17
|
+
exit 0
|
@@ -0,0 +1,175 @@
|
|
1
|
+
source /etc/sysconfig/condor-cloud
|
2
|
+
|
3
|
+
ERROR_MSG=
|
4
|
+
|
5
|
+
MISSING_DEPS=
|
6
|
+
which qemu-img > /dev/null 2>&1
|
7
|
+
if [ $? -ne 0 ]; then
|
8
|
+
MISSING_DEPS="$MISSING_DEPS qemu-img"
|
9
|
+
return 1
|
10
|
+
fi
|
11
|
+
|
12
|
+
#
|
13
|
+
# image_exists_global <image>
|
14
|
+
#
|
15
|
+
# Test to see if the given image is in the global image store. 0 is
|
16
|
+
# returned if the image is present, 1 otherwise.
|
17
|
+
#
|
18
|
+
# This implementation uses the filesystem path $STORAGE as the global
|
19
|
+
# store.
|
20
|
+
#
|
21
|
+
function image_exists_global {
|
22
|
+
IMAGE=$1
|
23
|
+
test -e $STORAGE/$IMAGE
|
24
|
+
}
|
25
|
+
|
26
|
+
#
|
27
|
+
# image_exists_local <image>
|
28
|
+
#
|
29
|
+
# Test to see if the given image is in the local image store. 0 is
|
30
|
+
# returned if the image is present, 1 otherwise.
|
31
|
+
#
|
32
|
+
# This implementation uses the filesystem path $CACHE as the local
|
33
|
+
# store.
|
34
|
+
#
|
35
|
+
function image_exists_local {
|
36
|
+
IMAGE=$1
|
37
|
+
test -e $CACHE/$IMAGE
|
38
|
+
}
|
39
|
+
|
40
|
+
#
|
41
|
+
# put_image <image>
|
42
|
+
#
|
43
|
+
# Put the image passed as the first argument, into the global image
|
44
|
+
# store. Return 0 on success and 1 on any failure.
|
45
|
+
#
|
46
|
+
# This implementation uses the filesystem path $STORAGE as the global
|
47
|
+
# store.
|
48
|
+
#
|
49
|
+
function put_image {
|
50
|
+
IMAGE=$1
|
51
|
+
IMAGE_NAME=$(basename $IMAGE)
|
52
|
+
|
53
|
+
LOCK="$STORAGE/$IMAGE_NAME.lock"
|
54
|
+
|
55
|
+
CAT=cat; which pv > /dev/null 2>&1 && CAT=pv
|
56
|
+
|
57
|
+
while ! ( set -o noclobber; echo "$$" > $LOCK ) 2> /dev/null; do
|
58
|
+
echo "$LOCK held by $(cat $LOCK)" >2
|
59
|
+
sleep $((RANDOM % 29))
|
60
|
+
done
|
61
|
+
|
62
|
+
trap 'rm -f $LOCK; exit $?' INT TERM EXIT
|
63
|
+
|
64
|
+
RC=0
|
65
|
+
if ! image_exists_global $IMAGE_NAME; then
|
66
|
+
trap 'rm -f $LOCK; rm -f $STORAGE/$IMAGE_NAME; exit $?' INT TERM EXIT
|
67
|
+
ERROR_MSG=$($CAT $IMAGE > $STORAGE/$IMAGE_NAME)
|
68
|
+
if [ $? -eq 0 ]; then
|
69
|
+
# Permissions on the image are entirely open
|
70
|
+
chmod a=r $STORAGE/$IMAGE_NAME
|
71
|
+
else
|
72
|
+
RC=1
|
73
|
+
fi
|
74
|
+
fi
|
75
|
+
|
76
|
+
rm -f $LOCK; trap - INT TERM EXIT
|
77
|
+
|
78
|
+
return $RC
|
79
|
+
}
|
80
|
+
|
81
|
+
#
|
82
|
+
# get_image <image>
|
83
|
+
#
|
84
|
+
# Get an image from the global image store and make a copy locally for
|
85
|
+
# use by guest VMs. Return 0 on success and 1 on any failure.
|
86
|
+
#
|
87
|
+
# This implementation uses the filesystem path $STORAGE as the global
|
88
|
+
# store and $CACHE as the local.
|
89
|
+
#
|
90
|
+
function get_image {
|
91
|
+
IMAGE=$1
|
92
|
+
|
93
|
+
LOCK="$CACHE/$IMAGE.lock"
|
94
|
+
|
95
|
+
if ! image_exists_global $IMAGE; then
|
96
|
+
ERROR_MSG="$STORAGE/$IMAGE not found"
|
97
|
+
return 1
|
98
|
+
fi
|
99
|
+
|
100
|
+
while ! ( set -o noclobber; echo "$$" > $LOCK ) 2> /dev/null; do
|
101
|
+
echo "$LOCK held by $(cat $LOCK)" >2
|
102
|
+
sleep $((RANDOM % 29))
|
103
|
+
done
|
104
|
+
|
105
|
+
trap 'rm -f $LOCK; exit $?' INT TERM EXIT
|
106
|
+
|
107
|
+
if ! image_exists_local $IMAGE; then
|
108
|
+
trap 'rm -f $LOCK; rm -f $CACHE/$IMAGE; exit $?' INT TERM EXIT
|
109
|
+
ERROR_MSG=$(cp $STORAGE/$IMAGE $CACHE/$IMAGE)
|
110
|
+
if [ $? -ne 0 ]; then
|
111
|
+
return 1
|
112
|
+
fi
|
113
|
+
|
114
|
+
# libvirt chowns the qcow2 image to qemu.qemu so that qemu can
|
115
|
+
# read/write it. The base image is not chowned, so we must make sure
|
116
|
+
# it is readable by qemu. If this is not done, a common VMGahpLog
|
117
|
+
# error will be:
|
118
|
+
# Failed to create libvirt domain: monitor socket did not show up.:
|
119
|
+
# No such file or directory
|
120
|
+
# Other than readable, no one should ever write to the file, so write
|
121
|
+
# perms are removed.
|
122
|
+
chmod a+r $CACHE/$IMAGE
|
123
|
+
fi
|
124
|
+
|
125
|
+
rm -f $LOCK
|
126
|
+
trap - INT TERM EXIT
|
127
|
+
|
128
|
+
return 0
|
129
|
+
}
|
130
|
+
|
131
|
+
#
|
132
|
+
# make_image <image>
|
133
|
+
#
|
134
|
+
# Create a qcow2 image based off the given image and place it in the
|
135
|
+
# local image store. The qcow2 image is echo'd to stdout. The return
|
136
|
+
# value has no meaning.
|
137
|
+
#
|
138
|
+
# This implementation uses the filesystem path $CACHE as the local
|
139
|
+
# store.
|
140
|
+
#
|
141
|
+
function make_image {
|
142
|
+
BASE_IMAGE=$1
|
143
|
+
LOCATION=$2
|
144
|
+
|
145
|
+
LOCK="$CACHE/$BASE_IMAGE.lock"
|
146
|
+
|
147
|
+
if ! image_exists_local $BASE_IMAGE; then
|
148
|
+
ERROR_MSG="$BASE_IMAGE not found"
|
149
|
+
return 1
|
150
|
+
fi
|
151
|
+
|
152
|
+
#
|
153
|
+
# Use the $LOCK as a barrier in case the image is concurrently
|
154
|
+
# being added to the $CACHE. Granted, that is a case that should
|
155
|
+
# never happen. Unfortunately, the existence of the $LOCK cannot be
|
156
|
+
# used as an assertion condition because a concurrent get_image
|
157
|
+
# will briefly create $LOCK even when the $BASE_IMAGE is already in
|
158
|
+
# the $CACHE.
|
159
|
+
#
|
160
|
+
while ! ( set -o noclobber; echo "$$" > $LOCK ) 2> /dev/null; do
|
161
|
+
echo "$LOCK held by $(cat $LOCK)" >2
|
162
|
+
sleep $((RANDOM % 29))
|
163
|
+
done
|
164
|
+
trap 'rm -f $LOCK; exit $?' INT TERM EXIT
|
165
|
+
|
166
|
+
IMAGE=$LOCATION/$BASE_IMAGE.qcow2
|
167
|
+
|
168
|
+
qemu-img create -f qcow2 -b $CACHE/$BASE_IMAGE $IMAGE > /dev/null 2>&1
|
169
|
+
# XXX: test for success, give return value meaning
|
170
|
+
|
171
|
+
rm -f $LOCK
|
172
|
+
|
173
|
+
echo $IMAGE
|
174
|
+
return 0
|
175
|
+
}
|
@@ -0,0 +1,20 @@
|
|
1
|
+
#!/bin/sh
|
2
|
+
|
3
|
+
source /usr/libexec/condor/cloud_functions
|
4
|
+
|
5
|
+
while read line; do
|
6
|
+
name="${line%% =*}"
|
7
|
+
value="${line#*= }"
|
8
|
+
case $name in
|
9
|
+
cloud_image ) BASE_IMAGE="$(echo $value | tr -d '\"')" ;;
|
10
|
+
VM_XML ) VM_XML="$line" ;;
|
11
|
+
esac
|
12
|
+
done
|
13
|
+
|
14
|
+
get_image $BASE_IMAGE
|
15
|
+
|
16
|
+
IMAGE=$(make_image $BASE_IMAGE $PWD)
|
17
|
+
|
18
|
+
echo $(echo $VM_XML | sed "s:{DISK}:$IMAGE:")
|
19
|
+
|
20
|
+
exit 0
|
@@ -0,0 +1,13 @@
|
|
1
|
+
#!/bin/sh
|
2
|
+
|
3
|
+
while read line; do
|
4
|
+
line=$(echo "$line" | tr -d '"')
|
5
|
+
name="${line%% =*}"
|
6
|
+
value="${line#*= }"
|
7
|
+
case $name in
|
8
|
+
VMPARAM_VM_NAME ) NAME="$value" ;;
|
9
|
+
VM_XML ) VM_XML="$value" ;;
|
10
|
+
esac
|
11
|
+
done
|
12
|
+
|
13
|
+
echo $(echo $VM_XML | sed "s:{NAME}:$NAME:")
|
@@ -0,0 +1,37 @@
|
|
1
|
+
DAEMON_LIST = MASTER, SCHEDD, COLLECTOR, NEGOTIATOR, STARTD
|
2
|
+
|
3
|
+
GRIDMANAGER_JOB_PROBE_INTERVAL = 30
|
4
|
+
|
5
|
+
FILESYSTEM_DOMAIN = condor_cloud
|
6
|
+
|
7
|
+
VM_GAHP_DEBUG = D_FULLDEBUG
|
8
|
+
|
9
|
+
VM_GAHP_SEND_ALL_CLASSAD = TRUE
|
10
|
+
VM_GAHP_LOG = $(LOG)/VMGahpLog
|
11
|
+
VM_GAHP_SERVER = $(SBIN)/condor_vm-gahp
|
12
|
+
VM_TYPE = kvm
|
13
|
+
VM_MEMORY = $(MEMORY)
|
14
|
+
VM_NETWORKING = TRUE
|
15
|
+
VM_NETWORKING_TYPE = bridge,nat
|
16
|
+
VM_NETWORKING_BRIDGE_INTERFACE = vnet0
|
17
|
+
|
18
|
+
LIBVIRT_XML_SCRIPT = $(LIBEXEC)/libvirt_cloud_script.sh
|
19
|
+
|
20
|
+
|
21
|
+
# Hook must be go=rx
|
22
|
+
CLOUD_HOOK_PREPARE_JOB = $(LIBEXEC)/cloud_prepare_hook.sh
|
23
|
+
CLOUD_HOOK_JOB_EXIT = $(LIBEXEC)/cloud_exit_hook.sh
|
24
|
+
|
25
|
+
# Advertise set of images available on this node
|
26
|
+
STARTD_CRON_JOBLIST = CACHED_IMAGES
|
27
|
+
STARTD_CRON_CACHED_IMAGES_EXECUTABLE = $(LIBEXEC)/cached_images.sh
|
28
|
+
STARTD_CRON_CACHED_IMAGES_PERIOD = 300s
|
29
|
+
|
30
|
+
START = true
|
31
|
+
|
32
|
+
#SLOT_TYPE_1 = cpus=100%,disk=100%,swap=100%
|
33
|
+
#SLOT_TYPE_1_PARTITIONABLE = TRUE
|
34
|
+
#NUM_SLOTS = 1
|
35
|
+
#NUM_SLOTS_TYPE_1 = 1
|
36
|
+
NUM_CPUS = $(DETECTED_CORES) * 4
|
37
|
+
MEMORY = $(DETECTED_MEMORY) * 4
|
@@ -0,0 +1,37 @@
|
|
1
|
+
DAEMON_LIST = MASTER, STARTD
|
2
|
+
|
3
|
+
GRIDMANAGER_JOB_PROBE_INTERVAL = 30
|
4
|
+
|
5
|
+
FILESYSTEM_DOMAIN = condor_cloud
|
6
|
+
|
7
|
+
VM_GAHP_DEBUG = D_FULLDEBUG
|
8
|
+
|
9
|
+
VM_GAHP_SEND_ALL_CLASSAD = TRUE
|
10
|
+
VM_GAHP_LOG = $(LOG)/VMGahpLog
|
11
|
+
VM_GAHP_SERVER = $(SBIN)/condor_vm-gahp
|
12
|
+
VM_TYPE = kvm
|
13
|
+
VM_MEMORY = $(MEMORY)
|
14
|
+
VM_NETWORKING = TRUE
|
15
|
+
VM_NETWORKING_TYPE = bridge,nat
|
16
|
+
VM_NETWORKING_BRIDGE_INTERFACE = vnet0
|
17
|
+
|
18
|
+
LIBVIRT_XML_SCRIPT = $(LIBEXEC)/libvirt_cloud_script.sh
|
19
|
+
|
20
|
+
|
21
|
+
# Hook must be go=rx
|
22
|
+
CLOUD_HOOK_PREPARE_JOB = $(LIBEXEC)/cloud_prepare_hook.sh
|
23
|
+
CLOUD_HOOK_JOB_EXIT = $(LIBEXEC)/cloud_exit_hook.sh
|
24
|
+
|
25
|
+
# Advertise set of images available on this node
|
26
|
+
STARTD_CRON_JOBLIST = CACHED_IMAGES
|
27
|
+
STARTD_CRON_CACHED_IMAGES_EXECUTABLE = $(LIBEXEC)/cached_images.sh
|
28
|
+
STARTD_CRON_CACHED_IMAGES_PERIOD = 300s
|
29
|
+
|
30
|
+
START = true
|
31
|
+
|
32
|
+
#SLOT_TYPE_1 = cpus=100%,disk=100%,swap=100%
|
33
|
+
#SLOT_TYPE_1_PARTITIONABLE = TRUE
|
34
|
+
#NUM_SLOTS = 1
|
35
|
+
#NUM_SLOTS_TYPE_1 = 1
|
36
|
+
NUM_CPUS = $(DETECTED_CORES) * 4
|
37
|
+
MEMORY = $(DETECTED_MEMORY) * 4
|
@@ -0,0 +1,44 @@
|
|
1
|
+
ALLOW_WRITE = *
|
2
|
+
ALLOW_ADMINISTRATOR = *
|
3
|
+
ALLOW_NEGOTIATOR = *
|
4
|
+
ALLOW_NEGOTIATOR_SCHEDD = *
|
5
|
+
COLLECTOR_HOST = localhost
|
6
|
+
|
7
|
+
DAEMON_LIST = MASTER, SCHEDD, COLLECTOR, NEGOTIATOR, STARTD
|
8
|
+
|
9
|
+
GRIDMANAGER_JOB_PROBE_INTERVAL = 30
|
10
|
+
|
11
|
+
GRIDMANAGER_DEBUG = D_FULLDEBUG
|
12
|
+
NEGOTIATOR_DEBUG = D_FULLDEBUG
|
13
|
+
COLLECTOR_DEBUG = D_FULLDEBUG
|
14
|
+
VM_GAHP_DEBUG = D_FULLDEBUG
|
15
|
+
|
16
|
+
VM_GAHP_SEND_ALL_CLASSAD = TRUE
|
17
|
+
VM_GAHP_LOG = $(LOG)/VMGahpLog
|
18
|
+
VM_GAHP_SERVER = $(SBIN)/condor_vm-gahp
|
19
|
+
VM_TYPE = kvm
|
20
|
+
VM_MEMORY = $(MEMORY)
|
21
|
+
VM_NETWORKING = TRUE
|
22
|
+
VM_NETWORKING_TYPE = bridge,nat
|
23
|
+
VM_NETWORKING_BRIDGE_INTERFACE = vnet0
|
24
|
+
|
25
|
+
LIBVIRT_XML_SCRIPT = $(LIBEXEC)/libvirt_cloud_script.sh
|
26
|
+
|
27
|
+
|
28
|
+
# Hook must be go=rx
|
29
|
+
CLOUD_HOOK_PREPARE_JOB = $(LIBEXEC)/cloud_prepare_hook.sh
|
30
|
+
CLOUD_HOOK_JOB_EXIT = $(LIBEXEC)/cloud_exit_hook.sh
|
31
|
+
|
32
|
+
# Advertise set of images available on this node
|
33
|
+
STARTD_CRON_JOBLIST = CACHED_IMAGES
|
34
|
+
STARTD_CRON_CACHED_IMAGES_EXECUTABLE = $(LIBEXEC)/cached_images.sh
|
35
|
+
STARTD_CRON_CACHED_IMAGES_PERIOD = 300s
|
36
|
+
|
37
|
+
START = true
|
38
|
+
|
39
|
+
#SLOT_TYPE_1 = cpus=100%,disk=100%,swap=100%
|
40
|
+
#SLOT_TYPE_1_PARTITIONABLE = TRUE
|
41
|
+
#NUM_SLOTS = 1
|
42
|
+
#NUM_SLOTS_TYPE_1 = 1
|
43
|
+
#NUM_CPUS = $(DETECTED_CORES) * 4
|
44
|
+
MEMORY = $(DETECTED_MEMORY) * 4
|
@@ -1,52 +1,74 @@
|
|
1
|
-
#!/bin/
|
1
|
+
#!/bin/sh
|
2
2
|
#
|
3
|
-
#
|
4
|
-
#
|
5
|
-
#
|
6
|
-
# chkconfig: - 97 03
|
3
|
+
# deltacloud-core Deltacloud API Core
|
4
|
+
# chkconfig: 345 90 60
|
7
5
|
# description: deltacloud-core is primary server process for the \
|
8
|
-
#
|
9
|
-
|
6
|
+
# Deltacloud Core component.
|
7
|
+
|
8
|
+
### BEGIN INIT INFO
|
9
|
+
# Provides: deltacloud-core
|
10
|
+
# Required-Start:
|
11
|
+
# Required-Stop:
|
12
|
+
# Default-Start: 3 5
|
13
|
+
# Default-Stop: 0 1 2 6
|
14
|
+
# Short-Description: Deltacloud Core API deamon
|
15
|
+
# Description: Deltacloud Core API provides access to different cloud providers \
|
16
|
+
# using single REST API
|
17
|
+
### END INIT INFO
|
18
|
+
|
19
|
+
. /etc/rc.d/init.d/functions
|
10
20
|
|
11
21
|
[ -r /etc/sysconfig/deltacloud-core ] && . /etc/sysconfig/deltacloud-core
|
12
22
|
|
13
|
-
|
14
|
-
|
15
|
-
PORT="${PORT:-3002}"
|
16
|
-
LOCKFILE="${LOCKFILE:-/var/lock/subsys/deltacloud-core }"
|
17
|
-
LOGFILE="${LOGFILE:-/var/log/deltacloud-core/$DRIVER.log}"
|
23
|
+
exec="/usr/bin/deltacloudd"
|
24
|
+
prog="deltacloud-core"
|
18
25
|
|
19
|
-
[ ! -d /var/log
|
26
|
+
[ ! -d /var/log/$prog ] && mkdir -p /var/log/$prog
|
20
27
|
|
21
|
-
|
28
|
+
# You can overide these variables using /etc/sysconfig/deltacloud-core
|
29
|
+
#
|
30
|
+
# ENV=production|development
|
31
|
+
# DRIVER=ec2|mock|gogrid
|
32
|
+
#
|
33
|
+
#
|
34
|
+
API_ENV="${ENV:-production}"
|
35
|
+
DRIVER="${DRIVER:-ec2}"
|
36
|
+
PORT="${PORT:-3002}"
|
37
|
+
LOGFILE="${LOGFILE:-/var/log/$prog/$DRIVER.log}"
|
38
|
+
lockfile="${LOCKFILE:-/var/lock/subsys/$prog }"
|
22
39
|
|
23
|
-
|
40
|
+
[ -r $LOGFILE ] && chown nobody $LOGFILE
|
41
|
+
[ -r $lockfile ] && chown nobody $lockfile
|
24
42
|
|
25
43
|
start() {
|
26
|
-
|
44
|
+
[ -x $exec ] || exit 5
|
45
|
+
|
46
|
+
echo -n $"Starting $prog: "
|
47
|
+
daemon --user nobody $exec -i $DRIVER -e $API_ENV --port $PORT >> $LOGFILE 2>&1 &
|
48
|
+
retval=$?
|
27
49
|
|
28
|
-
|
29
|
-
RETVAL=$?
|
30
|
-
if [ $RETVAL -eq 0 ] && touch $LOCKFILE ; then
|
50
|
+
if [ $retval -eq 0 ] && touch $lockfile ; then
|
31
51
|
echo_success
|
32
52
|
echo
|
33
53
|
else
|
34
54
|
echo_failure
|
35
55
|
echo
|
36
56
|
fi
|
57
|
+
return $retval
|
37
58
|
}
|
38
59
|
|
39
60
|
stop() {
|
40
|
-
echo -n "Shutting down
|
41
|
-
|
42
|
-
|
43
|
-
if [ $
|
61
|
+
echo -n $"Shutting down $prog: "
|
62
|
+
killproc deltacloudd
|
63
|
+
retval=$?
|
64
|
+
if [ $retval -eq 0 ] && rm -f $lockfile ; then
|
44
65
|
echo_success
|
45
66
|
echo
|
46
67
|
else
|
47
68
|
echo_failure
|
48
69
|
echo
|
49
70
|
fi
|
71
|
+
return $retval
|
50
72
|
}
|
51
73
|
|
52
74
|
case "$1" in
|
@@ -67,12 +89,12 @@ case "$1" in
|
|
67
89
|
;;
|
68
90
|
status)
|
69
91
|
status $PROG
|
70
|
-
|
92
|
+
retval=$?
|
71
93
|
;;
|
72
94
|
*)
|
73
|
-
echo "Usage:
|
95
|
+
echo "Usage: $prog {start|stop|restart|status}"
|
74
96
|
exit 1
|
75
97
|
;;
|
76
98
|
esac
|
77
99
|
|
78
|
-
exit
|
100
|
+
exit $?
|