Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 67e33f202e | |||
| 2cb129ef04 | |||
| a36972caf2 | |||
| d2893401d3 | |||
| 8eab47e107 |
@@ -40,8 +40,8 @@ class PrometheusBase(base.DataSourceBase):
|
||||
host_inlet_temp=None,
|
||||
host_airflow=None,
|
||||
host_power=None,
|
||||
instance_cpu_usage='ceilometer_cpu',
|
||||
instance_ram_usage='ceilometer_memory_usage',
|
||||
instance_cpu_usage='libvirt_domain_info_cpu_time_seconds_total',
|
||||
instance_ram_usage='libvirt_domain_info_memory_usage_bytes',
|
||||
instance_ram_allocated='instance.memory',
|
||||
instance_l3_cache_usage=None,
|
||||
instance_root_disk_size='instance.disk',
|
||||
@@ -156,7 +156,7 @@ class PrometheusBase(base.DataSourceBase):
|
||||
host: fqdn for (host, fqdn) in (
|
||||
(fqdn.split('.')[0], fqdn)
|
||||
for fqdn in self.prometheus_fqdn_labels
|
||||
if '.' in fqdn
|
||||
# if '.' in fqdn
|
||||
)
|
||||
}
|
||||
if not host_instance_map:
|
||||
@@ -311,6 +311,18 @@ class PrometheusBase(base.DataSourceBase):
|
||||
'agg': aggregate, 'meter': meter, 'period': period,
|
||||
'vcpus': vcpus}
|
||||
)
|
||||
elif meter == 'libvirt_domain_info_cpu_time_seconds_total':
|
||||
query_args = (
|
||||
"(rate(%(meter)s{%(label)s='%(label_value)s'}[%(period)ss]))"
|
||||
% {'label': uuid_label_key, 'label_value': instance_label,
|
||||
'meter': meter, 'period': period}
|
||||
)
|
||||
elif meter == 'libvirt_domain_info_memory_usage_bytes':
|
||||
query_args = (
|
||||
"%(agg)s_over_time(%(meter)s{%(label)s='%(label_value)s'}[%(period)ss]) / 1024"
|
||||
% {'label': uuid_label_key, 'label_value': instance_label,
|
||||
'meter': meter, 'period': period, 'agg': aggregate}
|
||||
)
|
||||
else:
|
||||
raise exception.InvalidParameter(
|
||||
message=(_("Cannot process prometheus meter %s") % meter)
|
||||
|
||||
@@ -89,6 +89,12 @@ class HostMaintenance(base.HostMaintenanceBaseStrategy):
|
||||
"will backup the maintenance node.",
|
||||
"type": "string",
|
||||
},
|
||||
"disabled_reason": {
|
||||
"description": "Describe reason for moving host"
|
||||
"into maintenance mode.",
|
||||
"type": "string",
|
||||
"default": 'watcher_maintaining',
|
||||
},
|
||||
"disable_live_migration": {
|
||||
"description": "Disable live migration in maintenance. "
|
||||
"If True, active instances will be cold "
|
||||
@@ -295,6 +301,10 @@ class HostMaintenance(base.HostMaintenanceBaseStrategy):
|
||||
|
||||
maintenance_node = self.input_parameters.get('maintenance_node')
|
||||
backup_node = self.input_parameters.get('backup_node')
|
||||
disabled_reason = self.input_parameters.get('disabled_reason')
|
||||
|
||||
if disabled_reason:
|
||||
self.REASON_FOR_MAINTAINING = disabled_reason
|
||||
|
||||
# if no VMs in the maintenance_node, just maintain the compute node
|
||||
src_node = self.compute_model.get_node_by_name(maintenance_node)
|
||||
|
||||
@@ -287,8 +287,6 @@ class WorkloadStabilization(base.WorkloadStabilizationBaseStrategy):
|
||||
"for %(metric_name)s", dict(
|
||||
resource_id=instance.uuid, metric_name=meter))
|
||||
return
|
||||
if meter == 'instance_cpu_usage':
|
||||
avg_meter /= float(100)
|
||||
LOG.debug('Load of %(metric)s for %(instance)s is %(value)s',
|
||||
{'metric': meter,
|
||||
'instance': instance.uuid,
|
||||
@@ -334,8 +332,6 @@ class WorkloadStabilization(base.WorkloadStabilizationBaseStrategy):
|
||||
else:
|
||||
if meter_name == 'host_ram_usage':
|
||||
avg_meter /= oslo_utils.units.Ki
|
||||
if meter_name == 'host_cpu_usage':
|
||||
avg_meter /= 100
|
||||
LOG.debug('Load of %(metric)s for %(node)s is %(value)s',
|
||||
{'metric': metric,
|
||||
'node': node_id,
|
||||
|
||||
Reference in New Issue
Block a user