Merge master into grid-computing
[slapos.git] / software / kvm / instance-kvm.cfg.in
1 #############################
2 #
3 # Instanciate kvm
4 #
5 #############################
6 [buildout]
7 parts =
8   certificate-authority
9   publish-kvm-connection-information
10   kvm-promise
11   websockify-sighandler
12   novnc-promise
13   frontend-promise
14
15 eggs-directory = ${buildout:eggs-directory}
16 develop-eggs-directory = ${buildout:develop-eggs-directory}
17 offline = true
18
19 [directory]
20 recipe = slapos.cookbook:mkdirectory
21 etc = $${buildout:directory}/etc
22 bin = $${buildout:directory}/bin
23 srv = $${buildout:directory}/srv
24 var = $${buildout:directory}/var
25 scripts = $${:etc}/run
26 services = $${:etc}/service
27 promises = $${:etc}/promise
28 novnc-conf = $${:etc}/novnc
29 run = $${:var}/run
30 ca-dir = $${:srv}/ssl
31
32 [create-mac]
33 recipe = slapos.cookbook:generate.mac
34 storage-path = $${directory:srv}/mac
35
36 [gen-passwd]
37 recipe = slapos.cookbook:generate.password
38 storage-path = $${directory:srv}/passwd
39 bytes = 8
40
41 [kvm-instance]
42 # XXX-Cedric: change "KVM" recipe to simple "create wrappers". No need for this
43 # Specific code
44 recipe = slapos.cookbook:kvm
45 vnc-ip = $${slap-network-information:local-ipv4}
46 vnc-port = 5901
47 nbd-host = $${slap-parameter:nbd-host}
48 nbd-port = $${slap-parameter:nbd-port}
49 nbd2-host = $${slap-parameter:nbd2-host}
50 nbd2-port = $${slap-parameter:nbd2-port}
51 tap = $${slap-network-information:network-interface}
52 disk-path = $${directory:srv}/virtual.qcow2
53 disk-size = $${slap-parameter:disk-size}
54 disk-type = $${slap-parameter:disk-type}
55 socket-path = $${directory:var}/qmp_socket
56 pid-path = $${directory:run}/pid_file
57 smp-count = $${slap-parameter:cpu-count}
58 ram-size = $${slap-parameter:ram-size}
59 mac-address = $${create-mac:mac-address}
60 runner-path = $${directory:services}/kvm
61 controller-path = $${directory:scripts}/kvm_controller
62 shell-path = ${dash:location}/bin/dash
63 qemu-path = ${kvm:location}/bin/qemu-system-x86_64
64 qemu-img-path = ${kvm:location}/bin/qemu-img
65 passwd = $${gen-passwd:passwd}
66
67 [kvm-promise]
68 recipe = slapos.cookbook:check_port_listening
69 path = $${directory:promises}/vnc_promise
70 hostname = $${kvm-instance:vnc-ip}
71 port = $${kvm-instance:vnc-port}
72
73
74 [novnc-instance]
75 recipe = slapos.cookbook:novnc
76 path = $${ca-novnc:executable}
77 ip = $${slap-network-information:global-ipv6}
78 port = 6080
79 vnc-ip = $${kvm-instance:vnc-ip}
80 vnc-port = $${kvm-instance:vnc-port}
81 novnc-location = ${noVNC:location}
82 websockify-path = ${buildout:directory}/bin/websockify
83 ssl-key-path = $${ca-novnc:key-file}
84 ssl-cert-path = $${ca-novnc:cert-file}
85
86 [websockify-sighandler]
87 recipe = slapos.cookbook:signalwrapper
88 wrapper-path = $${directory:services}/websockify
89 wrapped-path = $${novnc-instance:path}
90
91 [certificate-authority]
92 recipe = slapos.cookbook:certificate_authority
93 openssl-binary = ${openssl:location}/bin/openssl
94 ca-dir = $${directory:ca-dir}
95 requests-directory = $${cadirectory:requests}
96 wrapper = $${directory:services}/certificate_authority
97 ca-private = $${cadirectory:private}
98 ca-certs = $${cadirectory:certs}
99 ca-newcerts = $${cadirectory:newcerts}
100 ca-crl = $${cadirectory:crl}
101
102 [cadirectory]
103 recipe = slapos.cookbook:mkdirectory
104 requests = $${directory:ca-dir}/requests/
105 private = $${directory:ca-dir}/private/
106 certs = $${directory:ca-dir}/certs/
107 newcerts = $${directory:ca-dir}/newcerts/
108 crl = $${directory:ca-dir}/crl/
109
110 [ca-novnc]
111 <= certificate-authority
112 recipe = slapos.cookbook:certificate_authority.request
113 key-file = $${directory:novnc-conf}/novnc.key
114 cert-file = $${directory:novnc-conf}/novnc.crt
115 executable = $${directory:bin}/novnc
116 wrapper = $${directory:bin}/websockify
117
118 [novnc-promise]
119 recipe = slapos.cookbook:check_port_listening
120 path = $${directory:promises}/novnc_promise
121 hostname = $${novnc-instance:ip}
122 port = $${novnc-instance:port}
123
124
125 [kvm-monitor]
126 recipe = slapos.cookbook:generic.slapmonitor
127 db-path = $${directory:srv}/slapmonitor_database
128
129
130 [request-slave-frontend]
131 recipe = slapos.cookbook:requestoptional
132 software-url = $${slap-parameter:frontend-software-url}
133 server-url = $${slap-connection:server-url}
134 key-file = $${slap-connection:key-file}
135 cert-file = $${slap-connection:cert-file}
136 computer-id = $${slap-connection:computer-id}
137 partition-id = $${slap-connection:partition-id}
138 name = VNC Frontend
139 software-type = $${slap-parameter:frontend-software-type}
140 slave = true
141 config = host port
142 config-host = $${novnc-instance:ip}
143 config-port = $${novnc-instance:port}
144 return = url resource port domainname
145 sla = instance_guid
146 sla-instance_guid = $${slap-parameter:frontend-instance-guid}
147
148
149 [publish-kvm-connection-information]
150 recipe = slapos.cookbook:publish
151 backend-url = https://[$${novnc-instance:ip}]:$${novnc-instance:port}/vnc_auto.html?host=[$${novnc-instance:ip}]&port=$${novnc-instance:port}&encrypt=1
152 password = $${kvm-instance:passwd}
153 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}
154
155
156 [frontend-promise]
157 recipe = slapos.cookbook:check_url_available
158 path = $${directory:promises}/frontend_promise
159 url = $${publish-kvm-connection-information:url}
160 dash_path = ${dash:location}/bin/dash
161 curl_path = ${curl:location}/bin/curl
162
163 [slap-parameter]
164 # Default values if not specified
165 frontend-software-type = frontend
166 frontend-software-url = http://git.erp5.org/gitweb/slapos.git/blob_plain/refs/tags/slapos-0.92:/software/kvm/software.cfg
167
168 nbd-port = 1024
169 nbd-host = debian.nbd.vifib.net
170 nbd2-port = 1024
171 nbd2-host =
172
173 ram-size = 1024
174 disk-size = 10
175 disk-type = virtio
176
177 cpu-count = 1