Commit a028763d authored by Boxiang Sun's avatar Boxiang Sun

kvm: use free port in monitor-httpd-port

parent 3e87f6d7
...@@ -15,23 +15,23 @@ ...@@ -15,23 +15,23 @@
[template] [template]
filename = instance.cfg.in filename = instance.cfg.in
md5sum = b6204319cca4264b3c351d4dd1f2b5d0 md5sum = abd8493f35e153a5984ed22c8fe49792
[template-kvm] [template-kvm]
filename = instance-kvm.cfg.jinja2 filename = instance-kvm.cfg.jinja2
md5sum = 4ae98a072354efbdd7440d800cc675c8 md5sum = 900faa43cd9bb599aa7be0cdc64531bf
[template-kvm-cluster] [template-kvm-cluster]
filename = instance-kvm-cluster.cfg.jinja2.in filename = instance-kvm-cluster.cfg.jinja2.in
md5sum = 15415f63741dc8c478512f9e410bb0ae md5sum = be9b1a7e4b87c90b5b8599e7f7214add
[template-kvm-resilient] [template-kvm-resilient]
filename = instance-kvm-resilient.cfg.jinja2 filename = instance-kvm-resilient.cfg.jinja2
md5sum = 839fc16c112d3b87e2dbd2e382e326de md5sum = 7804576ecfe84871dce3a5e604330fda
[template-kvm-import] [template-kvm-import]
filename = instance-kvm-import.cfg.jinja2.in filename = instance-kvm-import.cfg.jinja2.in
md5sum = a463a5e3cd2287d275d6943c2a11b7e4 md5sum = 69f3994e3a422db099692e384267697a
[template-kvm-import-script] [template-kvm-import-script]
filename = template/kvm-import.sh.jinja2 filename = template/kvm-import.sh.jinja2
...@@ -39,7 +39,7 @@ md5sum = cd0008f1689dfca9b77370bc4d275b70 ...@@ -39,7 +39,7 @@ md5sum = cd0008f1689dfca9b77370bc4d275b70
[template-kvm-export] [template-kvm-export]
filename = instance-kvm-export.cfg.jinja2 filename = instance-kvm-export.cfg.jinja2
md5sum = 34d1b7cc8ca62bfdfce759a1dfbbaccd md5sum = d9cbae97c02f2df23c1a2a69dc7c9c0f
[template-kvm-export-script] [template-kvm-export-script]
filename = template/kvm-export.sh.jinja2 filename = template/kvm-export.sh.jinja2
......
...@@ -300,8 +300,14 @@ recipe = slapos.cookbook:publish-early ...@@ -300,8 +300,14 @@ recipe = slapos.cookbook:publish-early
-init = -init =
monitor-password monitor-htpasswd:passwd monitor-password monitor-htpasswd:passwd
[kvm-monitor-port]
recipe = slapos.cookbook:free_port
minimum = 8060
maximum = 8080
ip = {{ partition_ipv6 }}
[monitor-instance-parameter] [monitor-instance-parameter]
monitor-httpd-port = 8060 monitor-httpd-port = ${kvm-monitor-port:port}
cors-domains = {{ slapparameter_dict.get('monitor-cors-domains', 'monitor.app.officejs.com') }} cors-domains = {{ slapparameter_dict.get('monitor-cors-domains', 'monitor.app.officejs.com') }}
username = admin username = admin
password = ${publish-early:monitor-password} password = ${publish-early:monitor-password}
......
...@@ -45,8 +45,14 @@ context = ...@@ -45,8 +45,14 @@ context =
monitor-base-url = ${monitor-publish:monitor-base-url} monitor-base-url = ${monitor-publish:monitor-base-url}
monitor-setup-url = ${monitor-publish:monitor-setup-url} monitor-setup-url = ${monitor-publish:monitor-setup-url}
[kvm-monitor-port]
recipe = slapos.cookbook:free_port
minimum = 8026
maximum = 8046
ip = {{ partition_ipv6 }}
[monitor-instance-parameter] [monitor-instance-parameter]
monitor-httpd-port = 8026 monitor-httpd-port = ${kvm-monitor-port:port}
monitor-title = {{ slapparameter_dict.get('name', 'KVM Standalone') }} monitor-title = {{ slapparameter_dict.get('name', 'KVM Standalone') }}
cors-domains = {{ slapparameter_dict.get('monitor-cors-domains', 'monitor.app.officejs.com') }} cors-domains = {{ slapparameter_dict.get('monitor-cors-domains', 'monitor.app.officejs.com') }}
{% if slapparameter_dict.get('monitor-username', '') -%} {% if slapparameter_dict.get('monitor-username', '') -%}
......
...@@ -27,8 +27,14 @@ monitor-url = ${monitor-publish-parameters:monitor-url} ...@@ -27,8 +27,14 @@ monitor-url = ${monitor-publish-parameters:monitor-url}
monitor-user = ${monitor-publish-parameters:monitor-user} monitor-user = ${monitor-publish-parameters:monitor-user}
monitor-password = ${monitor-publish-parameters:monitor-password} monitor-password = ${monitor-publish-parameters:monitor-password}
[kvm-monitor-port]
recipe = slapos.cookbook:free_port
minimum = 8276
maximum = 8296
ip = {{ partition_ipv6 }}
[monitor-instance-parameter] [monitor-instance-parameter]
monitor-httpd-port = 8276 monitor-httpd-port = ${kvm-monitor-port:port}
monitor-title = {{ slapparameter_dict.get('name', 'Kvm Resilient clone') }} monitor-title = {{ slapparameter_dict.get('name', 'Kvm Resilient clone') }}
cors-domains = {{ slapparameter_dict.get('monitor-cors-domains', '') }} cors-domains = {{ slapparameter_dict.get('monitor-cors-domains', '') }}
{% if slapparameter_dict.get('monitor-username', '') -%} {% if slapparameter_dict.get('monitor-username', '') -%}
......
...@@ -43,9 +43,15 @@ recipe = slapos.cookbook:publish-early ...@@ -43,9 +43,15 @@ recipe = slapos.cookbook:publish-early
-init = -init =
monitor-password monitor-htpasswd:passwd monitor-password monitor-htpasswd:passwd
[kvm-monitor-port]
recipe = slapos.cookbook:free_port
minimum = 8160
maximum = 8180
ip = {{ partition_ipv6 }}
# XXX Monitoring Main Instane # XXX Monitoring Main Instane
[monitor-instance-parameter] [monitor-instance-parameter]
monitor-httpd-port = 8160 monitor-httpd-port = ${kvm-monitor-port:port}
password = ${publish-early:monitor-password} password = ${publish-early:monitor-password}
cors-domains = {{ monitor_parameter.get('monitor-cors-domains', '') }} cors-domains = {{ monitor_parameter.get('monitor-cors-domains', '') }}
......
...@@ -830,8 +830,14 @@ config-host = ${httpd:host} ...@@ -830,8 +830,14 @@ config-host = ${httpd:host}
config-port = ${httpd:port} config-port = ${httpd:port}
{% endif %} {% endif %}
[kvm-monitor-port]
recipe = slapos.cookbook:free_port
minimum = 8026
maximum = 8046
ip = {{ partition_ipv6 }}
[monitor-instance-parameter] [monitor-instance-parameter]
monitor-httpd-port = 8026 monitor-httpd-port = ${kvm-monitor-port:port}
monitor-title = {{ slapparameter_dict.get('name', 'KVM Standalone') }} monitor-title = {{ slapparameter_dict.get('name', 'KVM Standalone') }}
cors-domains = {{ slapparameter_dict.get('monitor-cors-domains', 'monitor.app.officejs.com') }} cors-domains = {{ slapparameter_dict.get('monitor-cors-domains', 'monitor.app.officejs.com') }}
{% if slapparameter_dict.get('monitor-username', '') -%} {% if slapparameter_dict.get('monitor-username', '') -%}
......
...@@ -69,6 +69,7 @@ extra-context = ...@@ -69,6 +69,7 @@ extra-context =
raw template_content ${template-content:target} raw template_content ${template-content:target}
raw template_httpd_cfg ${template-httpd:output} raw template_httpd_cfg ${template-httpd:output}
raw template_monitor ${monitor2-template:output} raw template_monitor ${monitor2-template:output}
key partition_ipv6 slap-configuration:ipv6-random
[dynamic-template-kvm] [dynamic-template-kvm]
<= jinja2-template-base <= jinja2-template-base
...@@ -105,6 +106,7 @@ extra-context = ...@@ -105,6 +106,7 @@ extra-context =
raw template_nginx ${template-nginx:target} raw template_nginx ${template-nginx:target}
raw websockify_executable_location ${buildout:directory}/bin/websockify raw websockify_executable_location ${buildout:directory}/bin/websockify
raw wipe_disk_wrapper ${buildout:directory}/bin/securedelete raw wipe_disk_wrapper ${buildout:directory}/bin/securedelete
key partition_ipv6 slap-configuration:ipv6-random
template-parts-destination = ${template-parts:target} template-parts-destination = ${template-parts:target}
template-replicated-destination = ${template-replicated:target} template-replicated-destination = ${template-replicated:target}
import-list = file parts :template-parts-destination import-list = file parts :template-parts-destination
...@@ -121,6 +123,7 @@ context = ...@@ -121,6 +123,7 @@ context =
key slapparameter_dict slap-configuration:configuration key slapparameter_dict slap-configuration:configuration
raw curl_executable_location ${curl:location}/bin/curl raw curl_executable_location ${curl:location}/bin/curl
raw template_monitor ${monitor2-template:output} raw template_monitor ${monitor2-template:output}
key partition_ipv6 slap-configuration:ipv6-random
template-parts-destination = ${template-parts:target} template-parts-destination = ${template-parts:target}
template-replicated-destination = ${template-replicated:target} template-replicated-destination = ${template-replicated:target}
import-list = file parts :template-parts-destination import-list = file parts :template-parts-destination
...@@ -139,6 +142,7 @@ context = ...@@ -139,6 +142,7 @@ context =
key pbsready_export_template template-pbsready-export:output key pbsready_export_template template-pbsready-export:output
raw gzip_binary ${gzip:location}/bin/gzip raw gzip_binary ${gzip:location}/bin/gzip
key slapparameter_dict slap-configuration:configuration key slapparameter_dict slap-configuration:configuration
key partition_ipv6 slap-configuration:ipv6-random
[dynamic-template-kvm-import] [dynamic-template-kvm-import]
recipe = slapos.recipe.template:jinja2 recipe = slapos.recipe.template:jinja2
...@@ -154,6 +158,7 @@ context = ...@@ -154,6 +158,7 @@ context =
key slapparameter_dict slap-configuration:configuration key slapparameter_dict slap-configuration:configuration
raw zcat_binary ${gzip:location}/bin/zcat raw zcat_binary ${gzip:location}/bin/zcat
raw gzip_binary ${gzip:location}/bin/gzip raw gzip_binary ${gzip:location}/bin/gzip
key partition_ipv6 slap-configuration:ipv6-random
[dynamic-template-nbd] [dynamic-template-nbd]
<= jinja2-template-base <= jinja2-template-base
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment