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