The attached script will produce the results you are looking for.
But for the transpose part I would still need some further clarification.
The resulting CSV, 1 CSV per powered on VM, from this script looks something like this
Is this the table you want to transpose ?
In other words the result would look like this
Time | 20/04/13 00:30 | 20/04/13 01:00 | 20/04/13 01:30 | |
---|---|---|---|---|
cpu_usage_average | 15.9 | 17.3 | 12.3 | |
| 872 | 889 | 855 | |
| 7530 | 8142 | 7211 |
Is that what you want ?