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:
parent
d9bd6001bb
commit
4da5b2a868
|
@ -132,8 +132,8 @@ def step_list(request):
|
||||||
|
|
||||||
|
|
||||||
class Config(base.APIResourceWrapper):
|
class Config(base.APIResourceWrapper):
|
||||||
_attrs = ['cloud', 'storage_apply_type', 'compute_apply_type',
|
_attrs = ['cloud', 'storage_apply_type', 'worker_apply_type',
|
||||||
'max_parallel_computes', 'alarm_restriction_type',
|
'max_parallel_workers', 'alarm_restriction_type',
|
||||||
'default_instance_action']
|
'default_instance_action']
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -34,12 +34,12 @@ SYSTEM_TYPE_STANDARD = constants.TIS_STD_BUILD
|
||||||
SYSTEM_TYPE_AIO = constants.TIS_AIO_BUILD
|
SYSTEM_TYPE_AIO = constants.TIS_AIO_BUILD
|
||||||
|
|
||||||
PERSONALITY_CONTROLLER = 'controller'
|
PERSONALITY_CONTROLLER = 'controller'
|
||||||
PERSONALITY_COMPUTE = 'compute'
|
PERSONALITY_WORKER = 'worker'
|
||||||
PERSONALITY_NETWORK = 'network'
|
PERSONALITY_NETWORK = 'network'
|
||||||
PERSONALITY_STORAGE = 'storage'
|
PERSONALITY_STORAGE = 'storage'
|
||||||
PERSONALITY_UNKNOWN = 'unknown'
|
PERSONALITY_UNKNOWN = 'unknown'
|
||||||
|
|
||||||
SUBFUNCTIONS_COMPUTE = 'compute'
|
SUBFUNCTIONS_WORKER = 'worker'
|
||||||
SUBFUNCTIONS_LOWLATENCY = 'lowlatency'
|
SUBFUNCTIONS_LOWLATENCY = 'lowlatency'
|
||||||
|
|
||||||
BM_TYPE_NULL = ''
|
BM_TYPE_NULL = ''
|
||||||
|
@ -813,7 +813,7 @@ class Host(base.APIResourceWrapper):
|
||||||
|
|
||||||
PERSONALITY_DISPLAY_CHOICES = (
|
PERSONALITY_DISPLAY_CHOICES = (
|
||||||
(PERSONALITY_CONTROLLER, _("Controller")),
|
(PERSONALITY_CONTROLLER, _("Controller")),
|
||||||
(PERSONALITY_COMPUTE, _("Compute")),
|
(PERSONALITY_WORKER, _("Worker")),
|
||||||
(PERSONALITY_NETWORK, _("Network")),
|
(PERSONALITY_NETWORK, _("Network")),
|
||||||
(PERSONALITY_STORAGE, _("Storage")),
|
(PERSONALITY_STORAGE, _("Storage")),
|
||||||
)
|
)
|
||||||
|
@ -906,7 +906,7 @@ class Host(base.APIResourceWrapper):
|
||||||
def is_cpe(self):
|
def is_cpe(self):
|
||||||
subfunctions = self._subfunctions.split(',')
|
subfunctions = self._subfunctions.split(',')
|
||||||
if PERSONALITY_CONTROLLER in subfunctions and \
|
if PERSONALITY_CONTROLLER in subfunctions and \
|
||||||
PERSONALITY_COMPUTE in subfunctions:
|
PERSONALITY_WORKER in subfunctions:
|
||||||
return True
|
return True
|
||||||
else:
|
else:
|
||||||
return False
|
return False
|
||||||
|
@ -926,8 +926,8 @@ class Host(base.APIResourceWrapper):
|
||||||
self._subfunction_avail)
|
self._subfunction_avail)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def compute_config_required(self):
|
def worker_config_required(self):
|
||||||
return self.config_status == 'Compute config required'
|
return self.config_status == 'Worker config required'
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def location(self):
|
def location(self):
|
||||||
|
|
|
@ -38,12 +38,12 @@ class Client(object):
|
||||||
|
|
||||||
def create_strategy(
|
def create_strategy(
|
||||||
self, strategy_name, controller_apply_type, storage_apply_type,
|
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):
|
default_instance_action, alarm_restrictions):
|
||||||
return sw_update.create_strategy(
|
return sw_update.create_strategy(
|
||||||
self.token_id, self.url, strategy_name, controller_apply_type,
|
self.token_id, self.url, strategy_name, controller_apply_type,
|
||||||
storage_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)
|
default_instance_action, alarm_restrictions)
|
||||||
|
|
||||||
def delete_strategy(self, strategy_name, force):
|
def delete_strategy(self, strategy_name, force):
|
||||||
|
@ -72,11 +72,11 @@ def get_strategy(request, strategy_name):
|
||||||
|
|
||||||
def create_strategy(
|
def create_strategy(
|
||||||
request, strategy_name, controller_apply_type, storage_apply_type,
|
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):
|
default_instance_action, alarm_restrictions):
|
||||||
strategy = _sw_update_client(request).create_strategy(
|
strategy = _sw_update_client(request).create_strategy(
|
||||||
strategy_name, controller_apply_type, storage_apply_type,
|
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)
|
default_instance_action, alarm_restrictions)
|
||||||
return strategy
|
return strategy
|
||||||
|
|
||||||
|
|
|
@ -152,8 +152,8 @@ svg#topology_canvas g.loading .host .icon_bg {
|
||||||
|
|
||||||
<div id="top_row">
|
<div id="top_row">
|
||||||
<div id="lists_container">
|
<div id="lists_container">
|
||||||
<h4>Compute Hosts</h4>
|
<h4>Worker Hosts</h4>
|
||||||
<input id="host_list_search" class="form-control" type="text" placeholder="Search Compute Hosts" />
|
<input id="host_list_search" class="form-control" type="text" placeholder="Search Worker Hosts" />
|
||||||
<div id="host_list" class="list-group">
|
<div id="host_list" class="list-group">
|
||||||
</div>
|
</div>
|
||||||
<h4>Provider Networks</h4>
|
<h4>Provider Networks</h4>
|
||||||
|
|
|
@ -145,7 +145,7 @@ class UpdateCpuFunctions(forms.SelfHandlingForm):
|
||||||
'platform_processor3'].help_text = \
|
'platform_processor3'].help_text = \
|
||||||
"Processor 3 has %s physical cores." % avail_socket_cores
|
"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['vswitch'].widget = forms.widgets.HiddenInput()
|
||||||
self.fields[
|
self.fields[
|
||||||
'num_cores_on_processor0'].widget = forms.widgets.HiddenInput()
|
'num_cores_on_processor0'].widget = forms.widgets.HiddenInput()
|
||||||
|
@ -214,7 +214,7 @@ class UpdateCpuFunctions(forms.SelfHandlingForm):
|
||||||
|
|
||||||
for s in range(0, 4):
|
for s in range(0, 4):
|
||||||
processor = 'num_shared_on_processor{0}'.format(s)
|
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
|
kwargs['initial'][processor] == 99): # No Processor
|
||||||
self.fields[processor].widget = forms.widgets.HiddenInput()
|
self.fields[processor].widget = forms.widgets.HiddenInput()
|
||||||
else:
|
else:
|
||||||
|
|
|
@ -10,24 +10,24 @@ from django.utils.translation import ugettext_lazy as _
|
||||||
PLATFORM_CPU_TYPE = "Platform"
|
PLATFORM_CPU_TYPE = "Platform"
|
||||||
VSWITCH_CPU_TYPE = "Vswitch"
|
VSWITCH_CPU_TYPE = "Vswitch"
|
||||||
SHARED_CPU_TYPE = "Shared"
|
SHARED_CPU_TYPE = "Shared"
|
||||||
VMS_CPU_TYPE = "VMs"
|
APPLICATIONS_CPU_TYPE = "Applications"
|
||||||
NONE_CPU_TYPE = "None"
|
NONE_CPU_TYPE = "None"
|
||||||
|
|
||||||
CPU_TYPE_LIST = [PLATFORM_CPU_TYPE, VSWITCH_CPU_TYPE,
|
CPU_TYPE_LIST = [PLATFORM_CPU_TYPE, VSWITCH_CPU_TYPE,
|
||||||
SHARED_CPU_TYPE, VMS_CPU_TYPE,
|
SHARED_CPU_TYPE, APPLICATIONS_CPU_TYPE,
|
||||||
NONE_CPU_TYPE]
|
NONE_CPU_TYPE]
|
||||||
|
|
||||||
|
|
||||||
PLATFORM_CPU_TYPE_FORMAT = _("Platform")
|
PLATFORM_CPU_TYPE_FORMAT = _("Platform")
|
||||||
VSWITCH_CPU_TYPE_FORMAT = _("vSwitch")
|
VSWITCH_CPU_TYPE_FORMAT = _("vSwitch")
|
||||||
SHARED_CPU_TYPE_FORMAT = _("Shared")
|
SHARED_CPU_TYPE_FORMAT = _("Shared")
|
||||||
VMS_CPU_TYPE_FORMAT = _("VMs")
|
APPLICATIONS_CPU_TYPE_FORMAT = _("Applications")
|
||||||
NONE_CPU_TYPE_FORMAT = _("None")
|
NONE_CPU_TYPE_FORMAT = _("None")
|
||||||
|
|
||||||
CPU_TYPE_FORMATS = {PLATFORM_CPU_TYPE: PLATFORM_CPU_TYPE_FORMAT,
|
CPU_TYPE_FORMATS = {PLATFORM_CPU_TYPE: PLATFORM_CPU_TYPE_FORMAT,
|
||||||
VSWITCH_CPU_TYPE: VSWITCH_CPU_TYPE_FORMAT,
|
VSWITCH_CPU_TYPE: VSWITCH_CPU_TYPE_FORMAT,
|
||||||
SHARED_CPU_TYPE: SHARED_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}
|
NONE_CPU_TYPE: NONE_CPU_TYPE_FORMAT}
|
||||||
|
|
||||||
|
|
||||||
|
@ -81,7 +81,7 @@ class CpuProfile(object):
|
||||||
cur_processor.vswitch += 1
|
cur_processor.vswitch += 1
|
||||||
elif cpu.allocated_function == SHARED_CPU_TYPE:
|
elif cpu.allocated_function == SHARED_CPU_TYPE:
|
||||||
cur_processor.shared += 1
|
cur_processor.shared += 1
|
||||||
elif cpu.allocated_function == VMS_CPU_TYPE:
|
elif cpu.allocated_function == APPLICATIONS_CPU_TYPE:
|
||||||
cur_processor.vms += 1
|
cur_processor.vms += 1
|
||||||
|
|
||||||
self.cores_per_cpu = len(cores)
|
self.cores_per_cpu = len(cores)
|
||||||
|
@ -126,9 +126,9 @@ class HostCpuProfile(CpuProfile):
|
||||||
result = True
|
result = True
|
||||||
if platform_cores == 0:
|
if platform_cores == 0:
|
||||||
result = False
|
result = False
|
||||||
elif 'compute' in self.personality and vswitch_cores == 0:
|
elif 'worker' in self.personality and vswitch_cores == 0:
|
||||||
result = False
|
result = False
|
||||||
elif 'compute' in self.personality and vm_cores == 0:
|
elif 'worker' in self.personality and vm_cores == 0:
|
||||||
result = False
|
result = False
|
||||||
return result
|
return result
|
||||||
|
|
||||||
|
@ -199,7 +199,7 @@ def restructure_host_cpu_data(host):
|
||||||
else:
|
else:
|
||||||
if (f == PLATFORM_CPU_TYPE or
|
if (f == PLATFORM_CPU_TYPE or
|
||||||
(hasattr(host, 'subfunctions') and
|
(hasattr(host, 'subfunctions') and
|
||||||
'compute' in host.subfunctions)):
|
'worker' in host.subfunctions)):
|
||||||
if f != NONE_CPU_TYPE:
|
if f != NONE_CPU_TYPE:
|
||||||
host.core_assignment.append(cpufunction)
|
host.core_assignment.append(cpufunction)
|
||||||
for s in range(0, len(host.nodes)):
|
for s in range(0, len(host.nodes)):
|
||||||
|
@ -220,7 +220,7 @@ def check_core_functions(personality, icpus):
|
||||||
vswitch_cores += 1
|
vswitch_cores += 1
|
||||||
elif allocated_function == SHARED_CPU_TYPE:
|
elif allocated_function == SHARED_CPU_TYPE:
|
||||||
shared_vcpu_cores += 1
|
shared_vcpu_cores += 1
|
||||||
elif allocated_function == VMS_CPU_TYPE:
|
elif allocated_function == APPLICATIONS_CPU_TYPE:
|
||||||
vm_cores += 1
|
vm_cores += 1
|
||||||
|
|
||||||
# No limiations for shared_vcpu cores
|
# No limiations for shared_vcpu cores
|
||||||
|
@ -228,10 +228,10 @@ def check_core_functions(personality, icpus):
|
||||||
if platform_cores == 0:
|
if platform_cores == 0:
|
||||||
error_string = "There must be at least one" \
|
error_string = "There must be at least one" \
|
||||||
" core for %s." % PLATFORM_CPU_TYPE_FORMAT
|
" 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" \
|
error_string = "There must be at least one" \
|
||||||
" core for %s." % VSWITCH_CPU_TYPE_FORMAT
|
" 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" \
|
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
|
return error_string
|
||||||
|
|
|
@ -32,7 +32,7 @@ class EditDevice(tables.LinkAction):
|
||||||
def allowed(self, request, datum):
|
def allowed(self, request, datum):
|
||||||
host = self.table.kwargs['host']
|
host = self.table.kwargs['host']
|
||||||
return (host._administrative == 'locked' and
|
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):
|
def get_viewdevice_link_url(device):
|
||||||
|
|
|
@ -91,7 +91,7 @@ class CreateInterface(tables.LinkAction):
|
||||||
if i.ifclass:
|
if i.ifclass:
|
||||||
count = count + 1
|
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):
|
count >= len(INTERFACE_CLASS_TYPES):
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
|
|
@ -36,11 +36,11 @@ class UpdateMemory(forms.SelfHandlingForm):
|
||||||
required=False)
|
required=False)
|
||||||
|
|
||||||
vm_hugepages_nr_2M = forms.CharField(
|
vm_hugepages_nr_2M = forms.CharField(
|
||||||
label=_("# of VM 2M Hugepages Node 0"),
|
label=_("# of Application 2M Hugepages Node 0"),
|
||||||
required=False)
|
required=False)
|
||||||
|
|
||||||
vm_hugepages_nr_1G = forms.CharField(
|
vm_hugepages_nr_1G = forms.CharField(
|
||||||
label=_("# of VM 1G Hugepages Node 0"),
|
label=_("# of Application 1G Hugepages Node 0"),
|
||||||
required=False)
|
required=False)
|
||||||
|
|
||||||
platform_memory_two = forms.CharField(
|
platform_memory_two = forms.CharField(
|
||||||
|
@ -48,11 +48,11 @@ class UpdateMemory(forms.SelfHandlingForm):
|
||||||
required=False)
|
required=False)
|
||||||
|
|
||||||
vm_hugepages_nr_2M_two = forms.CharField(
|
vm_hugepages_nr_2M_two = forms.CharField(
|
||||||
label=_("# of VM 2M Hugepages Node 1"),
|
label=_("# of Application 2M Hugepages Node 1"),
|
||||||
required=False)
|
required=False)
|
||||||
|
|
||||||
vm_hugepages_nr_1G_two = forms.CharField(
|
vm_hugepages_nr_1G_two = forms.CharField(
|
||||||
label=_("# of VM 1G Hugepages Node 1"),
|
label=_("# of Application 1G Hugepages Node 1"),
|
||||||
required=False)
|
required=False)
|
||||||
|
|
||||||
platform_memory_three = forms.CharField(
|
platform_memory_three = forms.CharField(
|
||||||
|
@ -60,11 +60,11 @@ class UpdateMemory(forms.SelfHandlingForm):
|
||||||
required=False)
|
required=False)
|
||||||
|
|
||||||
vm_hugepages_nr_2M_three = forms.CharField(
|
vm_hugepages_nr_2M_three = forms.CharField(
|
||||||
label=_("# of VM 2M Hugepages Node 2"),
|
label=_("# of Application 2M Hugepages Node 2"),
|
||||||
required=False)
|
required=False)
|
||||||
|
|
||||||
vm_hugepages_nr_1G_three = forms.CharField(
|
vm_hugepages_nr_1G_three = forms.CharField(
|
||||||
label=_("# of VM 1G Hugepages Node 2"),
|
label=_("# of Application 1G Hugepages Node 2"),
|
||||||
required=False)
|
required=False)
|
||||||
|
|
||||||
platform_memory_four = forms.CharField(
|
platform_memory_four = forms.CharField(
|
||||||
|
@ -72,11 +72,11 @@ class UpdateMemory(forms.SelfHandlingForm):
|
||||||
required=False)
|
required=False)
|
||||||
|
|
||||||
vm_hugepages_nr_2M_four = forms.CharField(
|
vm_hugepages_nr_2M_four = forms.CharField(
|
||||||
label=_("# of VM 2M Hugepages Node 3"),
|
label=_("# of Application 2M Hugepages Node 3"),
|
||||||
required=False)
|
required=False)
|
||||||
|
|
||||||
vm_hugepages_nr_1G_four = forms.CharField(
|
vm_hugepages_nr_1G_four = forms.CharField(
|
||||||
label=_("# of VM 1G Hugepages Node 3"),
|
label=_("# of Application 1G Hugepages Node 3"),
|
||||||
required=False)
|
required=False)
|
||||||
|
|
||||||
failure_url = 'horizon:admin:inventory:detail'
|
failure_url = 'horizon:admin:inventory:detail'
|
||||||
|
|
|
@ -31,7 +31,7 @@ class UpdateMemory(tables.LinkAction):
|
||||||
host = self.table.kwargs['host']
|
host = self.table.kwargs['host']
|
||||||
return (host._administrative == 'locked' and
|
return (host._administrative == 'locked' and
|
||||||
host.subfunctions and
|
host.subfunctions and
|
||||||
'compute' in host.subfunctions)
|
'worker' in host.subfunctions)
|
||||||
|
|
||||||
|
|
||||||
class CreateMemoryProfile(tables.LinkAction):
|
class CreateMemoryProfile(tables.LinkAction):
|
||||||
|
@ -77,7 +77,7 @@ class MemorysTable(tables.DataTable):
|
||||||
verbose_name=_('Memory'))
|
verbose_name=_('Memory'))
|
||||||
|
|
||||||
vm_huge = tables.Column(get_vm_hugepages,
|
vm_huge = tables.Column(get_vm_hugepages,
|
||||||
verbose_name=_('VM Pages'))
|
verbose_name=_('Application Pages'))
|
||||||
|
|
||||||
def get_object_id(self, datum):
|
def get_object_id(self, datum):
|
||||||
return str(datum.uuid)
|
return str(datum.uuid)
|
||||||
|
|
|
@ -408,7 +408,7 @@ class AddLocalVolumeGroup(forms.SelfHandlingForm):
|
||||||
stx_api.sysinv.PERSONALITY_CONTROLLER):
|
stx_api.sysinv.PERSONALITY_CONTROLLER):
|
||||||
compatible_lvgs += [stx_api.sysinv.LVG_CINDER_VOLUMES]
|
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]
|
compatible_lvgs += [stx_api.sysinv.LVG_NOVA_LOCAL]
|
||||||
|
|
||||||
allowed_lvgs = set(compatible_lvgs) - set(current_lvgs)
|
allowed_lvgs = set(compatible_lvgs) - set(current_lvgs)
|
||||||
|
@ -542,7 +542,7 @@ class AddPhysicalVolume(forms.SelfHandlingForm):
|
||||||
compatible_lvgs += [stx_api.sysinv.LVG_CGTS_VG,
|
compatible_lvgs += [stx_api.sysinv.LVG_CGTS_VG,
|
||||||
stx_api.sysinv.LVG_CINDER_VOLUMES]
|
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]
|
compatible_lvgs += [stx_api.sysinv.LVG_NOVA_LOCAL]
|
||||||
|
|
||||||
avail_disk_list = stx_api.sysinv.host_disk_list(self.request,
|
avail_disk_list = stx_api.sysinv.host_disk_list(self.request,
|
||||||
|
|
|
@ -378,8 +378,8 @@ class AddLocalVolumeGroup(tables.LinkAction):
|
||||||
self.classes = classes
|
self.classes = classes
|
||||||
|
|
||||||
if not host._administrative == 'locked':
|
if not host._administrative == 'locked':
|
||||||
if 'compute' in host._subfunctions and \
|
if 'worker' in host._subfunctions and \
|
||||||
host.compute_config_required is False:
|
host.worker_config_required is False:
|
||||||
if "disabled" not in self.classes:
|
if "disabled" not in self.classes:
|
||||||
self.classes = [c for c in self.classes] + ['disabled']
|
self.classes = [c for c in self.classes] + ['disabled']
|
||||||
self.verbose_name = string_concat(self.verbose_name, ' ',
|
self.verbose_name = string_concat(self.verbose_name, ' ',
|
||||||
|
@ -396,7 +396,7 @@ class AddLocalVolumeGroup(tables.LinkAction):
|
||||||
if host._personality == 'controller':
|
if host._personality == 'controller':
|
||||||
compatible_lvgs += [sysinv.LVG_CINDER_VOLUMES]
|
compatible_lvgs += [sysinv.LVG_CINDER_VOLUMES]
|
||||||
|
|
||||||
if 'compute' in host._subfunctions:
|
if 'worker' in host._subfunctions:
|
||||||
compatible_lvgs += [sysinv.LVG_NOVA_LOCAL]
|
compatible_lvgs += [sysinv.LVG_NOVA_LOCAL]
|
||||||
|
|
||||||
allowed_lvgs = set(compatible_lvgs) - set(current_lvgs)
|
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:
|
if lvg.lvm_vg_name == sysinv.LVG_NOVA_LOCAL:
|
||||||
return ((host._administrative == 'locked') or
|
return ((host._administrative == 'locked') or
|
||||||
(('compute' in host._subfunctions) and
|
(('worker' in host._subfunctions) and
|
||||||
(host.compute_config_required is True)))
|
(host.worker_config_required is True)))
|
||||||
elif lvg.lvm_vg_name == sysinv.LVG_CINDER_VOLUMES:
|
elif lvg.lvm_vg_name == sysinv.LVG_CINDER_VOLUMES:
|
||||||
return (sysinv.CINDER_BACKEND_LVM not in cinder_backend and
|
return (sysinv.CINDER_BACKEND_LVM not in cinder_backend and
|
||||||
sysinv.LVG_ADD in lvg.vg_state)
|
sysinv.LVG_ADD in lvg.vg_state)
|
||||||
|
@ -512,11 +512,11 @@ class AddPhysicalVolume(tables.LinkAction):
|
||||||
if host._personality == sysinv.PERSONALITY_CONTROLLER:
|
if host._personality == sysinv.PERSONALITY_CONTROLLER:
|
||||||
return True
|
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.
|
# subfunction. On an AIO, the previous check superceeds this.
|
||||||
if host._administrative != 'locked':
|
if host._administrative != 'locked':
|
||||||
if 'compute' in host._subfunctions and \
|
if 'worker' in host._subfunctions and \
|
||||||
host.compute_config_required is False:
|
host.worker_config_required is False:
|
||||||
if "disabled" not in self.classes:
|
if "disabled" not in self.classes:
|
||||||
self.classes = [c for c in self.classes] + ['disabled']
|
self.classes = [c for c in self.classes] + ['disabled']
|
||||||
self.verbose_name = string_concat(self.verbose_name, ' ',
|
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:
|
if pv.lvm_vg_name == sysinv.LVG_NOVA_LOCAL:
|
||||||
return ((host._administrative == 'locked') or
|
return ((host._administrative == 'locked') or
|
||||||
(('compute' in host._subfunctions) and
|
(('worker' in host._subfunctions) and
|
||||||
(host.compute_config_required is True)))
|
(host.worker_config_required is True)))
|
||||||
elif pv.lvm_vg_name == sysinv.LVG_CINDER_VOLUMES:
|
elif pv.lvm_vg_name == sysinv.LVG_CINDER_VOLUMES:
|
||||||
return (sysinv.CINDER_BACKEND_LVM not in cinder_backend and
|
return (sysinv.CINDER_BACKEND_LVM not in cinder_backend and
|
||||||
sysinv.PV_ADD in pv.pv_state)
|
sysinv.PV_ADD in pv.pv_state)
|
||||||
|
|
|
@ -231,10 +231,10 @@ class ForceLockHost(tables.BatchAction):
|
||||||
"unsuccessful and this host MUST be locked.\n\n"
|
"unsuccessful and this host MUST be locked.\n\n"
|
||||||
"If you proceed, then this action will be logged"
|
"If you proceed, then this action will be logged"
|
||||||
" and cannot be undone.") % datum.hostname
|
" and cannot be undone.") % datum.hostname
|
||||||
elif datum._personality == stx_api.sysinv.PERSONALITY_COMPUTE:
|
elif datum._personality == stx_api.sysinv.PERSONALITY_WORKER:
|
||||||
return _(
|
return _(
|
||||||
"<b>WARNING</b>: This will cause a service OUTAGE"
|
"<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"
|
"To avoid service outages, click 'Cancel' and use"
|
||||||
" 'Lock Host' to gracefully migrate "
|
" 'Lock Host' to gracefully migrate "
|
||||||
"resources away from this host. "
|
"resources away from this host. "
|
||||||
|
@ -593,7 +593,7 @@ class HostsStorageFilterAction(tables.FilterAction):
|
||||||
return list(filter(comp, hosts))
|
return list(filter(comp, hosts))
|
||||||
|
|
||||||
|
|
||||||
class HostsComputeFilterAction(tables.FilterAction):
|
class HostsWorkerFilterAction(tables.FilterAction):
|
||||||
def filter(self, table, hosts, filter_string):
|
def filter(self, table, hosts, filter_string):
|
||||||
"""Naive case-insensitive search."""
|
"""Naive case-insensitive search."""
|
||||||
q = filter_string.lower()
|
q = filter_string.lower()
|
||||||
|
@ -687,7 +687,7 @@ TASK_STATE_CHOICES = (
|
||||||
("none", True),
|
("none", True),
|
||||||
("Install Failed", False),
|
("Install Failed", False),
|
||||||
("Config out-of-date", False),
|
("Config out-of-date", False),
|
||||||
("Compute config required", False),
|
("Worker config required", False),
|
||||||
("Reinstall required", False),
|
("Reinstall required", False),
|
||||||
("Config out-of-date<br />Not Patch Current<br />Reboot Required",
|
("Config out-of-date<br />Not Patch Current<br />Reboot Required",
|
||||||
False),
|
False),
|
||||||
|
@ -789,10 +789,10 @@ class HostsStorage(Hosts):
|
||||||
hidden_title = False
|
hidden_title = False
|
||||||
|
|
||||||
|
|
||||||
class HostsCompute(Hosts):
|
class HostsWorker(Hosts):
|
||||||
class Meta(object):
|
class Meta(object):
|
||||||
name = "hostscompute"
|
name = "hostsworker"
|
||||||
verbose_name = _("Compute Hosts")
|
verbose_name = _("Worker Hosts")
|
||||||
status_columns = ["task"]
|
status_columns = ["task"]
|
||||||
row_class = UpdateRow
|
row_class = UpdateRow
|
||||||
multi_select = True
|
multi_select = True
|
||||||
|
@ -802,7 +802,7 @@ class HostsCompute(Hosts):
|
||||||
PowerOnHost,
|
PowerOnHost,
|
||||||
PowerOffHost, RebootHost,
|
PowerOffHost, RebootHost,
|
||||||
ResetHost, ReinstallHost, PatchInstallAsync, DeleteHost)
|
ResetHost, ReinstallHost, PatchInstallAsync, DeleteHost)
|
||||||
table_actions = (HostsComputeFilterAction, LockHost,
|
table_actions = (HostsWorkerFilterAction, LockHost,
|
||||||
UnlockHost, PatchInstallAsync)
|
UnlockHost, PatchInstallAsync)
|
||||||
hidden_title = False
|
hidden_title = False
|
||||||
|
|
||||||
|
|
|
@ -41,7 +41,7 @@ LOG = logging.getLogger(__name__)
|
||||||
class HostsTab(tabs.TableTab):
|
class HostsTab(tabs.TableTab):
|
||||||
table_classes = (toplevel_tables.HostsController,
|
table_classes = (toplevel_tables.HostsController,
|
||||||
toplevel_tables.HostsStorage,
|
toplevel_tables.HostsStorage,
|
||||||
toplevel_tables.HostsCompute,
|
toplevel_tables.HostsWorker,
|
||||||
toplevel_tables.HostsUnProvisioned,)
|
toplevel_tables.HostsUnProvisioned,)
|
||||||
name = _("Hosts")
|
name = _("Hosts")
|
||||||
slug = "hosts"
|
slug = "hosts"
|
||||||
|
@ -111,10 +111,10 @@ class HostsTab(tabs.TableTab):
|
||||||
|
|
||||||
return storages
|
return storages
|
||||||
|
|
||||||
def get_hostscompute_data(self):
|
def get_hostsworker_data(self):
|
||||||
computes = self.get_hosts_data(stx_api.sysinv.PERSONALITY_COMPUTE)
|
workers = self.get_hosts_data(stx_api.sysinv.PERSONALITY_WORKER)
|
||||||
|
|
||||||
return computes
|
return workers
|
||||||
|
|
||||||
def get_hostsunprovisioned_data(self):
|
def get_hostsunprovisioned_data(self):
|
||||||
unprovisioned = self.get_hosts_data(stx_api.sysinv.PERSONALITY_UNKNOWN)
|
unprovisioned = self.get_hosts_data(stx_api.sysinv.PERSONALITY_UNKNOWN)
|
||||||
|
@ -134,12 +134,12 @@ class HostsTab(tabs.TableTab):
|
||||||
|
|
||||||
controllers = context['hostscontroller_table'].data
|
controllers = context['hostscontroller_table'].data
|
||||||
storages = context['hostsstorage_table'].data
|
storages = context['hostsstorage_table'].data
|
||||||
computes = context['hostscompute_table'].data
|
workers = context['hostsworker_table'].data
|
||||||
unprovisioned = context['hostsunprovisioned_table'].data
|
unprovisioned = context['hostsunprovisioned_table'].data
|
||||||
|
|
||||||
context['controllers'] = controllers
|
context['controllers'] = controllers
|
||||||
context['storages'] = storages
|
context['storages'] = storages
|
||||||
context['computes'] = computes
|
context['workers'] = workers
|
||||||
context['unprovisioned'] = unprovisioned
|
context['unprovisioned'] = unprovisioned
|
||||||
|
|
||||||
totals = []
|
totals = []
|
||||||
|
@ -163,7 +163,7 @@ class HostsTab(tabs.TableTab):
|
||||||
elif h._availability == 'failed':
|
elif h._availability == 'failed':
|
||||||
fail_cnt += 1
|
fail_cnt += 1
|
||||||
|
|
||||||
for h in computes:
|
for h in workers:
|
||||||
comp_cnt += 1
|
comp_cnt += 1
|
||||||
if h._availability == 'degraded':
|
if h._availability == 'degraded':
|
||||||
degr_cnt += 1
|
degr_cnt += 1
|
||||||
|
@ -183,7 +183,7 @@ class HostsTab(tabs.TableTab):
|
||||||
if (comp_cnt > 0):
|
if (comp_cnt > 0):
|
||||||
badge = "badge-success"
|
badge = "badge-success"
|
||||||
totals.append(
|
totals.append(
|
||||||
{'name': "Compute", 'value': comp_cnt, 'badge': badge})
|
{'name': "Worker", 'value': comp_cnt, 'badge': badge})
|
||||||
|
|
||||||
if (degr_cnt > 0):
|
if (degr_cnt > 0):
|
||||||
badge = "badge-warning"
|
badge = "badge-warning"
|
||||||
|
|
|
@ -25,9 +25,9 @@
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="computes">
|
<div id="workers">
|
||||||
{% if computes %}
|
{% if workers %}
|
||||||
{{ hostscompute_table.render }}
|
{{ hostsworker_table.render }}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
@ -52,8 +52,8 @@
|
||||||
});
|
});
|
||||||
|
|
||||||
horizon.refresh.addRefreshFunction(function (html) {
|
horizon.refresh.addRefreshFunction(function (html) {
|
||||||
var $old_table = $('#computes');
|
var $old_table = $('#workers');
|
||||||
var $new_table = $(html).find('#computes');
|
var $new_table = $(html).find('#workers');
|
||||||
if (($old_table.children().length == 0 && $new_table.children().length> 0) ||
|
if (($old_table.children().length == 0 && $new_table.children().length> 0) ||
|
||||||
($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);
|
$old_table.replaceWith($new_table);
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
<tr>
|
<tr>
|
||||||
<th>{% trans "Numa Node" %}</th>
|
<th>{% trans "Numa Node" %}</th>
|
||||||
<th>{% trans "Platform Reserved" %}</th>
|
<th>{% trans "Platform Reserved" %}</th>
|
||||||
<th>{% trans "VM Hugepages" %}</th>
|
<th>{% trans "Application Hugepages" %}</th>
|
||||||
</tr>
|
</tr>
|
||||||
{% for node,m in host.numa_nodes %}
|
{% for node,m in host.numa_nodes %}
|
||||||
<tr>
|
<tr>
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="right">
|
<div class="right">
|
||||||
<h3>{% trans "Description" %}:</h3>
|
<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>
|
</div>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
|
|
|
@ -27,20 +27,20 @@ from starlingx_dashboard import api as stx_api
|
||||||
LOG = logging.getLogger(__name__)
|
LOG = logging.getLogger(__name__)
|
||||||
|
|
||||||
PERSONALITY_CHOICES = (
|
PERSONALITY_CHOICES = (
|
||||||
(stx_api.sysinv.PERSONALITY_COMPUTE, _("Compute")),
|
(stx_api.sysinv.PERSONALITY_WORKER, _("Worker")),
|
||||||
(stx_api.sysinv.PERSONALITY_CONTROLLER, _("Controller")),
|
(stx_api.sysinv.PERSONALITY_CONTROLLER, _("Controller")),
|
||||||
(stx_api.sysinv.PERSONALITY_STORAGE, _("Storage")),
|
(stx_api.sysinv.PERSONALITY_STORAGE, _("Storage")),
|
||||||
)
|
)
|
||||||
|
|
||||||
FIELD_LABEL_PERFORMANCE_PROFILE = _("Performance Profile")
|
FIELD_LABEL_PERFORMANCE_PROFILE = _("Performance Profile")
|
||||||
PERFORMANCE_CHOICES = (
|
PERFORMANCE_CHOICES = (
|
||||||
(stx_api.sysinv.SUBFUNCTIONS_COMPUTE, _("Standard")),
|
(stx_api.sysinv.SUBFUNCTIONS_WORKER, _("Standard")),
|
||||||
(stx_api.sysinv.SUBFUNCTIONS_COMPUTE + ',' +
|
(stx_api.sysinv.SUBFUNCTIONS_WORKER + ',' +
|
||||||
stx_api.sysinv.SUBFUNCTIONS_LOWLATENCY, _("Low Latency")),
|
stx_api.sysinv.SUBFUNCTIONS_LOWLATENCY, _("Low Latency")),
|
||||||
)
|
)
|
||||||
|
|
||||||
PERSONALITY_CHOICES_WITHOUT_STORAGE = (
|
PERSONALITY_CHOICES_WITHOUT_STORAGE = (
|
||||||
(stx_api.sysinv.PERSONALITY_COMPUTE, _("Compute")),
|
(stx_api.sysinv.PERSONALITY_WORKER, _("Worker")),
|
||||||
(stx_api.sysinv.PERSONALITY_CONTROLLER, _("Controller")),
|
(stx_api.sysinv.PERSONALITY_CONTROLLER, _("Controller")),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -58,11 +58,11 @@ def ifprofile_applicable(request, host, profile):
|
||||||
for interface in profile.interfaces:
|
for interface in profile.interfaces:
|
||||||
interface_networks = stx_api.sysinv.\
|
interface_networks = stx_api.sysinv.\
|
||||||
interface_network_list_by_interface(request, interface.uuid)
|
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'
|
any(interface_network.network_type == 'oam'
|
||||||
for interface_network in interface_networks)):
|
for interface_network in interface_networks)):
|
||||||
return False
|
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'):
|
interface.ifclass == 'data'):
|
||||||
return False
|
return False
|
||||||
return True
|
return True
|
||||||
|
@ -84,7 +84,7 @@ def diskprofile_applicable(host, diskprofile):
|
||||||
if not len(host.disks) >= len(diskprofile.disks):
|
if not len(host.disks) >= len(diskprofile.disks):
|
||||||
return False
|
return False
|
||||||
|
|
||||||
if stx_api.sysinv.PERSONALITY_COMPUTE in host._subfunctions:
|
if stx_api.sysinv.PERSONALITY_WORKER in host._subfunctions:
|
||||||
if diskprofile.lvgs:
|
if diskprofile.lvgs:
|
||||||
for lvg in diskprofile.lvgs:
|
for lvg in diskprofile.lvgs:
|
||||||
if (hasattr(lvg, 'lvm_vg_name') and
|
if (hasattr(lvg, 'lvm_vg_name') and
|
||||||
|
@ -109,7 +109,7 @@ def memoryprofile_applicable(host, personality, profile):
|
||||||
return False
|
return False
|
||||||
if len(host.nodes) != len(profile.nodes):
|
if len(host.nodes) != len(profile.nodes):
|
||||||
return False
|
return False
|
||||||
if 'compute' not in personality:
|
if 'worker' not in personality:
|
||||||
return False
|
return False
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
@ -149,7 +149,7 @@ class AddHostInfoAction(workflows.Action):
|
||||||
attrs={'class': 'switched',
|
attrs={'class': 'switched',
|
||||||
'data-switch-on': 'personality',
|
'data-switch-on': 'personality',
|
||||||
'data-personality-' +
|
'data-personality-' +
|
||||||
stx_api.sysinv.PERSONALITY_COMPUTE: _(
|
stx_api.sysinv.PERSONALITY_WORKER: _(
|
||||||
"Personality Sub-Type")}))
|
"Personality Sub-Type")}))
|
||||||
|
|
||||||
hostname = forms.RegexField(label=FIELD_LABEL_HOSTNAME,
|
hostname = forms.RegexField(label=FIELD_LABEL_HOSTNAME,
|
||||||
|
@ -165,7 +165,7 @@ class AddHostInfoAction(workflows.Action):
|
||||||
attrs={'class': 'switched',
|
attrs={'class': 'switched',
|
||||||
'data-switch-on': 'personality',
|
'data-switch-on': 'personality',
|
||||||
'data-personality-' +
|
'data-personality-' +
|
||||||
stx_api.sysinv.PERSONALITY_COMPUTE:
|
stx_api.sysinv.PERSONALITY_WORKER:
|
||||||
FIELD_LABEL_HOSTNAME,
|
FIELD_LABEL_HOSTNAME,
|
||||||
}))
|
}))
|
||||||
|
|
||||||
|
@ -175,7 +175,7 @@ class AddHostInfoAction(workflows.Action):
|
||||||
attrs={'class': 'switched',
|
attrs={'class': 'switched',
|
||||||
'data-switch-on': 'personality',
|
'data-switch-on': 'personality',
|
||||||
'data-personality-' +
|
'data-personality-' +
|
||||||
stx_api.sysinv.PERSONALITY_COMPUTE: FIELD_LABEL_MGMT_MAC,
|
stx_api.sysinv.PERSONALITY_WORKER: FIELD_LABEL_MGMT_MAC,
|
||||||
'data-personality-' +
|
'data-personality-' +
|
||||||
stx_api.sysinv.PERSONALITY_CONTROLLER: FIELD_LABEL_MGMT_MAC,
|
stx_api.sysinv.PERSONALITY_CONTROLLER: FIELD_LABEL_MGMT_MAC,
|
||||||
'data-personality-' +
|
'data-personality-' +
|
||||||
|
@ -196,19 +196,19 @@ class AddHostInfoAction(workflows.Action):
|
||||||
self.fields['personality'].choices = \
|
self.fields['personality'].choices = \
|
||||||
PERSONALITY_CHOICES_WITHOUT_STORAGE
|
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)
|
systems = stx_api.sysinv.system_list(request)
|
||||||
system_type = systems[0].to_dict().get('system_type')
|
system_type = systems[0].to_dict().get('system_type')
|
||||||
if system_type == constants.TS_AIO:
|
if system_type == constants.TS_AIO:
|
||||||
self.fields['personality'].choices = \
|
self.fields['personality'].choices = \
|
||||||
PERSONALITY_CHOICES_WITHOUT_STORAGE
|
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' \
|
if getattr(self.request.user, 'services_region', None) == 'RegionOne' \
|
||||||
and getattr(settings, 'DC_MODE', False):
|
and getattr(settings, 'DC_MODE', False):
|
||||||
self.fields['personality'].choices = \
|
self.fields['personality'].choices = \
|
||||||
[choice for choice in 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):
|
def clean(self):
|
||||||
cleaned_data = super(AddHostInfoAction, self).clean()
|
cleaned_data = super(AddHostInfoAction, self).clean()
|
||||||
|
@ -231,7 +231,7 @@ class UpdateHostInfoAction(workflows.Action):
|
||||||
attrs={'class': 'switched',
|
attrs={'class': 'switched',
|
||||||
'data-switch-on': 'personality',
|
'data-switch-on': 'personality',
|
||||||
'data-personality-' +
|
'data-personality-' +
|
||||||
stx_api.sysinv.PERSONALITY_COMPUTE: _(
|
stx_api.sysinv.PERSONALITY_WORKER: _(
|
||||||
"Performance Profile")}))
|
"Performance Profile")}))
|
||||||
|
|
||||||
hostname = forms.RegexField(label=_("Host Name"),
|
hostname = forms.RegexField(label=_("Host Name"),
|
||||||
|
@ -247,7 +247,7 @@ class UpdateHostInfoAction(workflows.Action):
|
||||||
attrs={'class': 'switched',
|
attrs={'class': 'switched',
|
||||||
'data-switch-on': 'personality',
|
'data-switch-on': 'personality',
|
||||||
'data-personality-' +
|
'data-personality-' +
|
||||||
stx_api.sysinv.PERSONALITY_COMPUTE:
|
stx_api.sysinv.PERSONALITY_WORKER:
|
||||||
_("Host Name")}))
|
_("Host Name")}))
|
||||||
|
|
||||||
location = forms.CharField(label=_("Location"),
|
location = forms.CharField(label=_("Location"),
|
||||||
|
@ -292,7 +292,7 @@ class UpdateHostInfoAction(workflows.Action):
|
||||||
self.fields['personality'].choices = \
|
self.fields['personality'].choices = \
|
||||||
PERSONALITY_CHOICES_WITHOUT_STORAGE
|
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)
|
systems = stx_api.sysinv.system_list(request)
|
||||||
self.system_mode = systems[0].to_dict().get('system_mode')
|
self.system_mode = systems[0].to_dict().get('system_mode')
|
||||||
self.system_type = systems[0].to_dict().get('system_type')
|
self.system_type = systems[0].to_dict().get('system_type')
|
||||||
|
@ -300,12 +300,12 @@ class UpdateHostInfoAction(workflows.Action):
|
||||||
self.fields['personality'].choices = \
|
self.fields['personality'].choices = \
|
||||||
PERSONALITY_CHOICES_WITHOUT_STORAGE
|
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' \
|
if getattr(self.request.user, 'services_region', None) == 'RegionOne' \
|
||||||
and getattr(settings, 'DC_MODE', False):
|
and getattr(settings, 'DC_MODE', False):
|
||||||
self.fields['personality'].choices = \
|
self.fields['personality'].choices = \
|
||||||
[choice for choice in 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
|
# hostname cannot be modified once it is set
|
||||||
if self.initial['hostname']:
|
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.ports = stx_api.sysinv.host_port_list(self.request, host.uuid)
|
||||||
host.disks = stx_api.sysinv.host_disk_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
|
mem_profile_configurable = True
|
||||||
host.memory = stx_api.sysinv.host_memory_list(
|
host.memory = stx_api.sysinv.host_memory_list(
|
||||||
self.request, host.uuid)
|
self.request, host.uuid)
|
||||||
|
@ -393,7 +393,7 @@ class UpdateHostInfoAction(workflows.Action):
|
||||||
'interfaceProfile'].widget = forms.widgets.HiddenInput()
|
'interfaceProfile'].widget = forms.widgets.HiddenInput()
|
||||||
|
|
||||||
if ((personality == 'storage' or
|
if ((personality == 'storage' or
|
||||||
'compute' in host._subfunctions) and host.disks):
|
'worker' in host._subfunctions) and host.disks):
|
||||||
# Populate Available Disk Profile Choices
|
# Populate Available Disk Profile Choices
|
||||||
try:
|
try:
|
||||||
disk_profile_tuple_list = [
|
disk_profile_tuple_list = [
|
||||||
|
@ -470,7 +470,7 @@ class UpdateHostInfoAction(workflows.Action):
|
||||||
stx_api.sysinv.PERSONALITY_CONTROLLER:
|
stx_api.sysinv.PERSONALITY_CONTROLLER:
|
||||||
if self.system_type == constants.TS_AIO:
|
if self.system_type == constants.TS_AIO:
|
||||||
self._subfunctions = (stx_api.sysinv.PERSONALITY_CONTROLLER +
|
self._subfunctions = (stx_api.sysinv.PERSONALITY_CONTROLLER +
|
||||||
',' + stx_api.sysinv.PERSONALITY_COMPUTE)
|
',' + stx_api.sysinv.PERSONALITY_WORKER)
|
||||||
else:
|
else:
|
||||||
self._subfunctions = stx_api.sysinv.PERSONALITY_CONTROLLER
|
self._subfunctions = stx_api.sysinv.PERSONALITY_CONTROLLER
|
||||||
cleaned_data['subfunctions'] = self._subfunctions
|
cleaned_data['subfunctions'] = self._subfunctions
|
||||||
|
|
|
@ -48,7 +48,7 @@ class CreateProviderNetwork(forms.SelfHandlingForm):
|
||||||
max_value=9216,
|
max_value=9216,
|
||||||
help_text=(
|
help_text=(
|
||||||
_("Specifies the maximum MTU value of any associated tenant "
|
_("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 "
|
"enough to support the tenant MTU plus any additional provider "
|
||||||
"encapsulation headers. For example, VXLAN provider MTU of "
|
"encapsulation headers. For example, VXLAN provider MTU of "
|
||||||
"1500 requires a minimum data interface MTU of 1574 bytes (1600 "
|
"1500 requires a minimum data interface MTU of 1574 bytes (1600 "
|
||||||
|
|
|
@ -110,29 +110,29 @@ class CreatePatchStrategyForm(forms.SelfHandlingForm):
|
||||||
choices=GENERIC_APPLY_TYPES,
|
choices=GENERIC_APPLY_TYPES,
|
||||||
widget=forms.Select())
|
widget=forms.Select())
|
||||||
|
|
||||||
compute_apply_type = forms.ChoiceField(
|
worker_apply_type = forms.ChoiceField(
|
||||||
label=_("Compute Apply Type"),
|
label=_("Worker Apply Type"),
|
||||||
required=True,
|
required=True,
|
||||||
choices=GENERIC_APPLY_TYPES,
|
choices=GENERIC_APPLY_TYPES,
|
||||||
widget=forms.Select(
|
widget=forms.Select(
|
||||||
attrs={
|
attrs={
|
||||||
'class': 'switchable',
|
'class': 'switchable',
|
||||||
'data-slug': 'compute_apply_type'}))
|
'data-slug': 'worker_apply_type'}))
|
||||||
|
|
||||||
max_parallel_compute_hosts = forms.IntegerField(
|
max_parallel_worker_hosts = forms.IntegerField(
|
||||||
label=_("Maximum Parallel Compute Hosts"),
|
label=_("Maximum Parallel Worker Hosts"),
|
||||||
initial=2,
|
initial=2,
|
||||||
min_value=2,
|
min_value=2,
|
||||||
max_value=100,
|
max_value=100,
|
||||||
required=True,
|
required=True,
|
||||||
error_messages={'invalid': _('Maximum Parallel Compute Hosts must be '
|
error_messages={'invalid': _('Maximum Parallel Worker Hosts must be '
|
||||||
'between 2 and 100.')},
|
'between 2 and 100.')},
|
||||||
widget=forms.TextInput(
|
widget=forms.TextInput(
|
||||||
attrs={
|
attrs={
|
||||||
'class': 'switched',
|
'class': 'switched',
|
||||||
'data-switch-on': 'compute_apply_type',
|
'data-switch-on': 'worker_apply_type',
|
||||||
'data-compute_apply_type-parallel':
|
'data-worker_apply_type-parallel':
|
||||||
'Maximum Parallel Compute Hosts'}))
|
'Maximum Parallel Worker Hosts'}))
|
||||||
|
|
||||||
default_instance_action = forms.ChoiceField(
|
default_instance_action = forms.ChoiceField(
|
||||||
label=_("Default Instance Action"),
|
label=_("Default Instance Action"),
|
||||||
|
@ -156,7 +156,7 @@ class CreatePatchStrategyForm(forms.SelfHandlingForm):
|
||||||
system_type = stx_api.sysinv.get_system_type(request)
|
system_type = stx_api.sysinv.get_system_type(request)
|
||||||
if system_type == stx_api.sysinv.SYSTEM_TYPE_AIO:
|
if system_type == stx_api.sysinv.SYSTEM_TYPE_AIO:
|
||||||
del self.fields['controller_apply_type']
|
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):
|
if stx_api.sysinv.is_system_mode_simplex(request):
|
||||||
self.fields['default_instance_action'].choices = \
|
self.fields['default_instance_action'].choices = \
|
||||||
|
@ -172,8 +172,8 @@ class CreatePatchStrategyForm(forms.SelfHandlingForm):
|
||||||
request, stx_api.vim.STRATEGY_SW_PATCH,
|
request, stx_api.vim.STRATEGY_SW_PATCH,
|
||||||
data.get('controller_apply_type', 'ignore'),
|
data.get('controller_apply_type', 'ignore'),
|
||||||
data.get('storage_apply_type', 'ignore'), 'ignore',
|
data.get('storage_apply_type', 'ignore'), 'ignore',
|
||||||
data['compute_apply_type'],
|
data['worker_apply_type'],
|
||||||
data['max_parallel_compute_hosts'],
|
data['max_parallel_worker_hosts'],
|
||||||
data['default_instance_action'],
|
data['default_instance_action'],
|
||||||
data['alarm_restrictions'])
|
data['alarm_restrictions'])
|
||||||
if not response:
|
if not response:
|
||||||
|
@ -205,29 +205,29 @@ class CreateUpgradeStrategyForm(forms.SelfHandlingForm):
|
||||||
choices=GENERIC_APPLY_TYPES,
|
choices=GENERIC_APPLY_TYPES,
|
||||||
widget=forms.Select())
|
widget=forms.Select())
|
||||||
|
|
||||||
compute_apply_type = forms.ChoiceField(
|
worker_apply_type = forms.ChoiceField(
|
||||||
label=_("Compute Apply Type"),
|
label=_("Worker Apply Type"),
|
||||||
required=True,
|
required=True,
|
||||||
choices=GENERIC_APPLY_TYPES,
|
choices=GENERIC_APPLY_TYPES,
|
||||||
widget=forms.Select(
|
widget=forms.Select(
|
||||||
attrs={
|
attrs={
|
||||||
'class': 'switchable',
|
'class': 'switchable',
|
||||||
'data-slug': 'compute_apply_type'}))
|
'data-slug': 'worker_apply_type'}))
|
||||||
|
|
||||||
max_parallel_compute_hosts = forms.IntegerField(
|
max_parallel_worker_hosts = forms.IntegerField(
|
||||||
label=_("Maximum Parallel Compute Hosts"),
|
label=_("Maximum Parallel Worker Hosts"),
|
||||||
initial=2,
|
initial=2,
|
||||||
min_value=2,
|
min_value=2,
|
||||||
max_value=10,
|
max_value=10,
|
||||||
required=True,
|
required=True,
|
||||||
error_messages={'invalid': _('Maximum Parallel Compute Hosts must be '
|
error_messages={'invalid': _('Maximum Parallel Worker Hosts must be '
|
||||||
'between 2 and 10.')},
|
'between 2 and 10.')},
|
||||||
widget=forms.TextInput(
|
widget=forms.TextInput(
|
||||||
attrs={
|
attrs={
|
||||||
'class': 'switched',
|
'class': 'switched',
|
||||||
'data-switch-on': 'compute_apply_type',
|
'data-switch-on': 'worker_apply_type',
|
||||||
'data-compute_apply_type-parallel':
|
'data-worker_apply_type-parallel':
|
||||||
'Maximum Parallel Compute Hosts'}))
|
'Maximum Parallel Worker Hosts'}))
|
||||||
|
|
||||||
alarm_restrictions = forms.ChoiceField(
|
alarm_restrictions = forms.ChoiceField(
|
||||||
label=_("Alarm Restrictions"),
|
label=_("Alarm Restrictions"),
|
||||||
|
@ -251,8 +251,8 @@ class CreateUpgradeStrategyForm(forms.SelfHandlingForm):
|
||||||
response = stx_api.vim.create_strategy(
|
response = stx_api.vim.create_strategy(
|
||||||
request, stx_api.vim.STRATEGY_SW_UPGRADE, 'ignore',
|
request, stx_api.vim.STRATEGY_SW_UPGRADE, 'ignore',
|
||||||
data.get('storage_apply_type', 'ignore'), 'ignore',
|
data.get('storage_apply_type', 'ignore'), 'ignore',
|
||||||
data['compute_apply_type'],
|
data['worker_apply_type'],
|
||||||
data['max_parallel_compute_hosts'],
|
data['max_parallel_worker_hosts'],
|
||||||
'migrate',
|
'migrate',
|
||||||
data['alarm_restrictions'])
|
data['alarm_restrictions'])
|
||||||
if not response:
|
if not response:
|
||||||
|
|
|
@ -13,11 +13,11 @@
|
||||||
<dd>{{ strategy.controller_apply_type }}</dd>
|
<dd>{{ strategy.controller_apply_type }}</dd>
|
||||||
<dt>{% trans "Storage Apply Type" %}</dt>
|
<dt>{% trans "Storage Apply Type" %}</dt>
|
||||||
<dd>{{ strategy.storage_apply_type }}</dd>
|
<dd>{{ strategy.storage_apply_type }}</dd>
|
||||||
<dt>{% trans "Compute Apply Type" %}</dt>
|
<dt>{% trans "Worker Apply Type" %}</dt>
|
||||||
<dd>{{ strategy.compute_apply_type }}</dd>
|
<dd>{{ strategy.worker_apply_type }}</dd>
|
||||||
{% if strategy.compute_apply_type == "parallel" %}
|
{% if strategy.worker_apply_type == "parallel" %}
|
||||||
<dt>{% trans "Maximum Parallel Compute Hosts" %}</dt>
|
<dt>{% trans "Maximum Parallel Worker Hosts" %}</dt>
|
||||||
<dd>{{ strategy.max_parallel_compute_hosts }}</dd>
|
<dd>{{ strategy.max_parallel_worker_hosts }}</dd>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<dt>{% trans "Default Instance Action" %}</dt>
|
<dt>{% trans "Default Instance Action" %}</dt>
|
||||||
<dd>{{ strategy.default_instance_action }}</dd>
|
<dd>{{ strategy.default_instance_action }}</dd>
|
||||||
|
|
|
@ -11,11 +11,11 @@
|
||||||
<dl class="dl-horizontal-wide">
|
<dl class="dl-horizontal-wide">
|
||||||
<dt>{% trans "Storage Apply Type" %}</dt>
|
<dt>{% trans "Storage Apply Type" %}</dt>
|
||||||
<dd>{{ strategy.storage_apply_type }}</dd>
|
<dd>{{ strategy.storage_apply_type }}</dd>
|
||||||
<dt>{% trans "Compute Apply Type" %}</dt>
|
<dt>{% trans "Worker Apply Type" %}</dt>
|
||||||
<dd>{{ strategy.compute_apply_type }}</dd>
|
<dd>{{ strategy.worker_apply_type }}</dd>
|
||||||
{% if strategy.compute_apply_type == "parallel" %}
|
{% if strategy.worker_apply_type == "parallel" %}
|
||||||
<dt>{% trans "Maximum Parallel Compute Hosts" %}</dt>
|
<dt>{% trans "Maximum Parallel Worker Hosts" %}</dt>
|
||||||
<dd>{{ strategy.max_parallel_compute_hosts }}</dd>
|
<dd>{{ strategy.max_parallel_worker_hosts }}</dd>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<dt>{% trans "Alarm Restrictions" %}</dt>
|
<dt>{% trans "Alarm Restrictions" %}</dt>
|
||||||
<dd>{{ strategy.alarm_restrictions }}</dd>
|
<dd>{{ strategy.alarm_restrictions }}</dd>
|
||||||
|
|
|
@ -106,29 +106,29 @@ class CreateCloudPatchConfigForm(forms.SelfHandlingForm):
|
||||||
choices=APPLY_TYPES,
|
choices=APPLY_TYPES,
|
||||||
widget=forms.Select())
|
widget=forms.Select())
|
||||||
|
|
||||||
compute_apply_type = forms.ChoiceField(
|
worker_apply_type = forms.ChoiceField(
|
||||||
label=_("Compute Apply Type"),
|
label=_("Worker Apply Type"),
|
||||||
required=True,
|
required=True,
|
||||||
choices=APPLY_TYPES,
|
choices=APPLY_TYPES,
|
||||||
widget=forms.Select(
|
widget=forms.Select(
|
||||||
attrs={
|
attrs={
|
||||||
'class': 'switchable',
|
'class': 'switchable',
|
||||||
'data-slug': 'compute_apply_type'}))
|
'data-slug': 'worker_apply_type'}))
|
||||||
|
|
||||||
max_parallel_computes = forms.IntegerField(
|
max_parallel_workers = forms.IntegerField(
|
||||||
label=_("Maximum Parallel Compute Hosts"),
|
label=_("Maximum Parallel Worker Hosts"),
|
||||||
initial=2,
|
initial=2,
|
||||||
min_value=2,
|
min_value=2,
|
||||||
max_value=100,
|
max_value=100,
|
||||||
required=True,
|
required=True,
|
||||||
error_messages={'invalid': _('Maximum Parallel Compute Hosts must be '
|
error_messages={'invalid': _('Maximum Parallel Worker Hosts must be '
|
||||||
'between 2 and 100.')},
|
'between 2 and 100.')},
|
||||||
widget=forms.TextInput(
|
widget=forms.TextInput(
|
||||||
attrs={
|
attrs={
|
||||||
'class': 'switched',
|
'class': 'switched',
|
||||||
'data-switch-on': 'compute_apply_type',
|
'data-switch-on': 'worker_apply_type',
|
||||||
'data-compute_apply_type-parallel':
|
'data-worker_apply_type-parallel':
|
||||||
'Maximum Parallel Compute Hosts'}))
|
'Maximum Parallel Worker Hosts'}))
|
||||||
|
|
||||||
default_instance_action = forms.ChoiceField(
|
default_instance_action = forms.ChoiceField(
|
||||||
label=_("Default Instance Action"),
|
label=_("Default Instance Action"),
|
||||||
|
|
|
@ -303,10 +303,10 @@ class CloudPatchConfigTable(tables.DataTable):
|
||||||
cloud = tables.Column('cloud', verbose_name=_('Cloud'))
|
cloud = tables.Column('cloud', verbose_name=_('Cloud'))
|
||||||
storage_apply_type = tables.Column('storage_apply_type',
|
storage_apply_type = tables.Column('storage_apply_type',
|
||||||
verbose_name=_('Storage Apply Type'))
|
verbose_name=_('Storage Apply Type'))
|
||||||
compute_apply_type = tables.Column('compute_apply_type',
|
worker_apply_type = tables.Column('worker_apply_type',
|
||||||
verbose_name=_('Compute Apply Type'))
|
verbose_name=_('Worker Apply Type'))
|
||||||
max_parallel_computes = tables.Column(
|
max_parallel_workers = tables.Column(
|
||||||
'max_parallel_computes', verbose_name=_('Max Parallel Computes'))
|
'max_parallel_workers', verbose_name=_('Max Parallel Workers'))
|
||||||
default_instance_action = tables.Column(
|
default_instance_action = tables.Column(
|
||||||
'default_instance_action', verbose_name=_('Default Instance Action'))
|
'default_instance_action', verbose_name=_('Default Instance Action'))
|
||||||
alarm_restriction_type = tables.Column(
|
alarm_restriction_type = tables.Column(
|
||||||
|
|
|
@ -88,7 +88,7 @@ class EditCloudPatchConfigView(forms.ModalFormView):
|
||||||
|
|
||||||
return {'subcloud': config.cloud,
|
return {'subcloud': config.cloud,
|
||||||
'storage_apply_type': config.storage_apply_type,
|
'storage_apply_type': config.storage_apply_type,
|
||||||
'compute_apply_type': config.compute_apply_type,
|
'worker_apply_type': config.worker_apply_type,
|
||||||
'max_parallel_computes': config.max_parallel_computes,
|
'max_parallel_workers': config.max_parallel_workers,
|
||||||
'default_instance_action': config.default_instance_action,
|
'default_instance_action': config.default_instance_action,
|
||||||
'alarm_restriction_type': config.alarm_restriction_type}
|
'alarm_restriction_type': config.alarm_restriction_type}
|
||||||
|
|
|
@ -156,9 +156,9 @@ horizon.host_topology = {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Remove hosts without compute functionality
|
// Remove hosts without worker functionality
|
||||||
model.hosts = $.grep(model.hosts, function (host, i){
|
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 true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|
Loading…
Reference in New Issue