Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
slapos
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Matevz Golob
slapos
Commits
00e55f04
Commit
00e55f04
authored
Oct 29, 2013
by
Cédric de Saint Martin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
KVM: convert kvm instance profile to jinja2.
parent
bf218a8c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
262 additions
and
6 deletions
+262
-6
software/kvm/common.cfg
software/kvm/common.cfg
+21
-6
software/kvm/instance-kvm.cfg.jinja2
software/kvm/instance-kvm.cfg.jinja2
+241
-0
No files found.
software/kvm/common.cfg
View file @
00e55f04
...
@@ -85,10 +85,24 @@ output = ${buildout:directory}/template.cfg
...
@@ -85,10 +85,24 @@ output = ${buildout:directory}/template.cfg
mode = 0644
mode = 0644
[template-kvm]
[template-kvm]
recipe = slapos.recipe.template
recipe = slapos.recipe.template:jinja2
url = ${:_profile_base_location_}/instance-kvm.cfg.in
template = ${:_profile_base_location_}/instance-kvm.cfg.jinja2
md5sum = c06bb498593aabc9c76eb7dc892da15a
md5sum = 03550e647e07af99dcd2af8f4869ecbe
output = ${buildout:directory}/template-kvm.cfg
rendered = ${buildout:directory}/template-kvm.cfg
output = ${:rendered}
context =
key develop_eggs_directory buildout:develop-eggs-directory
key eggs_directory buildout:eggs-directory
raw curl_executable_location ${curl:location}/bin/curl
raw dash_executable_location ${dash:location}/bin/dash
raw dcron_executable_location ${dcron:location}/sbin/crond
raw debian_amd64_netinst_location ${debian-amd64-netinst.iso:location}/${debian-amd64-netinst.iso:filename}
raw novnc_location ${noVNC:location}
raw openssl_executable_location ${openssl:location}/bin/openssl
raw qemu_executable_location ${kvm:location}/bin/qemu-system-x86_64
raw qemu_img_executable_location ${kvm:location}/bin/qemu-img
raw sixtunnel_executable_location ${6tunnel:location}/bin/6tunnel
raw websockify_executable_location ${buildout:directory}/bin/websockify
mode = 0644
mode = 0644
[template-kvm-resilient]
[template-kvm-resilient]
...
@@ -125,7 +139,7 @@ mode = 0755
...
@@ -125,7 +139,7 @@ mode = 0755
[template-kvm-export]
[template-kvm-export]
recipe = slapos.recipe.template
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/instance-kvm-export.cfg.in
url = ${:_profile_base_location_}/instance-kvm-export.cfg.in
md5sum = 2f5fdf1e88e6e3454f877b80074bed05
md5sum = 2f5fdf1e88e6e3454f877b80074bed05
output = ${buildout:directory}/template-kvm-export.cfg
output = ${buildout:directory}/template-kvm-export.cfg
mode = 0644
mode = 0644
...
@@ -133,7 +147,7 @@ mode = 0644
...
@@ -133,7 +147,7 @@ mode = 0644
recipe = hexagonit.recipe.download
recipe = hexagonit.recipe.download
url = ${:_profile_base_location_}/template/kvm-export.sh.in
url = ${:_profile_base_location_}/template/kvm-export.sh.in
filename = kvm-export.sh.in
filename = kvm-export.sh.in
md5sum = 95fde96f35cbf90d677c44d18b60fafb
md5sum = 95fde96f35cbf90d677c44d18b60fafb
download-only = true
download-only = true
mode = 0755
mode = 0755
...
@@ -151,3 +165,4 @@ md5sum = cdb690495e9eb007d2b7d2f8e12f5c59
...
@@ -151,3 +165,4 @@ md5sum = cdb690495e9eb007d2b7d2f8e12f5c59
output = ${buildout:directory}/template-frontend.cfg
output = ${buildout:directory}/template-frontend.cfg
mode = 0644
mode = 0644
software/kvm/instance-kvm.cfg.
in
→
software/kvm/instance-kvm.cfg.
jinja2
View file @
00e55f04
...
@@ -16,34 +16,34 @@ parts =
...
@@ -16,34 +16,34 @@ parts =
# cron-entry-monitor
# cron-entry-monitor
frontend-promise
frontend-promise
eggs-directory =
${buildout:eggs-directory
}
eggs-directory =
{{ eggs_directory }
}
develop-eggs-directory =
${buildout:develop-eggs-directory
}
develop-eggs-directory =
{{ develop_eggs_directory }
}
offline = true
offline = true
[directory]
[directory]
recipe = slapos.cookbook:mkdirectory
recipe = slapos.cookbook:mkdirectory
etc = $
$
{buildout:directory}/etc
etc = ${buildout:directory}/etc
bin = $
$
{buildout:directory}/bin
bin = ${buildout:directory}/bin
srv = $
$
{buildout:directory}/srv
srv = ${buildout:directory}/srv
var = $
$
{buildout:directory}/var
var = ${buildout:directory}/var
log = $
$
{:var}/log
log = ${:var}/log
scripts = $
$
{:etc}/run
scripts = ${:etc}/run
services = $
$
{:etc}/service
services = ${:etc}/service
promises = $
$
{:etc}/promise
promises = ${:etc}/promise
novnc-conf = $
$
{:etc}/novnc
novnc-conf = ${:etc}/novnc
run = $
$
{:var}/run
run = ${:var}/run
ca-dir = $
$
{:srv}/ssl
ca-dir = ${:srv}/ssl
cron-entries = $
$
{:etc}/cron.d
cron-entries = ${:etc}/cron.d
crontabs = $
$
{:etc}/crontabs
crontabs = ${:etc}/crontabs
cronstamps = $
$
{:etc}/cronstamps
cronstamps = ${:etc}/cronstamps
[create-mac]
[create-mac]
recipe = slapos.cookbook:generate.mac
recipe = slapos.cookbook:generate.mac
storage-path = $
$
{directory:srv}/mac
storage-path = ${directory:srv}/mac
[gen-passwd]
[gen-passwd]
recipe = slapos.cookbook:generate.password
recipe = slapos.cookbook:generate.password
storage-path = $
$
{directory:srv}/passwd
storage-path = ${directory:srv}/passwd
bytes = 8
bytes = 8
...
@@ -52,126 +52,115 @@ bytes = 8
...
@@ -52,126 +52,115 @@ bytes = 8
# Specific code. It needs Jinja.
# Specific code. It needs Jinja.
recipe = slapos.cookbook:kvm
recipe = slapos.cookbook:kvm
vnc-passwd = $
$
{gen-passwd:passwd}
vnc-passwd = ${gen-passwd:passwd}
ipv4 = $
$
{slap-network-information:local-ipv4}
ipv4 = ${slap-network-information:local-ipv4}
ipv6 = $
$
{slap-network-information:global-ipv6}
ipv6 = ${slap-network-information:global-ipv6}
vnc-ip = $
$
{:ipv4}
vnc-ip = ${:ipv4}
vnc-port = 5901
vnc-port = 5901
# XXX-Cedric: should be named "default-cdrom-iso"
# XXX-Cedric: should be named "default-cdrom-iso"
default-disk-image =
${debian-amd64-netinst.iso:location}/${debian-amd64-netinst.iso:filename
}
default-disk-image =
{{ debian_amd64_netinst_location }
}
nbd-host = $
$
{slap-parameter:nbd-host}
nbd-host = ${slap-parameter:nbd-host}
nbd-port = $
$
{slap-parameter:nbd-port}
nbd-port = ${slap-parameter:nbd-port}
nbd2-host = $
$
{slap-parameter:nbd2-host}
nbd2-host = ${slap-parameter:nbd2-host}
nbd2-port = $
$
{slap-parameter:nbd2-port}
nbd2-port = ${slap-parameter:nbd2-port}
tap-interface = $
$
{slap-network-information:network-interface}
tap-interface = ${slap-network-information:network-interface}
disk-path = $
$
{directory:srv}/virtual.qcow2
disk-path = ${directory:srv}/virtual.qcow2
disk-size = $
$
{slap-parameter:disk-size}
disk-size = ${slap-parameter:disk-size}
disk-type = $
$
{slap-parameter:disk-type}
disk-type = ${slap-parameter:disk-type}
socket-path = $
$
{directory:var}/qmp_socket
socket-path = ${directory:var}/qmp_socket
pid-file-path = $
$
{directory:run}/pid_file
pid-file-path = ${directory:run}/pid_file
smp-count = $
$
{slap-parameter:cpu-count}
smp-count = ${slap-parameter:cpu-count}
ram-size = $
$
{slap-parameter:ram-size}
ram-size = ${slap-parameter:ram-size}
mac-address = $
$
{create-mac:mac-address}
mac-address = ${create-mac:mac-address}
# XXX-Cedric: should be named runner-wrapper-path and controller-wrapper-path
# XXX-Cedric: should be named runner-wrapper-path and controller-wrapper-path
runner-path = $
$
{directory:services}/kvm
runner-path = ${directory:services}/kvm
controller-path = $
$
{directory:scripts}/kvm_controller
controller-path = ${directory:scripts}/kvm_controller
use-tap = $
$
{slap-parameter:use-tap}
use-tap = ${slap-parameter:use-tap}
nat-rules = $
$
{slap-parameter:nat-rules}
nat-rules = ${slap-parameter:nat-rules}
6tunnel-wrapper-path = $
$
{directory:services}/6tunnel
6tunnel-wrapper-path = ${directory:services}/6tunnel
virtual-hard-drive-url = $
$
{slap-parameter:virtual-hard-drive-url}
virtual-hard-drive-url = ${slap-parameter:virtual-hard-drive-url}
virtual-hard-drive-md5sum = $
$
{slap-parameter:virtual-hard-drive-md5sum}
virtual-hard-drive-md5sum = ${slap-parameter:virtual-hard-drive-md5sum}
shell-path =
${dash:location}/bin/dash
shell-path =
{{ dash_executable_location }}
qemu-path =
${kvm:location}/bin/qemu-system-x86_64
qemu-path =
{{ qemu_executable_location }}
qemu-img-path =
${kvm:location}/bin/qemu-img
qemu-img-path =
{{ qemu_img_executable_location }}
6tunnel-path =
${6tunnel:location}/bin/6tunnel
6tunnel-path =
{{ sixtunnel_executable_location }}
[kvm-vnc-promise]
[kvm-vnc-promise]
recipe = slapos.cookbook:check_port_listening
recipe = slapos.cookbook:check_port_listening
path = $
$
{directory:promises}/vnc_promise
path = ${directory:promises}/vnc_promise
hostname = $
$
{kvm-instance:vnc-ip}
hostname = ${kvm-instance:vnc-ip}
port = $
$
{kvm-instance:vnc-port}
port = ${kvm-instance:vnc-port}
[kvm-disk-image-corruption-promise]
[kvm-disk-image-corruption-promise]
# Check that disk image is not corrupted
# Check that disk image is not corrupted
recipe = collective.recipe.template
recipe = collective.recipe.template
input = inline:#!/bin/sh
input = inline:#!/bin/sh
$
${kvm-instance:qemu-img-path} check $
${kvm-instance:disk-path}
$
{kvm-instance:qemu-img-path} check
${kvm-instance:disk-path}
output = $
$
{directory:promises}/kvm-disk-image-corruption
output = ${directory:promises}/kvm-disk-image-corruption
mode = 700
mode = 700
[novnc-instance]
[novnc-instance]
recipe = slapos.cookbook:novnc
recipe = slapos.cookbook:novnc
path = $
$
{ca-novnc:executable}
path = ${ca-novnc:executable}
ip = $
$
{slap-network-information:global-ipv6}
ip = ${slap-network-information:global-ipv6}
port = 6080
port = 6080
vnc-ip = $
$
{kvm-instance:vnc-ip}
vnc-ip = ${kvm-instance:vnc-ip}
vnc-port = $
$
{kvm-instance:vnc-port}
vnc-port = ${kvm-instance:vnc-port}
novnc-location =
${noVNC:location
}
novnc-location =
{{ novnc_location }
}
websockify-path =
${buildout:directory}/bin/websockify
websockify-path =
{{ websockify_executable_location }}
ssl-key-path = $
$
{ca-novnc:key-file}
ssl-key-path = ${ca-novnc:key-file}
ssl-cert-path = $
$
{ca-novnc:cert-file}
ssl-cert-path = ${ca-novnc:cert-file}
[websockify-sighandler]
[websockify-sighandler]
recipe = slapos.cookbook:signalwrapper
recipe = slapos.cookbook:signalwrapper
wrapper-path = $
$
{directory:services}/websockify
wrapper-path = ${directory:services}/websockify
wrapped-path = $
$
{novnc-instance:path}
wrapped-path = ${novnc-instance:path}
[certificate-authority]
[certificate-authority]
recipe = slapos.cookbook:certificate_authority
recipe = slapos.cookbook:certificate_authority
openssl-binary =
${openssl:location}/bin/openssl
openssl-binary =
{{ openssl_executable_location }}
ca-dir = $
$
{directory:ca-dir}
ca-dir = ${directory:ca-dir}
requests-directory = $
$
{cadirectory:requests}
requests-directory = ${cadirectory:requests}
wrapper = $
$
{directory:services}/certificate_authority
wrapper = ${directory:services}/certificate_authority
ca-private = $
$
{cadirectory:private}
ca-private = ${cadirectory:private}
ca-certs = $
$
{cadirectory:certs}
ca-certs = ${cadirectory:certs}
ca-newcerts = $
$
{cadirectory:newcerts}
ca-newcerts = ${cadirectory:newcerts}
ca-crl = $
$
{cadirectory:crl}
ca-crl = ${cadirectory:crl}
[cadirectory]
[cadirectory]
recipe = slapos.cookbook:mkdirectory
recipe = slapos.cookbook:mkdirectory
requests = $
$
{directory:ca-dir}/requests/
requests = ${directory:ca-dir}/requests/
private = $
$
{directory:ca-dir}/private/
private = ${directory:ca-dir}/private/
certs = $
$
{directory:ca-dir}/certs/
certs = ${directory:ca-dir}/certs/
newcerts = $
$
{directory:ca-dir}/newcerts/
newcerts = ${directory:ca-dir}/newcerts/
crl = $
$
{directory:ca-dir}/crl/
crl = ${directory:ca-dir}/crl/
[ca-novnc]
[ca-novnc]
<= certificate-authority
<= certificate-authority
recipe = slapos.cookbook:certificate_authority.request
recipe = slapos.cookbook:certificate_authority.request
key-file = $
$
{directory:novnc-conf}/novnc.key
key-file = ${directory:novnc-conf}/novnc.key
cert-file = $
$
{directory:novnc-conf}/novnc.crt
cert-file = ${directory:novnc-conf}/novnc.crt
executable = $
$
{directory:bin}/novnc
executable = ${directory:bin}/novnc
wrapper = $
$
{directory:bin}/websockify
wrapper = ${directory:bin}/websockify
[novnc-promise]
[novnc-promise]
recipe = slapos.cookbook:check_port_listening
recipe = slapos.cookbook:check_port_listening
path = $${directory:promises}/novnc_promise
path = ${directory:promises}/novnc_promise
hostname = $${novnc-instance:ip}
hostname = ${novnc-instance:ip}
port = $${novnc-instance:port}
port = ${novnc-instance:port}
#[kvm-monitor]
#recipe = slapos.cookbook:wrapper
#wrapper-path = $${directory:services}/kvm_monitor
#command-line = ${buildout:bin-directory}/kvm.monitor.test
# $${buildout:directory}/buildout-switch-softwaretype.cfg
# $${buildout:directory}/report.xml
# -s slap-parameter
# -opts disk-size ram-size cpu-count
#----------------
#----------------
...
@@ -180,57 +169,54 @@ port = $${novnc-instance:port}
...
@@ -180,57 +169,54 @@ port = $${novnc-instance:port}
[cron]
[cron]
recipe = slapos.cookbook:cron
recipe = slapos.cookbook:cron
dcrond-binary =
${dcron:location}/sbin/crond
dcrond-binary =
{{ dcron_executable_location }}
cron-entries = $
$
{directory:cron-entries}
cron-entries = ${directory:cron-entries}
crontabs = $
$
{directory:crontabs}
crontabs = ${directory:crontabs}
cronstamps = $
$
{directory:cronstamps}
cronstamps = ${directory:cronstamps}
catcher = $
$
{cron-simplelogger:wrapper}
catcher = ${cron-simplelogger:wrapper}
binary = $
$
{directory:services}/crond
binary = ${directory:services}/crond
[cron-simplelogger]
[cron-simplelogger]
recipe = slapos.cookbook:simplelogger
recipe = slapos.cookbook:simplelogger
wrapper = $
$
{directory:bin}/cron_simplelogger
wrapper = ${directory:bin}/cron_simplelogger
log = $
$
{directory:log}/crond.log
log = ${directory:log}/crond.log
#----------------
#[cron-entry-monitor]
#--
#<= cron
#-- Deploy frontend.
#recipe = slapos.cookbook:cron.d
#name = kvm_monitor
#frequency = 0 0 * * *
#command = $${kvm-monitor:wrapper-path}
[request-slave-frontend]
[request-slave-frontend]
recipe = slapos.cookbook:requestoptional
recipe = slapos.cookbook:requestoptional
software-url = $
$
{slap-parameter:frontend-software-url}
software-url = ${slap-parameter:frontend-software-url}
server-url = $
$
{slap-connection:server-url}
server-url = ${slap-connection:server-url}
key-file = $
$
{slap-connection:key-file}
key-file = ${slap-connection:key-file}
cert-file = $
$
{slap-connection:cert-file}
cert-file = ${slap-connection:cert-file}
computer-id = $
$
{slap-connection:computer-id}
computer-id = ${slap-connection:computer-id}
partition-id = $
$
{slap-connection:partition-id}
partition-id = ${slap-connection:partition-id}
name = VNC Frontend
name = VNC Frontend
software-type = $
$
{slap-parameter:frontend-software-type}
software-type = ${slap-parameter:frontend-software-type}
slave = true
slave = true
config = host port
config = host port
config-host = $
$
{novnc-instance:ip}
config-host = ${novnc-instance:ip}
config-port = $
$
{novnc-instance:port}
config-port = ${novnc-instance:port}
return = url resource port domainname
return = url resource port domainname
sla = instance_guid
sla = instance_guid
sla-instance_guid = $${slap-parameter:frontend-instance-guid}
sla-instance_guid = ${slap-parameter:frontend-instance-guid}
[frontend-promise]
recipe = slapos.cookbook:check_url_available
path = ${directory:promises}/frontend_promise
url = ${publish-connection-information:url}
dash_path = {{ dash_executable_location }}
curl_path = {{ curl_executable_location }}
[publish-connection-information]
[publish-connection-information]
recipe = slapos.cookbook:publish
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:vnc-passwd}
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}
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}
ipv6 = $
$
{slap-network-information:global-ipv6}
ipv6 = ${slap-network-information:global-ipv6}
[frontend-promise]
recipe = slapos.cookbook:check_url_available
path = $${directory:promises}/frontend_promise
url = $${publish-connection-information:url}
dash_path = ${dash:location}/bin/dash
curl_path = ${curl:location}/bin/curl
[slap-parameter]
[slap-parameter]
# Default values if not specified
# Default values if not specified
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment