With mysql as storage backend, If I use following command to create a threshold alarm:
ceilometer alarm-threshold-create -m instance --name abd --evaluation-periods 1000000000000000000000000000000000000000000000000 --threshold 10
It will be created successfully, but this alarm cannot be evluated, the trace of alarm-evluator is:
[-] evaluating alarm d7796ce7-744e-439f-afca-60c2730b3a2e _evaluate_alarm /opt/stack/ceilometer/ceilometer/alarm/service.py:86
[-] alarm evaluation cycle failed
Traceback (most recent call last):
File "/opt/stack/ceilometer/ceilometer/alarm/service.py", line 75, in _evaluate_assigned_alarms
self._evaluate_alarm(alarm)
File "/opt/stack/ceilometer/ceilometer/alarm/service.py", line 87, in _evaluate_alarm
self.evaluators[alarm.type].obj.evaluate(alarm)
File "/opt/stack/ceilometer/ceilometer/alarm/evaluator/threshold.py", line 203, in evaluate
alarm.rule['query']
File "/opt/stack/ceilometer/ceilometer/alarm/evaluator/threshold.py", line 63, in _bound_duration
start = now - datetime.timedelta(seconds=window)
OverflowError: Python int too large to convert to C long
Agreed, very large *positive* periods should be truncated to the number of seconds since the epoch if necessary (otherwise the value is meaningless).
But I don't think your example above is correct, specifically the large *negative* period. This fails verification as expected:
api.log: 2014-05-08 14:30:34.806 3071 WARNING wsme.api [-] Client-side error: Invalid input for field/attribute evaluation_periods. Value: '-1000000000000 000000000000000 000000000000000 000000' . Value should be greater or equal to 1
response: {"error_message": {"debuginfo": null, "faultcode": "Client", "faultstring": "Invalid input for field/attribute evaluation_periods. Value: '-1000000000000 000000000000000 000000000000000 000000' . Value should be greater or equal to 1"}}