futuregrid / cloud-metrics

Project to create usage statistics from IaaS such as OpenStack, Eucalyptus, and Nimbus
2 stars 3 forks source link

Unique instance IDs #65

Closed lee212 closed 11 years ago

lee212 commented 11 years ago

The framework has a unique identifier for each instance by combining a start date(ts) and an instance ID but we observed that eucalyptus could generate a different start date for a same instance which makes the framework have different identifiers for a same instance record.

For example, the framework will have encoded text like 'ef449f9305a7ea58d03b761b9343628d' for the instance of i-467408A1 (instance id) and 2011-11-06 10:46:39 (start date; ts). Eucalyptus could record a different start date for the instance, for example '2011-11-06 10:46:40'. The framework will identify they are different instances because of the different start date, one second difference. Finally, the framework accidentally has duplicate records for the instance.

I propose that the framework will create a unique identifier by mixing a start date without time value (only including year, month and day value) and an instance Id in order to avoid generating duplicated records.

The captured error is here. mysql> select * from instance where instanceId in ('i-467408A1'); | ef449f9305a7ea58d03b761b9343628d | i-467408A1 | 2011-11-06 10:46:39 | refresh_instances | ... | 0d9a6086d0d87b22e83ec823072071ea | i-467408A1 | 2011-11-06 10:46:40 | refresh_instances | ...

2 rows in set (0.22 sec)