[Sahara] Added indirect access support

This patch allows to mark node group as proxy gateway. In this
case access to other nodes will be through proxy nodes.

Implements blueprint: indirect-vm-access

Change-Id: Idaabfa258ab619c763089cf603b80cb23bf16181
This commit is contained in:
Andrew Lazarev 2014-11-20 13:27:52 -08:00
parent c502d69290
commit 912d9c0723
6 changed files with 29 additions and 5 deletions

View File

@ -125,7 +125,8 @@ def nodegroup_template_create(request, name, plugin_name, hadoop_version,
floating_ip_pool=None, security_groups=None,
auto_security_group=False,
availability_zone=False,
volumes_availability_zone=False):
volumes_availability_zone=False,
is_proxy_gateway=False):
return client(request).node_group_templates.create(
name,
plugin_name,
@ -140,7 +141,8 @@ def nodegroup_template_create(request, name, plugin_name, hadoop_version,
security_groups,
auto_security_group,
availability_zone,
volumes_availability_zone)
volumes_availability_zone,
is_proxy_gateway)
def nodegroup_template_list(request, search_opts=None):
@ -166,7 +168,8 @@ def nodegroup_template_update(request, ngt_id, name, plugin_name,
node_configs=None, floating_ip_pool=None,
security_groups=None, auto_security_group=False,
availability_zone=False,
volumes_availability_zone=False):
volumes_availability_zone=False,
is_proxy_gateway=False):
return client(request).node_group_templates.update(
ngt_id,
name,
@ -182,7 +185,8 @@ def nodegroup_template_update(request, ngt_id, name, plugin_name,
security_groups,
auto_security_group,
availability_zone,
volumes_availability_zone)
volumes_availability_zone,
is_proxy_gateway)
def cluster_template_create(request, name, plugin_name, hadoop_version,

View File

@ -23,6 +23,9 @@
<dd>{{ node_group.availability_zone }}</dd>
{% endif %}
<dt>{% trans "Proxy Gateway" %}</dt>
<dd>{{ node_group.is_proxy_gateway|yesno }}</dd>
<dt>{% trans "Auto Security Group" %}</dt>
<dd>{{ node_group.auto_security_group|yesno }}</dd>

View File

@ -26,6 +26,9 @@
<dd>{% trans "Template not specified" %}</dd>
{% endif %}
<dt>{% trans "Proxy Gateway" %}</dt>
<dd>{{ node_group.is_proxy_gateway|yesno }}</dd>
<dt>{% trans "Auto Security Group" %}</dt>
<dd>{{ node_group.auto_security_group|yesno }}</dd>

View File

@ -33,6 +33,11 @@
<dd>{{ template.hadoop_version }}</dd>
</dl>
<dl class="dl-horizontal">
<dt>{% trans "Proxy Gateway" %}</dt>
<dd>{{ template.is_proxy_gateway }}</dd>
</dl>
<dl class="dl-horizontal">
<dt>{% trans "Auto Security Group" %}</dt>
<dd>{{ template.auto_security_group }}</dd>

View File

@ -163,7 +163,8 @@ class DataProcessingNodeGroupTests(test.TestCase):
'floating_ip_pool': None,
'security_groups': [],
'auto_security_group': True,
'availability_zone': None}) \
'availability_zone': None,
'is_proxy_gateway': False}) \
.AndReturn(True)
self.mox.ReplayAll()

View File

@ -129,6 +129,13 @@ class GeneralConfigAction(workflows.Action):
choices=pool_choices,
required=False)
self.fields["proxygateway"] = forms.BooleanField(
label=_("Proxy Gateway"),
widget=forms.CheckboxInput(),
help_text=_("Sahara will use instances of this node group to "
"access other cluster instances."),
required=False)
self.fields["processes"] = forms.MultipleChoiceField(
label=_("Processes"),
widget=forms.CheckboxSelectMultiple(),
@ -338,6 +345,7 @@ class ConfigureNodegroupTemplate(workflow_helpers.ServiceParametersWorkflow,
floating_ip_pool=context.get("general_floating_ip_pool"),
security_groups=context["security_groups"],
auto_security_group=context["security_autogroup"],
is_proxy_gateway=context["general_proxygateway"],
availability_zone=context["general_availability_zone"])
hlps = helpers.Helpers(request)