VMware Cloud Community
darrellr
Contributor
Contributor
Jump to solution

History of vmotion events

I'm hoping someone can advise on a method for collating the history if migration events for a particular guest for the past 6 months.

I have a certain amount of history available in VCenter and have amended the Client Settings/Lists settings to the maximum (1000), however this only givesme around 2 months history and I need to get the timings of all migration events going back to beginning of August.

What logs are available and the best way to interrogate for a single guest?

Thanks in advance.

Tags (1)
0 Kudos
1 Solution

Accepted Solutions
jdptechnc
Expert
Expert
Jump to solution

Do you have access to the vCenter SQL database?  If you want something quick and dirty, you can do this with a simple query.  The database should have all tasks scheduled since the vCenter instance was installed.

Something like this:

use VCDB

SELECT [TASK_ID]
      ,[NAME]
      ,[ENTITY_NAME]
      ,[COMPLETE_STATE]
      ,[QUEUE_TIME]
      ,[START_TIME]
      ,[COMPLETE_TIME]
  FROM [vcdb].[dbo].[VPX_TASK]
  where (NAME = 'vim.VirtualMachine.migrate' or NAME = 'vim.VirtualMachine.relocate') AND ENTITY_NAME = 'MY_VM'
  order by START_TIME desc

The "migrate" task is a host migation, the "relocate" task is a datastore migration.

Please consider marking as "helpful", if you find this post useful. Thanks!... IT Guy since 12/2000... Virtual since 10/2006... VCAP-DCA #2222

View solution in original post

0 Kudos
3 Replies
jdptechnc
Expert
Expert
Jump to solution

Do you have access to the vCenter SQL database?  If you want something quick and dirty, you can do this with a simple query.  The database should have all tasks scheduled since the vCenter instance was installed.

Something like this:

use VCDB

SELECT [TASK_ID]
      ,[NAME]
      ,[ENTITY_NAME]
      ,[COMPLETE_STATE]
      ,[QUEUE_TIME]
      ,[START_TIME]
      ,[COMPLETE_TIME]
  FROM [vcdb].[dbo].[VPX_TASK]
  where (NAME = 'vim.VirtualMachine.migrate' or NAME = 'vim.VirtualMachine.relocate') AND ENTITY_NAME = 'MY_VM'
  order by START_TIME desc

The "migrate" task is a host migation, the "relocate" task is a datastore migration.

Please consider marking as "helpful", if you find this post useful. Thanks!... IT Guy since 12/2000... Virtual since 10/2006... VCAP-DCA #2222
0 Kudos
EdWilts
Expert
Expert
Jump to solution

You can check your vmware*.log files on the datastore for a quick and dirty search.  They may or may not go back far enough for you.

grep Hostname vmware*.log

.../Ed (VCP4, VCP5)
darrellr
Contributor
Contributor
Jump to solution

Thanks for the reply. Great for future ref.

Unfortunately task and event retention is set for 60 days so no joy this time.

0 Kudos