验证操作

验证操作

验证Telemetry服务操作。为了简单些,下面的这些步骤只包括了镜像服务计量信息。如果环境中ceilometer集成了其他服务会包含更多计量信息。

注解

在控制节点上执行这些步骤。

  1. 获得 admin 凭证来获取只有管理员能执行命令的访问权限:

    $ source admin-openrc.sh
    
  2. 列出可用的 meters:

    $ ceilometer meter-list
    +--------------+-------+-------+--------------------------------------+---------+------------+
    | Name         | Type  | Unit  | Resource ID                          | User ID | Project ID |
    +--------------+-------+-------+--------------------------------------+---------+------------+
    | image        | gauge | image | acafc7c0-40aa-4026-9673-b879898e1fc2 | None    | cf12a15... |
    | image.size   | gauge | B     | acafc7c0-40aa-4026-9673-b879898e1fc2 | None    | cf12a15... |
    +--------------+-------+-------+--------------------------------------+---------+------------+
    
  3. 从镜像服务下载CirrOS镜像:

    $ IMAGE_ID=$(glance image-list | grep 'cirros' | awk '{ print $2 }')
    $ glance image-download $IMAGE_ID > /tmp/cirros.img
    
  4. 再次列出可用的 meters 以验证镜像下载的检查:

    $ ceilometer meter-list
    +----------------+-------+-------+--------------------------------------+---------+------------+
    | Name           | Type  | Unit  | Resource ID                          | User ID | Project ID |
    +----------------+-------+-------+--------------------------------------+---------+------------+
    | image          | gauge | image | acafc7c0-40aa-4026-9673-b879898e1fc2 | None    | cf12a15... |
    | image.download | delta | B     | acafc7c0-40aa-4026-9673-b879898e1fc2 | None    | cf12a15... |
    | image.serve    | delta | B     | acafc7c0-40aa-4026-9673-b879898e1fc2 | None    | cf12a15... |
    | image.size     | gauge | B     | acafc7c0-40aa-4026-9673-b879898e1fc2 | None    | cf12a15... |
    +----------------+-------+-------+--------------------------------------+---------+------------+
    
  5. image.download 表读取使用量统计值。

    $ ceilometer statistics -m image.download -p 60
    +--------+---------------------+---------------------+------------+------------+------------+------------+-------+----------+----------------------------+----------------------------+
    | Period | Period Start        | Period End          | Max        | Min        | Avg        | Sum        | Count | Duration | Duration Start             | Duration End               |
    +--------+---------------------+---------------------+------------+------------+------------+------------+-------+----------+----------------------------+----------------------------+
    | 60     | 2015-04-21T12:21:45 | 2015-04-21T12:22:45 | 13200896.0 | 13200896.0 | 13200896.0 | 13200896.0 | 1     | 0.0      | 2015-04-21T12:22:12.983000 | 2015-04-21T12:22:12.983000 |
    +--------+---------------------+---------------------+------------+------------+------------+------------+-------+----------+----------------------------+----------------------------+
    
  6. 删除之前下载的镜像文件 /tmp/cirros.img

    $ rm /tmp/cirros.img
    
Creative Commons Attribution 3.0 License

Except where otherwise noted, this document is licensed under Creative Commons Attribution 3.0 License. See all OpenStack Legal Documents.