Change compute node to worker node personality

Update misc compute references to worker
Change VM huge pages to application huge pages

Tests Performed:
Non-containerized deployment
AIO-SX: Sanity and Nightly automated test suite
AIO-DX: Sanity and Nightly automated test suite
2+2 System: Sanity and Nightly automated test suite
2+2 System: Horizon Patch Orchestration

Kubernetes deployment:
AIO-SX: Create, delete, reboot and rebuild instances
2+2+2 System: worker nodes are unlock enable and no alarms

Story: 2004022
Task: 27013

Depends-On: https://review.openstack.org/#/c/624452/

Change-Id: Ibe33c0d428d8713155bf605b7dca310644f7009f
Signed-off-by: Tao Liu <tao.liu@windriver.com>
This commit is contained in:
Tao Liu 2018-12-12 10:00:36 -05:00
parent d9bd6001bb
commit 4da5b2a868
27 changed files with 148 additions and 148 deletions

View File

@ -132,8 +132,8 @@ def step_list(request):
class Config(base.APIResourceWrapper):
_attrs = ['cloud', 'storage_apply_type', 'compute_apply_type',
'max_parallel_computes', 'alarm_restriction_type',
_attrs = ['cloud', 'storage_apply_type', 'worker_apply_type',
'max_parallel_workers', 'alarm_restriction_type',
'default_instance_action']

View File

@ -34,12 +34,12 @@ SYSTEM_TYPE_STANDARD = constants.TIS_STD_BUILD
SYSTEM_TYPE_AIO = constants.TIS_AIO_BUILD
PERSONALITY_CONTROLLER = 'controller'
PERSONALITY_COMPUTE = 'compute'
PERSONALITY_WORKER = 'worker'
PERSONALITY_NETWORK = 'network'
PERSONALITY_STORAGE = 'storage'
PERSONALITY_UNKNOWN = 'unknown'
SUBFUNCTIONS_COMPUTE = 'compute'
SUBFUNCTIONS_WORKER = 'worker'
SUBFUNCTIONS_LOWLATENCY = 'lowlatency'
BM_TYPE_NULL = ''
@ -813,7 +813,7 @@ class Host(base.APIResourceWrapper):
PERSONALITY_DISPLAY_CHOICES = (
(PERSONALITY_CONTROLLER, _("Controller")),
(PERSONALITY_COMPUTE, _("Compute")),
(PERSONALITY_WORKER, _("Worker")),
(PERSONALITY_NETWORK, _("Network")),
(PERSONALITY_STORAGE, _("Storage")),
)
@ -906,7 +906,7 @@ class Host(base.APIResourceWrapper):
def is_cpe(self):
subfunctions = self._subfunctions.split(',')
if PERSONALITY_CONTROLLER in subfunctions and \
PERSONALITY_COMPUTE in subfunctions:
PERSONALITY_WORKER in subfunctions:
return True
else:
return False
@ -926,8 +926,8 @@ class Host(base.APIResourceWrapper):
self._subfunction_avail)
@property
def compute_config_required(self):
return self.config_status == 'Compute config required'
def worker_config_required(self):
return self.config_status == 'Worker config required'
@property
def location(self):

View File

@ -38,12 +38,12 @@ class Client(object):
def create_strategy(
self, strategy_name, controller_apply_type, storage_apply_type,
swift_apply_type, compute_apply_type, max_parallel_compute_hosts,
swift_apply_type, worker_apply_type, max_parallel_worker_hosts,
default_instance_action, alarm_restrictions):
return sw_update.create_strategy(
self.token_id, self.url, strategy_name, controller_apply_type,
storage_apply_type,
swift_apply_type, compute_apply_type, max_parallel_compute_hosts,
swift_apply_type, worker_apply_type, max_parallel_worker_hosts,
default_instance_action, alarm_restrictions)
def delete_strategy(self, strategy_name, force):
@ -72,11 +72,11 @@ def get_strategy(request, strategy_name):
def create_strategy(
request, strategy_name, controller_apply_type, storage_apply_type,
swift_apply_type, compute_apply_type, max_parallel_compute_hosts,
swift_apply_type, worker_apply_type, max_parallel_worker_hosts,
default_instance_action, alarm_restrictions):
strategy = _sw_update_client(request).create_strategy(
strategy_name, controller_apply_type, storage_apply_type,
swift_apply_type, compute_apply_type, max_parallel_compute_hosts,
swift_apply_type, worker_apply_type, max_parallel_worker_hosts,
default_instance_action, alarm_restrictions)
return strategy

View File

@ -152,8 +152,8 @@ svg#topology_canvas g.loading .host .icon_bg {
<div id="top_row">
<div id="lists_container">
<h4>Compute Hosts</h4>
<input id="host_list_search" class="form-control" type="text" placeholder="Search Compute Hosts" />
<h4>Worker Hosts</h4>
<input id="host_list_search" class="form-control" type="text" placeholder="Search Worker Hosts" />
<div id="host_list" class="list-group">
</div>
<h4>Provider Networks</h4>

View File

@ -145,7 +145,7 @@ class UpdateCpuFunctions(forms.SelfHandlingForm):
'platform_processor3'].help_text = \
"Processor 3 has %s physical cores." % avail_socket_cores
if 'compute' not in self.host.subfunctions:
if 'worker' not in self.host.subfunctions:
self.fields['vswitch'].widget = forms.widgets.HiddenInput()
self.fields[
'num_cores_on_processor0'].widget = forms.widgets.HiddenInput()
@ -214,7 +214,7 @@ class UpdateCpuFunctions(forms.SelfHandlingForm):
for s in range(0, 4):
processor = 'num_shared_on_processor{0}'.format(s)
if ('compute' not in self.host.subfunctions or
if ('worker' not in self.host.subfunctions or
kwargs['initial'][processor] == 99): # No Processor
self.fields[processor].widget = forms.widgets.HiddenInput()
else:

View File

@ -10,24 +10,24 @@ from django.utils.translation import ugettext_lazy as _
PLATFORM_CPU_TYPE = "Platform"
VSWITCH_CPU_TYPE = "Vswitch"
SHARED_CPU_TYPE = "Shared"
VMS_CPU_TYPE = "VMs"
APPLICATIONS_CPU_TYPE = "Applications"
NONE_CPU_TYPE = "None"
CPU_TYPE_LIST = [PLATFORM_CPU_TYPE, VSWITCH_CPU_TYPE,
SHARED_CPU_TYPE, VMS_CPU_TYPE,
SHARED_CPU_TYPE, APPLICATIONS_CPU_TYPE,
NONE_CPU_TYPE]
PLATFORM_CPU_TYPE_FORMAT = _("Platform")
VSWITCH_CPU_TYPE_FORMAT = _("vSwitch")
SHARED_CPU_TYPE_FORMAT = _("Shared")
VMS_CPU_TYPE_FORMAT = _("VMs")
APPLICATIONS_CPU_TYPE_FORMAT = _("Applications")
NONE_CPU_TYPE_FORMAT = _("None")
CPU_TYPE_FORMATS = {PLATFORM_CPU_TYPE: PLATFORM_CPU_TYPE_FORMAT,
VSWITCH_CPU_TYPE: VSWITCH_CPU_TYPE_FORMAT,
SHARED_CPU_TYPE: SHARED_CPU_TYPE_FORMAT,
VMS_CPU_TYPE: VMS_CPU_TYPE_FORMAT,
APPLICATIONS_CPU_TYPE: APPLICATIONS_CPU_TYPE_FORMAT,
NONE_CPU_TYPE: NONE_CPU_TYPE_FORMAT}
@ -81,7 +81,7 @@ class CpuProfile(object):
cur_processor.vswitch += 1
elif cpu.allocated_function == SHARED_CPU_TYPE:
cur_processor.shared += 1
elif cpu.allocated_function == VMS_CPU_TYPE:
elif cpu.allocated_function == APPLICATIONS_CPU_TYPE:
cur_processor.vms += 1
self.cores_per_cpu = len(cores)
@ -126,9 +126,9 @@ class HostCpuProfile(CpuProfile):
result = True
if platform_cores == 0:
result = False
elif 'compute' in self.personality and vswitch_cores == 0:
elif 'worker' in self.personality and vswitch_cores == 0:
result = False
elif 'compute' in self.personality and vm_cores == 0:
elif 'worker' in self.personality and vm_cores == 0:
result = False
return result
@ -199,7 +199,7 @@ def restructure_host_cpu_data(host):
else:
if (f == PLATFORM_CPU_TYPE or
(hasattr(host, 'subfunctions') and
'compute' in host.subfunctions)):
'worker' in host.subfunctions)):
if f != NONE_CPU_TYPE:
host.core_assignment.append(cpufunction)
for s in range(0, len(host.nodes)):
@ -220,7 +220,7 @@ def check_core_functions(personality, icpus):
vswitch_cores += 1
elif allocated_function == SHARED_CPU_TYPE:
shared_vcpu_cores += 1
elif allocated_function == VMS_CPU_TYPE:
elif allocated_function == APPLICATIONS_CPU_TYPE:
vm_cores += 1
# No limiations for shared_vcpu cores
@ -228,10 +228,10 @@ def check_core_functions(personality, icpus):
if platform_cores == 0:
error_string = "There must be at least one" \
" core for %s." % PLATFORM_CPU_TYPE_FORMAT
elif 'compute' in personality and vswitch_cores == 0:
elif 'worker' in personality and vswitch_cores == 0:
error_string = "There must be at least one" \
" core for %s." % VSWITCH_CPU_TYPE_FORMAT
elif 'compute' in personality and vm_cores == 0:
elif 'worker' in personality and vm_cores == 0:
error_string = "There must be at least one" \
" core for %s." % VMS_CPU_TYPE_FORMAT
" core for %s." % APPLICATIONS_CPU_TYPE_FORMAT
return error_string

View File

@ -32,7 +32,7 @@ class EditDevice(tables.LinkAction):
def allowed(self, request, datum):
host = self.table.kwargs['host']
return (host._administrative == 'locked' and
stx_api.sysinv.SUBFUNCTIONS_COMPUTE in host.subfunctions)
stx_api.sysinv.SUBFUNCTIONS_WORKER in host.subfunctions)
def get_viewdevice_link_url(device):

View File

@ -91,7 +91,7 @@ class CreateInterface(tables.LinkAction):
if i.ifclass:
count = count + 1
if host.subfunctions and 'compute' not in host.subfunctions and \
if host.subfunctions and 'worker' not in host.subfunctions and \
count >= len(INTERFACE_CLASS_TYPES):
return False

View File

@ -36,11 +36,11 @@ class UpdateMemory(forms.SelfHandlingForm):
required=False)
vm_hugepages_nr_2M = forms.CharField(
label=_("# of VM 2M Hugepages Node 0"),
label=_("# of Application 2M Hugepages Node 0"),
required=False)
vm_hugepages_nr_1G = forms.CharField(
label=_("# of VM 1G Hugepages Node 0"),
label=_("# of Application 1G Hugepages Node 0"),
required=False)
platform_memory_two = forms.CharField(
@ -48,11 +48,11 @@ class UpdateMemory(forms.SelfHandlingForm):
required=False)
vm_hugepages_nr_2M_two = forms.CharField(
label=_("# of VM 2M Hugepages Node 1"),
label=_("# of Application 2M Hugepages Node 1"),
required=False)
vm_hugepages_nr_1G_two = forms.CharField(
label=_("# of VM 1G Hugepages Node 1"),
label=_("# of Application 1G Hugepages Node 1"),
required=False)
platform_memory_three = forms.CharField(
@ -60,11 +60,11 @@ class UpdateMemory(forms.SelfHandlingForm):
required=False)
vm_hugepages_nr_2M_three = forms.CharField(
label=_("# of VM 2M Hugepages Node 2"),
label=_("# of Application 2M Hugepages Node 2"),
required=False)
vm_hugepages_nr_1G_three = forms.CharField(
label=_("# of VM 1G Hugepages Node 2"),
label=_("# of Application 1G Hugepages Node 2"),
required=False)
platform_memory_four = forms.CharField(
@ -72,11 +72,11 @@ class UpdateMemory(forms.SelfHandlingForm):
required=False)
vm_hugepages_nr_2M_four = forms.CharField(
label=_("# of VM 2M Hugepages Node 3"),
label=_("# of Application 2M Hugepages Node 3"),
required=False)
vm_hugepages_nr_1G_four = forms.CharField(
label=_("# of VM 1G Hugepages Node 3"),
label=_("# of Application 1G Hugepages Node 3"),
required=False)
failure_url = 'horizon:admin:inventory:detail'

View File

@ -31,7 +31,7 @@ class UpdateMemory(tables.LinkAction):
host = self.table.kwargs['host']
return (host._administrative == 'locked' and
host.subfunctions and
'compute' in host.subfunctions)
'worker' in host.subfunctions)
class CreateMemoryProfile(tables.LinkAction):
@ -77,7 +77,7 @@ class MemorysTable(tables.DataTable):
verbose_name=_('Memory'))
vm_huge = tables.Column(get_vm_hugepages,
verbose_name=_('VM Pages'))
verbose_name=_('Application Pages'))
def get_object_id(self, datum):
return str(datum.uuid)

View File

@ -408,7 +408,7 @@ class AddLocalVolumeGroup(forms.SelfHandlingForm):
stx_api.sysinv.PERSONALITY_CONTROLLER):
compatible_lvgs += [stx_api.sysinv.LVG_CINDER_VOLUMES]
if stx_api.sysinv.SUBFUNCTIONS_COMPUTE in subfunctions:
if stx_api.sysinv.SUBFUNCTIONS_WORKER in subfunctions:
compatible_lvgs += [stx_api.sysinv.LVG_NOVA_LOCAL]
allowed_lvgs = set(compatible_lvgs) - set(current_lvgs)
@ -542,7 +542,7 @@ class AddPhysicalVolume(forms.SelfHandlingForm):
compatible_lvgs += [stx_api.sysinv.LVG_CGTS_VG,
stx_api.sysinv.LVG_CINDER_VOLUMES]
if stx_api.sysinv.SUBFUNCTIONS_COMPUTE in subfunctions:
if stx_api.sysinv.SUBFUNCTIONS_WORKER in subfunctions:
compatible_lvgs += [stx_api.sysinv.LVG_NOVA_LOCAL]
avail_disk_list = stx_api.sysinv.host_disk_list(self.request,

View File

@ -378,8 +378,8 @@ class AddLocalVolumeGroup(tables.LinkAction):
self.classes = classes
if not host._administrative == 'locked':
if 'compute' in host._subfunctions and \
host.compute_config_required is False:
if 'worker' in host._subfunctions and \
host.worker_config_required is False:
if "disabled" not in self.classes:
self.classes = [c for c in self.classes] + ['disabled']
self.verbose_name = string_concat(self.verbose_name, ' ',
@ -396,7 +396,7 @@ class AddLocalVolumeGroup(tables.LinkAction):
if host._personality == 'controller':
compatible_lvgs += [sysinv.LVG_CINDER_VOLUMES]
if 'compute' in host._subfunctions:
if 'worker' in host._subfunctions:
compatible_lvgs += [sysinv.LVG_NOVA_LOCAL]
allowed_lvgs = set(compatible_lvgs) - set(current_lvgs)
@ -432,8 +432,8 @@ class RemoveLocalVolumeGroup(tables.DeleteAction):
if lvg.lvm_vg_name == sysinv.LVG_NOVA_LOCAL:
return ((host._administrative == 'locked') or
(('compute' in host._subfunctions) and
(host.compute_config_required is True)))
(('worker' in host._subfunctions) and
(host.worker_config_required is True)))
elif lvg.lvm_vg_name == sysinv.LVG_CINDER_VOLUMES:
return (sysinv.CINDER_BACKEND_LVM not in cinder_backend and
sysinv.LVG_ADD in lvg.vg_state)
@ -512,11 +512,11 @@ class AddPhysicalVolume(tables.LinkAction):
if host._personality == sysinv.PERSONALITY_CONTROLLER:
return True
# nova-local: Allow adding to any locked host with a compute
# nova-local: Allow adding to any locked host with a worker
# subfunction. On an AIO, the previous check superceeds this.
if host._administrative != 'locked':
if 'compute' in host._subfunctions and \
host.compute_config_required is False:
if 'worker' in host._subfunctions and \
host.worker_config_required is False:
if "disabled" not in self.classes:
self.classes = [c for c in self.classes] + ['disabled']
self.verbose_name = string_concat(self.verbose_name, ' ',
@ -555,8 +555,8 @@ class RemovePhysicalVolume(tables.DeleteAction):
if pv.lvm_vg_name == sysinv.LVG_NOVA_LOCAL:
return ((host._administrative == 'locked') or
(('compute' in host._subfunctions) and
(host.compute_config_required is True)))
(('worker' in host._subfunctions) and
(host.worker_config_required is True)))
elif pv.lvm_vg_name == sysinv.LVG_CINDER_VOLUMES:
return (sysinv.CINDER_BACKEND_LVM not in cinder_backend and
sysinv.PV_ADD in pv.pv_state)

View File

@ -231,10 +231,10 @@ class ForceLockHost(tables.BatchAction):
"unsuccessful and this host MUST be locked.\n\n"
"If you proceed, then this action will be logged"
" and cannot be undone.") % datum.hostname
elif datum._personality == stx_api.sysinv.PERSONALITY_COMPUTE:
elif datum._personality == stx_api.sysinv.PERSONALITY_WORKER:
return _(
"<b>WARNING</b>: This will cause a service OUTAGE"
" for all VMs currently using resources on '%s'.\n\n"
" for all Applications currently using resources on '%s'.\n\n"
"To avoid service outages, click 'Cancel' and use"
" 'Lock Host' to gracefully migrate "
"resources away from this host. "
@ -593,7 +593,7 @@ class HostsStorageFilterAction(tables.FilterAction):
return list(filter(comp, hosts))
class HostsComputeFilterAction(tables.FilterAction):
class HostsWorkerFilterAction(tables.FilterAction):
def filter(self, table, hosts, filter_string):
"""Naive case-insensitive search."""
q = filter_string.lower()
@ -687,7 +687,7 @@ TASK_STATE_CHOICES = (
("none", True),
("Install Failed", False),
("Config out-of-date", False),
("Compute config required", False),
("Worker config required", False),
("Reinstall required", False),
("Config out-of-date<br />Not Patch Current<br />Reboot Required",
False),
@ -789,10 +789,10 @@ class HostsStorage(Hosts):
hidden_title = False
class HostsCompute(Hosts):
class HostsWorker(Hosts):
class Meta(object):
name = "hostscompute"
verbose_name = _("Compute Hosts")
name = "hostsworker"
verbose_name = _("Worker Hosts")
status_columns = ["task"]
row_class = UpdateRow
multi_select = True
@ -802,7 +802,7 @@ class HostsCompute(Hosts):
PowerOnHost,
PowerOffHost, RebootHost,
ResetHost, ReinstallHost, PatchInstallAsync, DeleteHost)
table_actions = (HostsComputeFilterAction, LockHost,
table_actions = (HostsWorkerFilterAction, LockHost,
UnlockHost, PatchInstallAsync)
hidden_title = False

View File

@ -41,7 +41,7 @@ LOG = logging.getLogger(__name__)
class HostsTab(tabs.TableTab):
table_classes = (toplevel_tables.HostsController,
toplevel_tables.HostsStorage,
toplevel_tables.HostsCompute,
toplevel_tables.HostsWorker,
toplevel_tables.HostsUnProvisioned,)
name = _("Hosts")
slug = "hosts"
@ -111,10 +111,10 @@ class HostsTab(tabs.TableTab):
return storages
def get_hostscompute_data(self):
computes = self.get_hosts_data(stx_api.sysinv.PERSONALITY_COMPUTE)
def get_hostsworker_data(self):
workers = self.get_hosts_data(stx_api.sysinv.PERSONALITY_WORKER)
return computes
return workers
def get_hostsunprovisioned_data(self):
unprovisioned = self.get_hosts_data(stx_api.sysinv.PERSONALITY_UNKNOWN)
@ -134,12 +134,12 @@ class HostsTab(tabs.TableTab):
controllers = context['hostscontroller_table'].data
storages = context['hostsstorage_table'].data
computes = context['hostscompute_table'].data
workers = context['hostsworker_table'].data
unprovisioned = context['hostsunprovisioned_table'].data
context['controllers'] = controllers
context['storages'] = storages
context['computes'] = computes
context['workers'] = workers
context['unprovisioned'] = unprovisioned
totals = []
@ -163,7 +163,7 @@ class HostsTab(tabs.TableTab):
elif h._availability == 'failed':
fail_cnt += 1
for h in computes:
for h in workers:
comp_cnt += 1
if h._availability == 'degraded':
degr_cnt += 1
@ -183,7 +183,7 @@ class HostsTab(tabs.TableTab):
if (comp_cnt > 0):
badge = "badge-success"
totals.append(
{'name': "Compute", 'value': comp_cnt, 'badge': badge})
{'name': "Worker", 'value': comp_cnt, 'badge': badge})
if (degr_cnt > 0):
badge = "badge-warning"

View File

@ -25,9 +25,9 @@
{% endif %}
</div>
<div id="computes">
{% if computes %}
{{ hostscompute_table.render }}
<div id="workers">
{% if workers %}
{{ hostsworker_table.render }}
{% endif %}
</div>

View File

@ -52,8 +52,8 @@
});
horizon.refresh.addRefreshFunction(function (html) {
var $old_table = $('#computes');
var $new_table = $(html).find('#computes');
var $old_table = $('#workers');
var $new_table = $(html).find('#workers');
if (($old_table.children().length == 0 && $new_table.children().length> 0) ||
($old_table.children().length > 0 && $new_table.children().length == 0)) {
$old_table.replaceWith($new_table);

View File

@ -16,7 +16,7 @@
<tr>
<th>{% trans "Numa Node" %}</th>
<th>{% trans "Platform Reserved" %}</th>
<th>{% trans "VM Hugepages" %}</th>
<th>{% trans "Application Hugepages" %}</th>
</tr>
{% for node,m in host.numa_nodes %}
<tr>

View File

@ -14,7 +14,7 @@
</div>
<div class="right">
<h3>{% trans "Description" %}:</h3>
<p>{% trans "From here you can update the platform reserved memory and the number of Libvirt VM hugepages per numa node." %}</p>
<p>{% trans "From here you can update the platform reserved memory and the number of application hugepages per numa node." %}</p>
</div>
{% endblock %}

View File

@ -27,20 +27,20 @@ from starlingx_dashboard import api as stx_api
LOG = logging.getLogger(__name__)
PERSONALITY_CHOICES = (
(stx_api.sysinv.PERSONALITY_COMPUTE, _("Compute")),
(stx_api.sysinv.PERSONALITY_WORKER, _("Worker")),
(stx_api.sysinv.PERSONALITY_CONTROLLER, _("Controller")),
(stx_api.sysinv.PERSONALITY_STORAGE, _("Storage")),
)
FIELD_LABEL_PERFORMANCE_PROFILE = _("Performance Profile")
PERFORMANCE_CHOICES = (
(stx_api.sysinv.SUBFUNCTIONS_COMPUTE, _("Standard")),
(stx_api.sysinv.SUBFUNCTIONS_COMPUTE + ',' +
(stx_api.sysinv.SUBFUNCTIONS_WORKER, _("Standard")),
(stx_api.sysinv.SUBFUNCTIONS_WORKER + ',' +
stx_api.sysinv.SUBFUNCTIONS_LOWLATENCY, _("Low Latency")),
)
PERSONALITY_CHOICES_WITHOUT_STORAGE = (
(stx_api.sysinv.PERSONALITY_COMPUTE, _("Compute")),
(stx_api.sysinv.PERSONALITY_WORKER, _("Worker")),
(stx_api.sysinv.PERSONALITY_CONTROLLER, _("Controller")),
)
@ -58,11 +58,11 @@ def ifprofile_applicable(request, host, profile):
for interface in profile.interfaces:
interface_networks = stx_api.sysinv.\
interface_network_list_by_interface(request, interface.uuid)
if (stx_api.sysinv.PERSONALITY_COMPUTE == host._personality and
if (stx_api.sysinv.PERSONALITY_WORKER == host._personality and
any(interface_network.network_type == 'oam'
for interface_network in interface_networks)):
return False
if (stx_api.sysinv.PERSONALITY_COMPUTE not in host._subfunctions and
if (stx_api.sysinv.PERSONALITY_WORKER not in host._subfunctions and
interface.ifclass == 'data'):
return False
return True
@ -84,7 +84,7 @@ def diskprofile_applicable(host, diskprofile):
if not len(host.disks) >= len(diskprofile.disks):
return False
if stx_api.sysinv.PERSONALITY_COMPUTE in host._subfunctions:
if stx_api.sysinv.PERSONALITY_WORKER in host._subfunctions:
if diskprofile.lvgs:
for lvg in diskprofile.lvgs:
if (hasattr(lvg, 'lvm_vg_name') and
@ -109,7 +109,7 @@ def memoryprofile_applicable(host, personality, profile):
return False
if len(host.nodes) != len(profile.nodes):
return False
if 'compute' not in personality:
if 'worker' not in personality:
return False
return True
@ -149,7 +149,7 @@ class AddHostInfoAction(workflows.Action):
attrs={'class': 'switched',
'data-switch-on': 'personality',
'data-personality-' +
stx_api.sysinv.PERSONALITY_COMPUTE: _(
stx_api.sysinv.PERSONALITY_WORKER: _(
"Personality Sub-Type")}))
hostname = forms.RegexField(label=FIELD_LABEL_HOSTNAME,
@ -165,7 +165,7 @@ class AddHostInfoAction(workflows.Action):
attrs={'class': 'switched',
'data-switch-on': 'personality',
'data-personality-' +
stx_api.sysinv.PERSONALITY_COMPUTE:
stx_api.sysinv.PERSONALITY_WORKER:
FIELD_LABEL_HOSTNAME,
}))
@ -175,7 +175,7 @@ class AddHostInfoAction(workflows.Action):
attrs={'class': 'switched',
'data-switch-on': 'personality',
'data-personality-' +
stx_api.sysinv.PERSONALITY_COMPUTE: FIELD_LABEL_MGMT_MAC,
stx_api.sysinv.PERSONALITY_WORKER: FIELD_LABEL_MGMT_MAC,
'data-personality-' +
stx_api.sysinv.PERSONALITY_CONTROLLER: FIELD_LABEL_MGMT_MAC,
'data-personality-' +
@ -196,19 +196,19 @@ class AddHostInfoAction(workflows.Action):
self.fields['personality'].choices = \
PERSONALITY_CHOICES_WITHOUT_STORAGE
# All-in-one system, personality can be controller or compute.
# All-in-one system, personality can be controller or worker.
systems = stx_api.sysinv.system_list(request)
system_type = systems[0].to_dict().get('system_type')
if system_type == constants.TS_AIO:
self.fields['personality'].choices = \
PERSONALITY_CHOICES_WITHOUT_STORAGE
# Remove compute personality if in DC mode and region
# Remove worker personality if in DC mode and region
if getattr(self.request.user, 'services_region', None) == 'RegionOne' \
and getattr(settings, 'DC_MODE', False):
self.fields['personality'].choices = \
[choice for choice in self.fields['personality'].choices
if choice[0] != stx_api.sysinv.PERSONALITY_COMPUTE]
if choice[0] != stx_api.sysinv.PERSONALITY_WORKER]
def clean(self):
cleaned_data = super(AddHostInfoAction, self).clean()
@ -231,7 +231,7 @@ class UpdateHostInfoAction(workflows.Action):
attrs={'class': 'switched',
'data-switch-on': 'personality',
'data-personality-' +
stx_api.sysinv.PERSONALITY_COMPUTE: _(
stx_api.sysinv.PERSONALITY_WORKER: _(
"Performance Profile")}))
hostname = forms.RegexField(label=_("Host Name"),
@ -247,7 +247,7 @@ class UpdateHostInfoAction(workflows.Action):
attrs={'class': 'switched',
'data-switch-on': 'personality',
'data-personality-' +
stx_api.sysinv.PERSONALITY_COMPUTE:
stx_api.sysinv.PERSONALITY_WORKER:
_("Host Name")}))
location = forms.CharField(label=_("Location"),
@ -292,7 +292,7 @@ class UpdateHostInfoAction(workflows.Action):
self.fields['personality'].choices = \
PERSONALITY_CHOICES_WITHOUT_STORAGE
# All-in-one system, personality can only be controller or compute.
# All-in-one system, personality can only be controller or worker.
systems = stx_api.sysinv.system_list(request)
self.system_mode = systems[0].to_dict().get('system_mode')
self.system_type = systems[0].to_dict().get('system_type')
@ -300,12 +300,12 @@ class UpdateHostInfoAction(workflows.Action):
self.fields['personality'].choices = \
PERSONALITY_CHOICES_WITHOUT_STORAGE
# Remove compute personality if in DC mode and region
# Remove worker personality if in DC mode and region
if getattr(self.request.user, 'services_region', None) == 'RegionOne' \
and getattr(settings, 'DC_MODE', False):
self.fields['personality'].choices = \
[choice for choice in self.fields['personality'].choices
if choice[0] != stx_api.sysinv.PERSONALITY_COMPUTE]
if choice[0] != stx_api.sysinv.PERSONALITY_WORKER]
# hostname cannot be modified once it is set
if self.initial['hostname']:
@ -334,7 +334,7 @@ class UpdateHostInfoAction(workflows.Action):
host.ports = stx_api.sysinv.host_port_list(self.request, host.uuid)
host.disks = stx_api.sysinv.host_disk_list(self.request, host.uuid)
if 'compute' in host.subfunctions:
if 'worker' in host.subfunctions:
mem_profile_configurable = True
host.memory = stx_api.sysinv.host_memory_list(
self.request, host.uuid)
@ -393,7 +393,7 @@ class UpdateHostInfoAction(workflows.Action):
'interfaceProfile'].widget = forms.widgets.HiddenInput()
if ((personality == 'storage' or
'compute' in host._subfunctions) and host.disks):
'worker' in host._subfunctions) and host.disks):
# Populate Available Disk Profile Choices
try:
disk_profile_tuple_list = [
@ -470,7 +470,7 @@ class UpdateHostInfoAction(workflows.Action):
stx_api.sysinv.PERSONALITY_CONTROLLER:
if self.system_type == constants.TS_AIO:
self._subfunctions = (stx_api.sysinv.PERSONALITY_CONTROLLER +
',' + stx_api.sysinv.PERSONALITY_COMPUTE)
',' + stx_api.sysinv.PERSONALITY_WORKER)
else:
self._subfunctions = stx_api.sysinv.PERSONALITY_CONTROLLER
cleaned_data['subfunctions'] = self._subfunctions

View File

@ -48,7 +48,7 @@ class CreateProviderNetwork(forms.SelfHandlingForm):
max_value=9216,
help_text=(
_("Specifies the maximum MTU value of any associated tenant "
"network. Compute node data interface MTU values must be large "
"network. Worker node data interface MTU values must be large "
"enough to support the tenant MTU plus any additional provider "
"encapsulation headers. For example, VXLAN provider MTU of "
"1500 requires a minimum data interface MTU of 1574 bytes (1600 "

View File

@ -110,29 +110,29 @@ class CreatePatchStrategyForm(forms.SelfHandlingForm):
choices=GENERIC_APPLY_TYPES,
widget=forms.Select())
compute_apply_type = forms.ChoiceField(
label=_("Compute Apply Type"),
worker_apply_type = forms.ChoiceField(
label=_("Worker Apply Type"),
required=True,
choices=GENERIC_APPLY_TYPES,
widget=forms.Select(
attrs={
'class': 'switchable',
'data-slug': 'compute_apply_type'}))
'data-slug': 'worker_apply_type'}))
max_parallel_compute_hosts = forms.IntegerField(
label=_("Maximum Parallel Compute Hosts"),
max_parallel_worker_hosts = forms.IntegerField(
label=_("Maximum Parallel Worker Hosts"),
initial=2,
min_value=2,
max_value=100,
required=True,
error_messages={'invalid': _('Maximum Parallel Compute Hosts must be '
error_messages={'invalid': _('Maximum Parallel Worker Hosts must be '
'between 2 and 100.')},
widget=forms.TextInput(
attrs={
'class': 'switched',
'data-switch-on': 'compute_apply_type',
'data-compute_apply_type-parallel':
'Maximum Parallel Compute Hosts'}))
'data-switch-on': 'worker_apply_type',
'data-worker_apply_type-parallel':
'Maximum Parallel Worker Hosts'}))
default_instance_action = forms.ChoiceField(
label=_("Default Instance Action"),
@ -156,7 +156,7 @@ class CreatePatchStrategyForm(forms.SelfHandlingForm):
system_type = stx_api.sysinv.get_system_type(request)
if system_type == stx_api.sysinv.SYSTEM_TYPE_AIO:
del self.fields['controller_apply_type']
self.fields['compute_apply_type'].choices = self.AIO_APPLY_TYPES
self.fields['worker_apply_type'].choices = self.AIO_APPLY_TYPES
if stx_api.sysinv.is_system_mode_simplex(request):
self.fields['default_instance_action'].choices = \
@ -172,8 +172,8 @@ class CreatePatchStrategyForm(forms.SelfHandlingForm):
request, stx_api.vim.STRATEGY_SW_PATCH,
data.get('controller_apply_type', 'ignore'),
data.get('storage_apply_type', 'ignore'), 'ignore',
data['compute_apply_type'],
data['max_parallel_compute_hosts'],
data['worker_apply_type'],
data['max_parallel_worker_hosts'],
data['default_instance_action'],
data['alarm_restrictions'])
if not response:
@ -205,29 +205,29 @@ class CreateUpgradeStrategyForm(forms.SelfHandlingForm):
choices=GENERIC_APPLY_TYPES,
widget=forms.Select())
compute_apply_type = forms.ChoiceField(
label=_("Compute Apply Type"),
worker_apply_type = forms.ChoiceField(
label=_("Worker Apply Type"),
required=True,
choices=GENERIC_APPLY_TYPES,
widget=forms.Select(
attrs={
'class': 'switchable',
'data-slug': 'compute_apply_type'}))
'data-slug': 'worker_apply_type'}))
max_parallel_compute_hosts = forms.IntegerField(
label=_("Maximum Parallel Compute Hosts"),
max_parallel_worker_hosts = forms.IntegerField(
label=_("Maximum Parallel Worker Hosts"),
initial=2,
min_value=2,
max_value=10,
required=True,
error_messages={'invalid': _('Maximum Parallel Compute Hosts must be '
error_messages={'invalid': _('Maximum Parallel Worker Hosts must be '
'between 2 and 10.')},
widget=forms.TextInput(
attrs={
'class': 'switched',
'data-switch-on': 'compute_apply_type',
'data-compute_apply_type-parallel':
'Maximum Parallel Compute Hosts'}))
'data-switch-on': 'worker_apply_type',
'data-worker_apply_type-parallel':
'Maximum Parallel Worker Hosts'}))
alarm_restrictions = forms.ChoiceField(
label=_("Alarm Restrictions"),
@ -251,8 +251,8 @@ class CreateUpgradeStrategyForm(forms.SelfHandlingForm):
response = stx_api.vim.create_strategy(
request, stx_api.vim.STRATEGY_SW_UPGRADE, 'ignore',
data.get('storage_apply_type', 'ignore'), 'ignore',
data['compute_apply_type'],
data['max_parallel_compute_hosts'],
data['worker_apply_type'],
data['max_parallel_worker_hosts'],
'migrate',
data['alarm_restrictions'])
if not response:

View File

@ -13,11 +13,11 @@
<dd>{{ strategy.controller_apply_type }}</dd>
<dt>{% trans "Storage Apply Type" %}</dt>
<dd>{{ strategy.storage_apply_type }}</dd>
<dt>{% trans "Compute Apply Type" %}</dt>
<dd>{{ strategy.compute_apply_type }}</dd>
{% if strategy.compute_apply_type == "parallel" %}
<dt>{% trans "Maximum Parallel Compute Hosts" %}</dt>
<dd>{{ strategy.max_parallel_compute_hosts }}</dd>
<dt>{% trans "Worker Apply Type" %}</dt>
<dd>{{ strategy.worker_apply_type }}</dd>
{% if strategy.worker_apply_type == "parallel" %}
<dt>{% trans "Maximum Parallel Worker Hosts" %}</dt>
<dd>{{ strategy.max_parallel_worker_hosts }}</dd>
{% endif %}
<dt>{% trans "Default Instance Action" %}</dt>
<dd>{{ strategy.default_instance_action }}</dd>

View File

@ -11,11 +11,11 @@
<dl class="dl-horizontal-wide">
<dt>{% trans "Storage Apply Type" %}</dt>
<dd>{{ strategy.storage_apply_type }}</dd>
<dt>{% trans "Compute Apply Type" %}</dt>
<dd>{{ strategy.compute_apply_type }}</dd>
{% if strategy.compute_apply_type == "parallel" %}
<dt>{% trans "Maximum Parallel Compute Hosts" %}</dt>
<dd>{{ strategy.max_parallel_compute_hosts }}</dd>
<dt>{% trans "Worker Apply Type" %}</dt>
<dd>{{ strategy.worker_apply_type }}</dd>
{% if strategy.worker_apply_type == "parallel" %}
<dt>{% trans "Maximum Parallel Worker Hosts" %}</dt>
<dd>{{ strategy.max_parallel_worker_hosts }}</dd>
{% endif %}
<dt>{% trans "Alarm Restrictions" %}</dt>
<dd>{{ strategy.alarm_restrictions }}</dd>

View File

@ -106,29 +106,29 @@ class CreateCloudPatchConfigForm(forms.SelfHandlingForm):
choices=APPLY_TYPES,
widget=forms.Select())
compute_apply_type = forms.ChoiceField(
label=_("Compute Apply Type"),
worker_apply_type = forms.ChoiceField(
label=_("Worker Apply Type"),
required=True,
choices=APPLY_TYPES,
widget=forms.Select(
attrs={
'class': 'switchable',
'data-slug': 'compute_apply_type'}))
'data-slug': 'worker_apply_type'}))
max_parallel_computes = forms.IntegerField(
label=_("Maximum Parallel Compute Hosts"),
max_parallel_workers = forms.IntegerField(
label=_("Maximum Parallel Worker Hosts"),
initial=2,
min_value=2,
max_value=100,
required=True,
error_messages={'invalid': _('Maximum Parallel Compute Hosts must be '
error_messages={'invalid': _('Maximum Parallel Worker Hosts must be '
'between 2 and 100.')},
widget=forms.TextInput(
attrs={
'class': 'switched',
'data-switch-on': 'compute_apply_type',
'data-compute_apply_type-parallel':
'Maximum Parallel Compute Hosts'}))
'data-switch-on': 'worker_apply_type',
'data-worker_apply_type-parallel':
'Maximum Parallel Worker Hosts'}))
default_instance_action = forms.ChoiceField(
label=_("Default Instance Action"),

View File

@ -303,10 +303,10 @@ class CloudPatchConfigTable(tables.DataTable):
cloud = tables.Column('cloud', verbose_name=_('Cloud'))
storage_apply_type = tables.Column('storage_apply_type',
verbose_name=_('Storage Apply Type'))
compute_apply_type = tables.Column('compute_apply_type',
verbose_name=_('Compute Apply Type'))
max_parallel_computes = tables.Column(
'max_parallel_computes', verbose_name=_('Max Parallel Computes'))
worker_apply_type = tables.Column('worker_apply_type',
verbose_name=_('Worker Apply Type'))
max_parallel_workers = tables.Column(
'max_parallel_workers', verbose_name=_('Max Parallel Workers'))
default_instance_action = tables.Column(
'default_instance_action', verbose_name=_('Default Instance Action'))
alarm_restriction_type = tables.Column(

View File

@ -88,7 +88,7 @@ class EditCloudPatchConfigView(forms.ModalFormView):
return {'subcloud': config.cloud,
'storage_apply_type': config.storage_apply_type,
'compute_apply_type': config.compute_apply_type,
'max_parallel_computes': config.max_parallel_computes,
'worker_apply_type': config.worker_apply_type,
'max_parallel_workers': config.max_parallel_workers,
'default_instance_action': config.default_instance_action,
'alarm_restriction_type': config.alarm_restriction_type}

View File

@ -156,9 +156,9 @@ horizon.host_topology = {
return;
}
// Remove hosts without compute functionality
// Remove hosts without worker functionality
model.hosts = $.grep(model.hosts, function (host, i){
if (host.subfunctions && host.subfunctions.indexOf('compute') !== -1){
if (host.subfunctions && host.subfunctions.indexOf('worker') !== -1){
return true;
}
return false;