instance-main.cfg 11.4 KB
Newer Older
1 2 3 4 5 6 7 8 9 10
#############################
#
# Instanciate kvm
#
#############################
[buildout]
parts =
  certificate-authority
  kvm-instance
  websockify-sighandler
Alain Takoudjou's avatar
Alain Takoudjou committed
11
  kvm-promise
12
  novnc-promise
13
  request-openstack-frontend
14 15
  nova-install
#  openstack-frontend-promise
16
  frontend-promise
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
  publish-kvm-connection-information

eggs-directory = ${buildout:eggs-directory}
develop-eggs-directory = ${buildout:develop-eggs-directory}
offline = true

[directory]
recipe = slapos.cookbook:mkdirectory
etc = $${buildout:directory}/etc
bin = $${buildout:directory}/bin
srv = $${buildout:directory}/srv
var = $${buildout:directory}/var
scripts = $${:etc}/run
services = $${:etc}/service
promises = $${:etc}/promise
novnc-conf = $${:etc}/novnc
run = $${:var}/run
ca-dir = $${:srv}/ssl
35 36
nova = $${:bin}/nova
log = $${:var}/log
37 38 39 40 41 42 43 44 45 46

[create-mac]
recipe = slapos.cookbook:generate.mac
storage-path = $${directory:srv}/mac

[gen-passwd]
recipe = slapos.cookbook:generate.password
storage-path = $${directory:srv}/passwd
bytes = 8

47 48 49 50 51
[master-passwd]
recipe = slapos.cookbook:generate.password
storage-path = $${directory:srv}/openstack.passwd
bytes = 8

52
[kvm-instance]
53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85
recipe = slapos.cookbook:kvm
vnc-passwd = $${gen-passwd:passwd}

ipv4 = $${slap-network-information:local-ipv4}
ipv6 = $${slap-network-information:global-ipv6}
vnc-ip = $${:ipv4}

vnc-port = 5901

# XXX-Cedric: should be named "default-cdrom-iso"
default-disk-image = ${debian-amd64-netinst.iso:location}/${debian-amd64-netinst.iso:filename}
nbd-host = $${slap-parameter:nbd-host}
nbd-port = $${slap-parameter:nbd-port}
nbd2-host = $${slap-parameter:nbd2-host}
nbd2-port = $${slap-parameter:nbd2-port}

tap-interface = $${slap-network-information:network-interface}

disk-path = $${directory:srv}/virtual.qcow2
disk-size = $${slap-parameter:disk-size}
disk-type = $${slap-parameter:disk-type}

socket-path = $${directory:var}/qmp_socket
pid-file-path = $${directory:run}/kvm_run.pid

smp-count = $${slap-parameter:cpu-count}
ram-size = $${slap-parameter:ram-size}
mac-address = $${create-mac:mac-address}

# XXX-Cedric: should be named runner-wrapper-path and controller-wrapper-path
runner-path = $${directory:services}/kvm
controller-path = $${directory:scripts}/kvm_controller

86
ssh-port = 22222
87
use-tap = False
88
nat-rules = 22:$${:ssh-port} 80:$${tunnel-http:port} 443:$${tunnel-http:port-https} 5000:5000 6080:$${tunnel-http:port-vnc} 6082:6082 3333:3333 9292:9292 9696:9696 3306:3306 35357:35357
89 90 91 92 93 94 95 96 97
6tunnel-wrapper-path = $${directory:services}/6tunnel

virtual-hard-drive-url = $${slap-parameter:virtual-hard-drive-url}
virtual-hard-drive-md5sum = $${slap-parameter:virtual-hard-drive-md5sum}

shell-path = ${dash:location}/bin/dash
qemu-path = ${kvm:location}/bin/qemu-system-x86_64
qemu-img-path = ${kvm:location}/bin/qemu-img
6tunnel-path = ${6tunnel:location}/bin/6tunnel
98 99 100 101

[kvm-promise]
recipe = slapos.cookbook:check_port_listening
path = $${directory:promises}/vnc_promise
102 103
hostname = $${kvm-instance:vnc-ip}
port = $${kvm-instance:vnc-port}
104 105 106 107 108 109 110 111

[tunnel-ipv6-base]
recipe = slapos.cookbook:ipv6toipv4
ipv6 = $${slap-network-information:global-ipv6}
ipv4 = $${slap-network-information:local-ipv4}
shell-path = ${dash:location}/bin/dash
6tunnel-path = ${6tunnel:location}/bin/6tunnel

112 113
[install-script]
recipe = slapos.recipe.template
114 115
url = ${openstack-grizzly:location}/${openstack-grizzly:filename}
output = $${directory:nova}/stack_controller_grizzly.sh
116 117
mode = 0700

118 119 120
#nova-url = https://github.com/openstack-dev/devstack.git
image-url = $${slap-parameter:glance-image-url}
image-name = $${slap-parameter:glance-image-name}
121 122 123
slap-ipv4 = $${slap-network-information:local-ipv4}
nova-passwd = $${master-passwd:passwd}
nova-user = $${slap-parameter:system-user}
124 125
project = $${slap-parameter:project}
user-name = $${slap-parameter:user-name}
126
vnc-frontend = $${request-openstack-vnc-frontend:connection-url}/vnc_auto.html?path=$${request-openstack-vnc-frontend:connection-resource}
127 128 129 130 131 132 133 134 135 136 137 138

[nova-conf-run]
recipe = slapos.recipe.template
url = ${compute-script-run:location}/${compute-script-run:filename}
output = $${directory:nova}/nova_configure.py
mode = 0700

host-ip = $${tunnel-ipv6-ssh:ipv6}
ssh-port = $${tunnel-ipv6-ssh:ipv6-port}
system-user = $${slap-parameter:system-user}
system-passwd = $${slap-parameter:system-passwd}
nova-configure = $${install-script:output}
139 140 141
keystone-endpoints-script = ${openstack-keystone-endpoints-script:location}/${openstack-keystone-endpoints-script:filename}
keystone-script = ${openstack-keystone-script:location}/${openstack-keystone-script:filename}
floating-ip-generate = ${network-floating-ip-generate:location}/${network-floating-ip-generate:filename}
142
signed-certificate-generate = ${auto-signed-certificate-generate:location}/${auto-signed-certificate-generate:filename}
143 144 145 146 147 148 149 150 151 152 153 154
nova-result = $${directory:log}
python_path = ${buildout:executable}
eggs-dir = ${buildout:eggs-directory}
instance = manage

[nova-install]
recipe = slapos.cookbook:wrapper
command-line = $${nova-conf-run:output}
wrapper-path = $${directory:scripts}/openstack-install

######################################################################
### PREDEFINED PORT AND HOST FOR SSH ACCESS TO OPENSTACK COMPUTER ####
155
[tunnel-ipv6-ssh]
156 157 158 159
ipv6-port = $${kvm-instance:ssh-port}
ipv4-port = $${kvm-instance:ssh-port}
ipv6 = $${slap-network-information:global-ipv6}
ipv4 = $${slap-network-information:local-ipv4}
160

161 162 163 164 165 166 167 168 169 170
##########################################################
### PREDEFINED PORT AND HOST FOR NOVA HORIZON SERVICE ####
[tunnel-http]
host = $${slap-network-information:global-ipv6}
port = 8080
port-https = 4443
port-vnc = 6080

##########################################################

171 172 173 174
[novnc-instance]
recipe = slapos.cookbook:novnc
path = $${ca-novnc:executable}
ip = $${slap-network-information:global-ipv6}
Alain Takoudjou's avatar
Alain Takoudjou committed
175
port = 6090
176 177
vnc-ip = $${kvm-instance:vnc-ip}
vnc-port = $${kvm-instance:vnc-port}
178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228
novnc-location = ${noVNC:location}
websockify-path = ${buildout:directory}/bin/websockify
ssl-key-path = $${ca-novnc:key-file}
ssl-cert-path = $${ca-novnc:cert-file}

[websockify-sighandler]
recipe = slapos.cookbook:signalwrapper
wrapper-path = $${directory:services}/websockify
wrapped-path = $${novnc-instance:path}

[certificate-authority]
recipe = slapos.cookbook:certificate_authority
openssl-binary = ${openssl:location}/bin/openssl
ca-dir = $${directory:ca-dir}
requests-directory = $${cadirectory:requests}
wrapper = $${directory:services}/certificate_authority
ca-private = $${cadirectory:private}
ca-certs = $${cadirectory:certs}
ca-newcerts = $${cadirectory:newcerts}
ca-crl = $${cadirectory:crl}

[cadirectory]
recipe = slapos.cookbook:mkdirectory
requests = $${directory:ca-dir}/requests/
private = $${directory:ca-dir}/private/
certs = $${directory:ca-dir}/certs/
newcerts = $${directory:ca-dir}/newcerts/
crl = $${directory:ca-dir}/crl/

[ca-novnc]
<= certificate-authority
recipe = slapos.cookbook:certificate_authority.request
key-file = $${directory:novnc-conf}/novnc.key
cert-file = $${directory:novnc-conf}/novnc.crt
executable = $${directory:bin}/novnc
wrapper = $${directory:bin}/websockify

[novnc-promise]
recipe = slapos.cookbook:check_port_listening
path = $${directory:promises}/novnc_promise
hostname = $${novnc-instance:ip}
port = $${novnc-instance:port}


[kvm-monitor]
recipe = slapos.cookbook:generic.slapmonitor
db-path = $${directory:srv}/slapmonitor_database


[request-slave-frontend]
recipe = slapos.cookbook:requestoptional
229
software-url = $${slap-parameter:kvm-frontend-url}
230 231 232 233 234 235 236 237 238 239 240 241
server-url = $${slap-connection:server-url}
key-file = $${slap-connection:key-file}
cert-file = $${slap-connection:cert-file}
computer-id = $${slap-connection:computer-id}
partition-id = $${slap-connection:partition-id}
name = VNC Frontend
software-type = $${slap-parameter:frontend-software-type}
slave = true
config = host port
config-host = $${novnc-instance:ip}
config-port = $${novnc-instance:port}
return = url resource port domainname
Alain Takoudjou's avatar
Alain Takoudjou committed
242 243
sla = instance_guid
sla-instance_guid = $${slap-parameter:frontend-instance-guid}
244

Alain Takoudjou's avatar
Alain Takoudjou committed
245
[request-openstack-vnc-frontend]
246
recipe = slapos.cookbook:requestoptional
Alain Takoudjou's avatar
Alain Takoudjou committed
247 248 249 250 251 252
software-url = $${slap-parameter:kvm-frontend-url}
server-url = $${slap-connection:server-url}
key-file = $${slap-connection:key-file}
cert-file = $${slap-connection:cert-file}
computer-id = $${slap-connection:computer-id}
partition-id = $${slap-connection:partition-id}
Alain Takoudjou's avatar
Alain Takoudjou committed
253
name = OpenStack VNC Frontend
Alain Takoudjou's avatar
Alain Takoudjou committed
254
software-type = $${slap-parameter:frontend-software-type}
255
slave = true
Alain Takoudjou's avatar
Alain Takoudjou committed
256 257
config = host port
config-host = $${slap-network-information:global-ipv6}
258
config-port = $${tunnel-http:port-vnc}
Alain Takoudjou's avatar
Alain Takoudjou committed
259 260 261
return = url resource port domainname
sla = instance_guid
sla-instance_guid = $${slap-parameter:frontend-instance-guid}
262

Alain Takoudjou's avatar
Alain Takoudjou committed
263
[request-openstack-frontend]
264
<= slap-connection
265
#XXX - Don't use requestoptional because vnc frontend is a prerequisite to deploy openstack
266
recipe = slapos.cookbook:requestoptional
Alain Takoudjou's avatar
Alain Takoudjou committed
267
name = Frontend OpenStack
268 269 270 271
# XXX We have hardcoded SR URL here.
software-url = $${slap-parameter:frontend-software-url}
slave = true
config = url custom_domain
272
config-url = http://[$${tunnel-http:host}]:$${tunnel-http:port}/
273 274
return = site_url
config-custom_domain = $${slap-parameter:domain}
275 276 277

[publish-kvm-connection-information]
recipe = slapos.cookbook:publish
278 279
vnc-backend-url = https://[$${novnc-instance:ip}]:$${novnc-instance:port}/vnc_auto.html?host=[$${novnc-instance:ip}]&port=$${novnc-instance:port}&encrypt=1&password=$${kvm-instance:vnc-passwd}
vnc-url = $${request-slave-frontend:connection-url}/vnc_auto.html?host=$${request-slave-frontend:connection-domainname}&port=$${request-slave-frontend:connection-port}&encrypt=1&path=$${request-slave-frontend:connection-resource}&password=$${kvm-instance:vnc-passwd}
280 281 282
ssh = ssh $${slap-parameter:system-user}@$${tunnel-ipv6-ssh:ipv6} -p $${tunnel-ipv6-ssh:ipv6-port}
ssh-defaul-passwd = $${slap-parameter:system-passwd}
openstack-url = $${request-openstack-frontend:connection-site_url}/horizon
Alain Takoudjou's avatar
Alain Takoudjou committed
283
openstack-services-host = $${slap-network-information:global-ipv6}
284 285 286 287
openstack-services-passwd = $${master-passwd:passwd}
openstack-project = $${slap-parameter:project}
openstack-admin-user = admin
openstack-project-user = $${slap-parameter:user-name}
Alain Takoudjou's avatar
Alain Takoudjou committed
288

289 290 291 292 293 294
[frontend-promise]
recipe = slapos.cookbook:check_url_available
path = $${directory:promises}/frontend_promise
url = $${publish-kvm-connection-information:vnc-url}
dash_path = ${dash:location}/bin/dash
curl_path = ${curl:location}/bin/curl
295

296

Alain Takoudjou's avatar
Alain Takoudjou committed
297 298 299 300 301 302 303 304
[openstack-frontend-promise]
recipe = slapos.cookbook:check_url_available
path = $${directory:promises}/openstack_frontend
url = $${request-openstack-frontend:connection-site_url}
dash_path = ${dash:location}/bin/dash
curl_path = ${curl:location}/bin/curl
match = OpenStack

305 306 307 308

[slap-parameter]
# Default values if not specified
frontend-software-type = frontend
309 310
kvm-frontend-url = http://git.erp5.org/gitweb/slapos.git/blob_plain/refs/tags/slapos-0.92:/software/kvm/software.cfg
frontend-software-url = http://git.erp5.org/gitweb/slapos.git/blob_plain/HEAD:/software/apache-frontend/software.cfg
Alain Takoudjou's avatar
Alain Takoudjou committed
311
frontend-instance-guid =
312 313 314 315

ram-size = 2048
disk-size = 20
disk-type = virtio
316 317
virtual-hard-drive-url = https://[2001:470:1f14:169:e1f9:5f22:ff2b:6938]:8070/data/public/9052f7.php?dl=true
virtual-hard-drive-md5sum = 0e359c2aa6e9430326be15656eeb8a3c
318 319

cpu-count = 4
320
nbd-port = 1024
321 322
#Use Ubuntu 13.04 server
nbd-host = 2001:470:1f14:169:dd6b:3f84:9205:6218
323 324
nbd2-port = 1024
nbd2-host =
325 326

#Create this user and password on system
327 328
system-user = stack
system-passwd = openstack
329
#Project name and user-name for openstack. Password is generated by SlapOS
330 331
project = slapos
user-name = slapos
332

333 334
glance-image-url = http://download.cirros-cloud.net/0.3.1/cirros-0.3.1-x86_64-disk.img
glance-image-name = cirros-0.3.1-x86_64
335

336
domain =