In VMWare environment, when a VM is shutdown, vsphere will return -1 when ceilometer query for performance, and as a result the cpu_util is set to -0.01%, like below:
[root@cc vmware]# ceilometer sample-list -m cpu_util -l 1
+--------------------------------------+----------+-------+-----------------+------+---------------------+
| Resource ID | Name | Type | Volume | Unit | Timestamp |
+--------------------------------------+----------+-------+-----------------+------+---------------------+
| f8596226-94b7-4a8b-9569-52672bbf5865 | cpu_util | gauge | -0.01 | % | 2014-12-19T10:19:37 |
+--------------------------------------+----------+-------+-----------------+------+---------------------+
Expected results:
There are two ways to handle this:
1, the inspector should know "-1" is an error code rather than an actual number, and shouldn't generate a new sample.
2, cpu_util volume should be set to "0" if it is negative.
And what's more, the same policy should be applied to memory usage, disk IO, network IO, etc.
or we can raise instance shut off exception when instance is shut off....