logging adjustments
This commit is contained in:
@@ -52,14 +52,14 @@ func (c *CronTask) RunVcenterPoll(ctx context.Context, logger *slog.Logger) erro
|
||||
|
||||
// Skip any vCLS VMs
|
||||
if strings.HasPrefix(vm.Name(), "vCLS-") {
|
||||
c.Logger.Debug("Skipping internal VM", "vm_name", vm.Name())
|
||||
//c.Logger.Debug("Skipping internal VM", "vm_name", vm.Name())
|
||||
continue
|
||||
}
|
||||
|
||||
// TODO - should we compare the UUID as well?
|
||||
for _, dbvm := range results {
|
||||
if dbvm.VmId.String == vm.Reference().Value {
|
||||
c.Logger.Debug("Found match for VM", "vm_name", dbvm.Name, "id", dbvm.VmId.String)
|
||||
//c.Logger.Debug("Found match for VM", "vm_name", dbvm.Name, "id", dbvm.VmId.String)
|
||||
matchFound = true
|
||||
|
||||
// Get the full VM object
|
||||
@@ -78,6 +78,8 @@ func (c *CronTask) RunVcenterPoll(ctx context.Context, logger *slog.Logger) erro
|
||||
if dbvm.VmUuid.String == vmObj.Config.Uuid {
|
||||
// TODO - compare database against current values, create update record if not matching
|
||||
err = c.UpdateVmInventory(vmObj, vc, ctx, dbvm)
|
||||
} else {
|
||||
c.Logger.Error("VM uuid doesn't match database record", "vm_name", dbvm.Name, "id", dbvm.VmId.String, "vc_uuid", vmObj.Config.Uuid, "db_uuid", dbvm.VmUuid.String)
|
||||
}
|
||||
|
||||
break
|
||||
|
Reference in New Issue
Block a user