try a different way of identifying previous host for VM
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2023-05-24 12:30:28 +10:00
parent e3ca947ecc
commit cd129feb09

11
main.go
View File

@@ -334,6 +334,16 @@ 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) 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)
} }
// 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] disconnectedHost := disconnectedEvents[0]
log.Printf("First disconnected message indicates that VM was running on host '%s' previously\n", disconnectedHost.Host.Name) log.Printf("First disconnected message indicates that VM was running on host '%s' previously\n", disconnectedHost.Host.Name)
@@ -343,6 +353,7 @@ func main() {
possibleHosts = append(possibleHosts, hostEvent) possibleHosts = append(possibleHosts, hostEvent)
} }
} }
*/
} else { } 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) log.Printf("could not determine previous host for this VM. Filtering all host failures for events prior to VM restart time '%s'\n", vmRestartTime)