Reputation: 393
I need to know the uptime of GCP VM instances (windows and Linux both) and based on the time I need to stop the VM. Somehow, I am not getting any simpler way to get the uptime of my all GCP VMs which are like 100 in numbers and will be increasing.
I went through below answer but even there it is not answered, I could not add comment so had to ask new question. Get vm uptime data from stackdriver-agent in gcp?
In the python code snippet at below link, there is no module available for instance uptime all we have is creating uptime check for service availability. https://github.com/GoogleCloudPlatform/python-docs-samples
How can I get uptime of all GCP VM instances ?
Upvotes: 1
Views: 5460
Reputation: 1601
Assuming that you can adjust process of starting VMs, I think solution below is viable:
I realize that it sounds overcomplicated, but I don't see any better OS-independent solution.
Update:
The feature you need is already requested in Google's issue tracker. You can check the progress and\or "start" it here: https://issuetracker.google.com/issues/136105125
Note: the issue referenced above is marked as blocked by another one, non-public
Upvotes: 3
Reputation: 762
for more info check the below document
https://cloud.google.com/monitoring/uptime-checks
Upvotes: 1