instance-kvm.cfg 5.26 KB
Newer Older
1 2 3 4 5 6 7 8
#############################
#
# Instanciate kvm
#
#############################
[buildout]
parts =
  certificate-authority
Romain Courteaud's avatar
Romain Courteaud committed
9 10
  publish-kvm-backend-connection-information
  publish-kvm-frontend-connection-information
11
  kvm-promise
12
  websockify-sighandler
13
  novnc-promise
14
  frontend-promise
15 16 17 18 19

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

20
[directory]
21 22 23 24 25
recipe = slapos.cookbook:mkdirectory
etc = $${buildout:directory}/etc
bin = $${buildout:directory}/bin
srv = $${buildout:directory}/srv
var = $${buildout:directory}/var
26 27 28 29 30 31
scripts = $${:etc}/run
services = $${:etc}/service
promises = $${:etc}/promise
novnc-conf = $${:etc}/novnc
run = $${:var}/run
ca-dir = $${:srv}/ssl
32 33 34

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

37 38
[gen-passwd]
recipe = slapos.cookbook:generate.password
39
storage-path = $${directory:srv}/passwd
40 41
bytes = 4

42
[kvm-instance]
43 44
# XXX-Cedric: change "KVM" recipe to simple "create wrappers". No need for this
# Specific code
45
recipe = slapos.cookbook:kvm
46 47 48 49 50
vnc-ip = $${slap-network-information:local-ipv4}
vnc-port = 5901
nbd-ip = $${slap-parameter:nbd_ip}
nbd-port = $${slap-parameter:nbd_port}
tap = $${slap-network-information:network-interface}
51
disk-path = $${directory:srv}/virtual.qcow2
52
disk-size = 10
53 54
socket-path = $${directory:var}/qmp_socket
pid-path = $${directory:run}/pid_file
55 56 57
smp-count = 1
ram-size = 1024
mac-address = $${create-mac:mac-address}
58 59
runner-path = $${directory:services}/kvm
controller-path = $${directory:scripts}/kvm_controller
60 61 62
shell-path = ${dash:location}/bin/dash
qemu-path = ${kvm:location}/bin/qemu-system-x86_64
qemu-img-path = ${kvm:location}/bin/qemu-img
63
passwd = $${gen-passwd:passwd}
64 65 66

[kvm-promise]
recipe = slapos.cookbook:check_port_listening
67
path = $${directory:promises}/vnc_promise
68 69 70
hostname = $${kvm-instance:vnc-ip}
port = $${kvm-instance:vnc-port}

71

72
[novnc-instance]
73
recipe = slapos.cookbook:novnc
74 75 76 77 78 79 80 81 82 83
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}

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

89 90 91
[certificate-authority]
recipe = slapos.cookbook:certificate_authority
openssl-binary = ${openssl:location}/bin/openssl
92
ca-dir = $${directory:ca-dir}
93
requests-directory = $${cadirectory:requests}
94
wrapper = $${directory:services}/certificate_authority
95 96 97 98 99 100 101
ca-private = $${cadirectory:private}
ca-certs = $${cadirectory:certs}
ca-newcerts = $${cadirectory:newcerts}
ca-crl = $${cadirectory:crl}

[cadirectory]
recipe = slapos.cookbook:mkdirectory
102 103 104 105 106
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/
107 108 109 110

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

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

122

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

127 128

[request-slave-frontend]
129
recipe = slapos.cookbook:requestoptional
Romain Courteaud's avatar
Typo  
Romain Courteaud committed
130
software-url = $${slap-parameter:frontend-software-url}
131 132 133 134 135 136
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 = SlaveFrontend
Romain Courteaud's avatar
Typo  
Romain Courteaud committed
137
software-type = $${slap-parameter:frontend-software-type}
138
slave = true
139 140 141
config = host port
config-host = $${novnc-instance:ip}
config-port = $${novnc-instance:port}
142
return = url resource port domainname
143 144
sla = instance_guid
sla-instance_guid = $${slap-parameter:frontend-instance-guid}
145

Romain Courteaud's avatar
Romain Courteaud committed
146 147 148 149 150 151 152 153
[publish-kvm-backend-connection-information]
recipe = slapos.cookbook:publish
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:passwd}

[publish-kvm-frontend-connection-information]
<= publish-kvm-backend-connection-information
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]
recipe = slapos.cookbook:check_url_available
157
path = $${directory:promises}/frontend_promise
Romain Courteaud's avatar
Romain Courteaud committed
158
url = $${publish-kvm-frontend-connection-information:url}
159
dash_path = ${dash:location}/bin/dash
Romain Courteaud's avatar
Romain Courteaud committed
160
curl_path = ${curl:location}/bin/curl
161 162 163 164 165 166 167 168

[slap-parameter]
# Default values if not specified
frontend-instance-guid = SOFTINST-11031
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
nbd_port = 1024
nbd_ip = debian.nbd.vifib.net