Today I needed to collected the time between the creation of server and the current day. Given some activities that requires monitoring those servers, an automated approach is vital for optimizing the amount of time dedicating to it. As I couldn’t find an option that could give the result right away in the openstack-cli tool, I wrote my own script to solve this issue.
I uploaded it under Apache 2 License at my GitHub, fell free to use it https://github.com/rpsene/openstack-server-timelife
23:24:23 | Mon Feb 26 ~/Sources/openstack-server-timelife rpsene@rpsene : master ./get-running-time.sh ppc64le The server travis-cb8954-ppc64le-master (3c32405a-6eeb-466f-8474-6e3b8648fafd) is running for 0h:47m:54s The server travis-cb8954-ppc64le-worker-1 (889bfa63-bd70-4524-8984-1b462da451d8) is running for 0h:48m:32s The server travis-cb8954-ppc64le-worker-2 (dbb1c5ce-fc5b-4c9c-88f3-e4413d1fc1fb) is running for 0h:48m:44s The server travis-b110f5-ppc64le-master (15765098-a457-40d9-8687-c7631caaa0e5) is running for 6h:6m:27s The server travis-b110f5-ppc64le-worker-2 (05631393-c52d-494b-9b3e-28b98ff4100a) is running for 6h:7m:6s The server travis-b110f5-ppc64le-worker-1 (93b06182-8a5a-4945-90e7-6df80415190c) is running for 6h:7m:19s The server travis-4a7e69-ppc64le-master (f5135576-5222-46da-bd14-03affdd53db9) is running for 8h:41m:55s The server travis-4a7e69-ppc64le-worker-1 (2dee0340-8043-4b06-b1c3-6856029a4859) is running for 8h:42m:34s The server travis-4a7e69-ppc64le-worker-2 (a9d6f43d-3220-450e-b4a1-bd22695274e1) is running for 8h:42m:47s The server travis-dce487-ppc64le-master (dc0deb3d-d2d3-4c2d-a949-151310f94191) is running for 303h:47m:48s The server travis-dce487-ppc64le-worker-1 (a05592ae-dfc7-4f28-b7bd-d98f0ea3f429) is running for 303h:48m:36s The server travis-dce487-ppc64le-worker-2 (611dc709-5bbf-4c80-92bc-3a6ae11ce610) is running for 303h:48m:50s