为 Red Hat Enterprise Linux 和 CentOS 启用 Compute 服务计量

Telemetry 使用通知和代理的组合来收集 Compute 计量。在每个计算节点上执行以下步骤。

安装和配置组件

  1. 安装软件包

    # dnf install openstack-ceilometer-compute
    # dnf install openstack-ceilometer-ipmi (optional)
    
  1. 编辑 /etc/ceilometer/ceilometer.conf 文件并完成以下操作

    • [DEFAULT] 部分中,配置 RabbitMQ 消息队列访问

      [DEFAULT]
      ...
      transport_url = rabbit://openstack:RABBIT_PASS@controller
      

      RABBIT_PASS 替换为您为 RabbitMQ 中的 openstack 帐户选择的密码。

    • [service_credentials] 部分,配置服务凭证

      [service_credentials]
      ...
      auth_url = http://controller:5000
      project_domain_id = default
      user_domain_id = default
      auth_type = password
      username = ceilometer
      project_name = service
      password = CEILOMETER_PASS
      interface = internalURL
      region_name = RegionOne
      

      CEILOMETER_PASS 替换为你在 Identity 服务中为 ceilometer 用户选择的密码。

配置 Compute 使用 Telemetry

  • 编辑 /etc/nova/nova.conf 文件并在 [DEFAULT] 部分配置通知

    [DEFAULT]
    ...
    instance_usage_audit = True
    instance_usage_audit_period = hour
    
    [notifications]
    ...
    notify_on_state_change = vm_and_task_state
    
    [oslo_messaging_notifications]
    ...
    driver = messagingv2
    

配置 Compute 轮询 IPMI 计量

注意

要启用 IPMI 计量,请确保已安装 IPMITool 并且主机支持 IPMI。

  • 编辑 /etc/ceilometer/polling.yaml 以包含所需的计量,例如

    - name: ipmi
      interval: 300
      meters:
        - hardware.ipmi.temperature
    

完成安装

  1. 启动代理并配置它在系统启动时启动

    # systemctl enable openstack-ceilometer-compute.service
    # systemctl start openstack-ceilometer-compute.service
    # systemctl enable openstack-ceilometer-ipmi.service (optional)
    # systemctl start openstack-ceilometer-ipmi.service (optional)
    
  2. 重新启动计算服务

    # systemctl restart openstack-nova-compute.service