instance-kvm.cfg.in 7.15 KB
Newer Older
1 2 3 4 5 6 7 8
#############################
#
# Instanciate kvm
#
#############################
[buildout]
parts =
  certificate-authority
9
  publish-connection-information
10
  kvm-promise
11
  websockify-sighandler
12
  novnc-promise
13
#  kvm-monitor
Vivien Alger's avatar
Vivien Alger committed
14
  cron
15
#  cron-entry-monitor
16
  frontend-promise
17 18 19 20 21

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

22
[directory]
23 24 25 26 27
recipe = slapos.cookbook:mkdirectory
etc = $${buildout:directory}/etc
bin = $${buildout:directory}/bin
srv = $${buildout:directory}/srv
var = $${buildout:directory}/var
Vivien Alger's avatar
Vivien Alger committed
28
log = $${:var}/log
29 30 31 32 33 34
scripts = $${:etc}/run
services = $${:etc}/service
promises = $${:etc}/promise
novnc-conf = $${:etc}/novnc
run = $${:var}/run
ca-dir = $${:srv}/ssl
Vivien Alger's avatar
Vivien Alger committed
35 36 37
cron-entries = $${:etc}/cron.d
crontabs = $${:etc}/crontabs
cronstamps = $${:etc}/cronstamps
38 39 40

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

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

48

49
[kvm-instance]
50
# XXX-Cedric: change "KVM" recipe to simple "create wrappers". No need for this
51
# Specific code. It needs Jinja.
52
recipe = slapos.cookbook:kvm
53

54
vnc-passwd = $${gen-passwd:passwd}
55

56 57
ipv4 = $${slap-network-information:local-ipv4}
ipv6 = $${slap-network-information:global-ipv6}
58
vnc-ip = $${:ipv4}
59

60
vnc-port = 5901
61 62

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

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

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

75
socket-path = $${directory:var}/qmp_socket
76
pid-file-path = $${directory:run}/pid_file
77

78
smp-count = $${slap-parameter:cpu-count}
79
ram-size = $${slap-parameter:ram-size}
80
mac-address = $${create-mac:mac-address}
81 82

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

86 87
use-tap = $${slap-parameter:use-tap}
nat-rules = $${slap-parameter:nat-rules}
88 89 90
6tunnel-wrapper-path = $${directory:services}/6tunnel

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

93 94 95
shell-path = ${dash:location}/bin/dash
qemu-path = ${kvm:location}/bin/qemu-system-x86_64
qemu-img-path = ${kvm:location}/bin/qemu-img
96
6tunnel-path = ${6tunnel:location}/bin/6tunnel
97

98 99 100

[kvm-promise]
recipe = slapos.cookbook:check_port_listening
101
path = $${directory:promises}/vnc_promise
102 103 104
hostname = $${kvm-instance:vnc-ip}
port = $${kvm-instance:vnc-port}

105

106
[novnc-instance]
107
recipe = slapos.cookbook:novnc
108 109 110 111 112 113 114 115 116 117
path = $${ca-novnc:executable}
ip = $${slap-network-information:global-ipv6}
port = 6080
vnc-ip = $${kvm-instance:vnc-ip}
vnc-port = $${kvm-instance:vnc-port}
novnc-location = ${noVNC:location}
websockify-path = ${buildout:directory}/bin/websockify
ssl-key-path = $${ca-novnc:key-file}
ssl-cert-path = $${ca-novnc:cert-file}

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

123 124 125
[certificate-authority]
recipe = slapos.cookbook:certificate_authority
openssl-binary = ${openssl:location}/bin/openssl
126
ca-dir = $${directory:ca-dir}
127
requests-directory = $${cadirectory:requests}
128
wrapper = $${directory:services}/certificate_authority
129 130 131 132 133 134 135
ca-private = $${cadirectory:private}
ca-certs = $${cadirectory:certs}
ca-newcerts = $${cadirectory:newcerts}
ca-crl = $${cadirectory:crl}

[cadirectory]
recipe = slapos.cookbook:mkdirectory
136 137 138 139 140
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/
141 142 143 144

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

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

156

157 158 159
#[kvm-monitor]
#recipe = slapos.cookbook:wrapper
#wrapper-path = $${directory:services}/kvm_monitor
160
#command-line = ${buildout:bin-directory}/kvm.monitor.test
161 162 163 164
#             $${buildout:directory}/buildout-switch-softwaretype.cfg
#             $${buildout:directory}/report.xml
#             -s slap-parameter
#             -opts disk-size ram-size cpu-count
Vivien Alger's avatar
Vivien Alger committed
165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186



#----------------
#--
#-- Deploy cron.

[cron]
recipe = slapos.cookbook:cron
dcrond-binary = ${dcron:location}/sbin/crond
cron-entries = $${directory:cron-entries}
crontabs = $${directory:crontabs}
cronstamps = $${directory:cronstamps}
catcher = $${cron-simplelogger:wrapper}
binary = $${directory:services}/crond

[cron-simplelogger]
recipe = slapos.cookbook:simplelogger
wrapper = $${directory:bin}/cron_simplelogger
log = $${directory:log}/crond.log


187 188 189 190 191 192
#[cron-entry-monitor]
#<= cron
#recipe = slapos.cookbook:cron.d
#name = kvm_monitor
#frequency = 0 0 * * *
#command = $${kvm-monitor:wrapper-path}
193 194

[request-slave-frontend]
195
recipe = slapos.cookbook:requestoptional
Romain Courteaud's avatar
Typo  
Romain Courteaud committed
196
software-url = $${slap-parameter:frontend-software-url}
197 198 199 200 201
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}
202
name = VNC Frontend
Romain Courteaud's avatar
Typo  
Romain Courteaud committed
203
software-type = $${slap-parameter:frontend-software-type}
204
slave = true
205 206 207
config = host port
config-host = $${novnc-instance:ip}
config-port = $${novnc-instance:port}
208
return = url resource port domainname
209 210
sla = instance_guid
sla-instance_guid = $${slap-parameter:frontend-instance-guid}
211

212

213
[publish-connection-information]
Romain Courteaud's avatar
Romain Courteaud committed
214
recipe = slapos.cookbook:publish
215 216
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}
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}
217
ipv6 = $${slap-network-information:global-ipv6}
218

219 220
[frontend-promise]
recipe = slapos.cookbook:check_url_available
221
path = $${directory:promises}/frontend_promise
222
url = $${publish-connection-information:url}
223
dash_path = ${dash:location}/bin/dash
Romain Courteaud's avatar
Romain Courteaud committed
224
curl_path = ${curl:location}/bin/curl
225 226 227 228 229

[slap-parameter]
# Default values if not specified
frontend-software-type = frontend
frontend-software-url = http://git.erp5.org/gitweb/slapos.git/blob_plain/refs/tags/slapos-0.92:/software/kvm/software.cfg
230
frontend-instance-guid =
231
nbd-port = 1024
232
nbd-host =
233 234
nbd2-port = 1024
nbd2-host =
235 236 237

ram-size = 1024
disk-size = 10
238 239
disk-type = virtio

240
cpu-count = 1
241 242 243 244

nat-rules = 22 80 443
use-tap = False

245
virtual-hard-drive-url =
246
virtual-hard-drive-md5sum =