try a different way of identifying previous host for VM
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
25
main.go
25
main.go
@@ -334,15 +334,26 @@ func main() {
|
||||
log.Printf("%d [%s] VM: %s, Host: %s, Message: %s\n", h.Key, h.CreatedTime.In(location).Format(time.ANSIC), h.Vm.Name, h.Host.Name, h.FullFormattedMessage)
|
||||
}
|
||||
|
||||
disconnectedHost := disconnectedEvents[0]
|
||||
log.Printf("First disconnected message indicates that VM was running on host '%s' previously\n", disconnectedHost.Host.Name)
|
||||
|
||||
// Capture all the failure events for this host
|
||||
for _, hostEvent := range hostFailures {
|
||||
if hostEvent.Host.Name == disconnectedHost.Host.Name {
|
||||
possibleHosts = append(possibleHosts, hostEvent)
|
||||
// Search for any disconnected messages prior to restart time
|
||||
log.Printf("Filtering VmDisconnectedEvent list based on VM restart time %s\n", vmRestartTime)
|
||||
for _, e := range disconnectedEvents {
|
||||
if e.CreatedTime.In(location).Before(vmRestartTime) || e.CreatedTime.In(location).Equal(vmRestartTime) {
|
||||
log.Printf("VM disconnected event on host %s at time %s is applicable\n", e.Host.Name, e.CreatedTime.In(location))
|
||||
possibleHosts = append(possibleHosts, e)
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
disconnectedHost := disconnectedEvents[0]
|
||||
log.Printf("First disconnected message indicates that VM was running on host '%s' previously\n", disconnectedHost.Host.Name)
|
||||
|
||||
// Capture all the failure events for this host
|
||||
for _, hostEvent := range hostFailures {
|
||||
if hostEvent.Host.Name == disconnectedHost.Host.Name {
|
||||
possibleHosts = append(possibleHosts, hostEvent)
|
||||
}
|
||||
}
|
||||
*/
|
||||
} else {
|
||||
log.Printf("could not determine previous host for this VM. Filtering all host failures for events prior to VM restart time '%s'\n", vmRestartTime)
|
||||
|
||||
|
Reference in New Issue
Block a user