Commit 8a7f02b1 authored by Alain Takoudjou's avatar Alain Takoudjou

kvm-cluster: publish tap ipv4 address of all VMs

- publish ipv4 after allocation
- fix computer_guid for cluster allocation
parent a535dd9f
...@@ -94,7 +94,7 @@ mode = 0644 ...@@ -94,7 +94,7 @@ mode = 0644
recipe = hexagonit.recipe.download recipe = hexagonit.recipe.download
url = ${:_profile_base_location_}/instance-kvm.cfg.jinja2 url = ${:_profile_base_location_}/instance-kvm.cfg.jinja2
mode = 644 mode = 644
md5sum = 44e05f2df3ccca0e0287cb65899360e9 md5sum = ba2be2e288c662b1566550132c0ca6a7
download-only = true download-only = true
on-update = true on-update = true
...@@ -102,7 +102,7 @@ on-update = true ...@@ -102,7 +102,7 @@ on-update = true
recipe = hexagonit.recipe.download recipe = hexagonit.recipe.download
url = ${:_profile_base_location_}/instance-kvm-cluster.cfg.jinja2.in url = ${:_profile_base_location_}/instance-kvm-cluster.cfg.jinja2.in
mode = 644 mode = 644
md5sum = 61fe14ac4b32f84a84c6ef20250741cf md5sum = c0c839198bd4450885de865570b6f406
download-only = true download-only = true
on-update = true on-update = true
......
...@@ -24,7 +24,7 @@ config-use-ipv6 = {{ dumps(slapparameter_dict.get('use-ipv6', False)) }} ...@@ -24,7 +24,7 @@ config-use-ipv6 = {{ dumps(slapparameter_dict.get('use-ipv6', False)) }}
<= request-common <= request-common
software-type = kvm software-type = kvm
name = {{ instance_name }} name = {{ instance_name }}
sla-computer_guid = {{ dumps(kvm_parameter_dict.get('computer-guid', computer_id)) }} sla-computer_guid = {{ dumps(kvm_parameter_dict.get('computer-guid', '')) }}
config-frontend-instance-name = {{ instance_name ~ ' VNC Frontend' }} config-frontend-instance-name = {{ instance_name ~ ' VNC Frontend' }}
config-frontend-software-type = {{ dumps(frontend_dict.get('software-type', 'frontend')) }} config-frontend-software-type = {{ dumps(frontend_dict.get('software-type', 'frontend')) }}
...@@ -63,6 +63,11 @@ return = ...@@ -63,6 +63,11 @@ return =
{{ ' ' }}nat-rule-url-{{ port }} {{ ' ' }}nat-rule-url-{{ port }}
{% endfor -%} {% endfor -%}
{% endif -%} {% endif -%}
{% if kvm_parameter_dict.get('use-tap', True) -%}
{{ ' ' }}tap-ipv4
{% do publish_dict.__setitem__('lan-' ~ instance_name, '${' ~ section ~ ':connection-tap-ipv4}') -%}
{% endif -%}
{% do publish_dict.__setitem__(instance_name ~ '-backend-url', '${' ~ section ~ ':connection-backend-url}') -%} {% do publish_dict.__setitem__(instance_name ~ '-backend-url', '${' ~ section ~ ':connection-backend-url}') -%}
{% do publish_dict.__setitem__(instance_name ~ '-url', '${' ~ section ~ ':connection-url}') -%} {% do publish_dict.__setitem__(instance_name ~ '-url', '${' ~ section ~ ':connection-url}') -%}
{% do kvm_instance_dict.__setitem__(instance_name, (kvm_parameter_dict.get('use-nat', True), nat_rules_list)) -%} {% do kvm_instance_dict.__setitem__(instance_name, (kvm_parameter_dict.get('use-nat', True), nat_rules_list)) -%}
...@@ -119,8 +124,9 @@ recipe = slapos.cookbook:publish ...@@ -119,8 +124,9 @@ recipe = slapos.cookbook:publish
{{ name }} = {{ value }} {{ name }} = {{ value }}
{% endfor %} {% endfor %}
{% set disk_number = len(storage_dict) -%} {% set disk_number = len(storage_dict) -%}
{% if disk_number > 0 -%}
1_info = It is possible to mount up to {{ disk_number }} external disk to your virtual machine. See parameter 'external-disk-number' 1_info = It is possible to mount up to {{ disk_number }} external disk to your virtual machine. See parameter 'external-disk-number'
{% endif %}
[buildout] [buildout]
parts = publish parts = publish
......
...@@ -269,6 +269,9 @@ nat-rule-url-{{port}} = [${slap-network-information:global-ipv6}]:{{external_por ...@@ -269,6 +269,9 @@ nat-rule-url-{{port}} = [${slap-network-information:global-ipv6}]:{{external_por
{% endif -%} {% endif -%}
{% endfor -%} {% endfor -%}
{% endif -%} {% endif -%}
{% if slapparameter_dict.get('use-tap', 'False') == 'True' -%}
tap-ipv4 = ${slap-network-information:tap-ipv4}
{% endif -%}
{% if slapparameter_dict.get('use-tap', 'False') == 'True' and tap_network_dict.has_key('ipv4') -%} {% if slapparameter_dict.get('use-tap', 'False') == 'True' and tap_network_dict.has_key('ipv4') -%}
1_info = Use these configurations below to configure interface {{ iface }} in your VM. 1_info = Use these configurations below to configure interface {{ iface }} in your VM.
2_info = ${network-config:ifconfig} 2_info = ${network-config:ifconfig}
......
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