Added prometheus instance cpu and ram metrics
This commit is contained in:
@@ -40,8 +40,8 @@ class PrometheusBase(base.DataSourceBase):
|
|||||||
host_inlet_temp=None,
|
host_inlet_temp=None,
|
||||||
host_airflow=None,
|
host_airflow=None,
|
||||||
host_power=None,
|
host_power=None,
|
||||||
instance_cpu_usage='ceilometer_cpu',
|
instance_cpu_usage='libvirt_domain_info_cpu_time_seconds_total',
|
||||||
instance_ram_usage='ceilometer_memory_usage',
|
instance_ram_usage='libvirt_domain_info_memory_usage_bytes',
|
||||||
instance_ram_allocated='instance.memory',
|
instance_ram_allocated='instance.memory',
|
||||||
instance_l3_cache_usage=None,
|
instance_l3_cache_usage=None,
|
||||||
instance_root_disk_size='instance.disk',
|
instance_root_disk_size='instance.disk',
|
||||||
@@ -311,6 +311,18 @@ class PrometheusBase(base.DataSourceBase):
|
|||||||
'agg': aggregate, 'meter': meter, 'period': period,
|
'agg': aggregate, 'meter': meter, 'period': period,
|
||||||
'vcpus': vcpus}
|
'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:
|
else:
|
||||||
raise exception.InvalidParameter(
|
raise exception.InvalidParameter(
|
||||||
message=(_("Cannot process prometheus meter %s") % meter)
|
message=(_("Cannot process prometheus meter %s") % meter)
|
||||||
|
|||||||
@@ -89,6 +89,14 @@ class HostMaintenance(base.HostMaintenanceBaseStrategy):
|
|||||||
"will backup the maintenance node.",
|
"will backup the maintenance node.",
|
||||||
"type": "string",
|
"type": "string",
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"disabled_reason": {
|
||||||
|
"description": "Describe reason for moving host"
|
||||||
|
"into maintenance mode.",
|
||||||
|
"type": "string",
|
||||||
|
"default": False,
|
||||||
|
}
|
||||||
|
}
|
||||||
"disable_live_migration": {
|
"disable_live_migration": {
|
||||||
"description": "Disable live migration in maintenance. "
|
"description": "Disable live migration in maintenance. "
|
||||||
"If True, active instances will be cold "
|
"If True, active instances will be cold "
|
||||||
@@ -295,6 +303,10 @@ class HostMaintenance(base.HostMaintenanceBaseStrategy):
|
|||||||
|
|
||||||
maintenance_node = self.input_parameters.get('maintenance_node')
|
maintenance_node = self.input_parameters.get('maintenance_node')
|
||||||
backup_node = self.input_parameters.get('backup_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
|
# if no VMs in the maintenance_node, just maintain the compute node
|
||||||
src_node = self.compute_model.get_node_by_name(maintenance_node)
|
src_node = self.compute_model.get_node_by_name(maintenance_node)
|
||||||
|
|||||||
Reference in New Issue
Block a user