Jump to content
Welcome to our new Citrix community!
  • 0

Get the time of start and/or shutdown of a VM


Question

5 answers to this question

Recommended Posts

  • 0
23 minutes ago, Tobias Kreidl said:

This should help you out: https://discussions.citrix.com/topic/332593-how-i-can-get-uptime-vm-with-xe-help/

Once it's been shut down, you don't have a way to track that, unfortunately, not via xe at least. There should be a log entry in /var/log and I'm not sure which file would potentially contain start and stop times, but you can grep for it and I'm sure find which one may contain that information.

 

-=Tobias

 

Good evening Tobias,

 

the article doesn't answer exactly my question as there mentioned 

xe vm-list name-label=<VM name> params=start-time

works only for running VM. But another user suggested

xe vm-param-list uuid=<UUID> | grep start-time

so I had a closer look to all returned parameters and I found out - after I checked it for several VM where I know more or less when they have been shutdown - this command is what I was looking for:

 

xe vm-param-list uuid=<UUID> | grep guest-metrics-last-updated

 

As mentioned there the timestamp doesn't consider any daylight savings but for my purposes it's accurate enough.

 

As always Tobias, thank you for the hint into the right direction.

  • Like 1
Link to comment
  • 1

This should help you out: https://discussions.citrix.com/topic/332593-how-i-can-get-uptime-vm-with-xe-help/

Once it's been shut down, you don't have a way to track that, unfortunately, not via xe at least. There should be a log entry in /var/log and I'm not sure which file would potentially contain start and stop times, but you can grep for it and I'm sure find which one may contain that information.

 

-=Tobias

  • Like 1
Link to comment
  • 0
1 hour ago, Peter VARGA1709157052 said:

 

Good evening Tobias,

 

the article doesn't answer exactly my question as there mentioned 


xe vm-list name-label=<VM name> params=start-time

works only for running VM. But another user suggested


xe vm-param-list uuid=<UUID> | grep start-time

so I had a closer look to all returned parameters and I found out - after I checked it for several VM where I know more or less when they have been shutdown - this command is what I was looking for:

 


xe vm-param-list uuid=<UUID> | grep guest-metrics-last-updated

 

As mentioned there the timestamp doesn't consider any daylight savings but for my purposes it's accurate enough.

 

As always Tobias, thank you for the hint into the right direction.

Peter:

Cool, I am very glad that helped you arrive at a solution!

Best regards,

-=Tobias

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...