Os hosts ESXi 5.5 possuem várias entradas HostDateTimeSystem

2

Eu tenho tentado fazer uma auditoria de distorções de tempo em alguns dos meus hosts recentemente. Usando o PowerCLI, encontrei alguns scripts que fazem referência ao ConfigManager.DateTimeSystem para obter a datetime do ESXi Host. No entanto, alguns hosts parecem ter 2 entradas de tempo / 2 propriedades de HostDateTimeSystem. Às vezes são iguais, às vezes são diferentes.

Os hosts são todos do ESXi 5.5.

Usando: Get-View -ViewType HostSystem - Nome da Propriedade, ConfigManager.DateTimeSystem | classificar Nome | selecione Name, @ {Name="VMHostTime atual"; Expressão = {(Get-View $ _. ConfigManager.DateTimeSystem)}}

Current VMHost Time

7/9/2014 3:55:20 PM

{7/9/2014 3:40:57 PM, 7/9/2014 3:55:20 PM}   <------  Two entries at different times

7/9/2014 3:55:20 PM

7/9/2014 3:55:20 PM

7/9/2014 3:55:20 PM

7/9/2014 3:55:20 PM

{7/9/2014 3:55:20 PM, 7/9/2014 3:42:07 PM}

7/9/2014 3:55:20 PM

7/9/2014 3:55:20 PM

7/9/2014 3:43:16 PM

7/9/2014 3:40:39 PM

7/9/2014 3:41:26 PM

{7/9/2014 3:42:07 PM, 7/9/2014 3:55:20 PM}

7/9/2014 3:43:29 PM

7/9/2014 3:42:37 PM

7/9/2014 3:41:43 PM

7/9/2014 3:42:43 PM

7/9/2014 3:41:25 PM

{7/9/2014 3:40:58 PM, 7/9/2014 3:55:21 PM}

Eliminando a formatação de data real, vejo o seguinte:

Tempo atual do VMHost

VMware.Vim.HostDateTimeSystem

{VMware.Vim.HostDateTimeSystem, VMware.Vim.HostDateTimeSystem}   <--- Two entries for the host time???

VMware.Vim.HostDateTimeSystem

VMware.Vim.HostDateTimeSystem

VMware.Vim.HostDateTimeSystem

VMware.Vim.HostDateTimeSystem

{VMware.Vim.HostDateTimeSystem, VMware.Vim.HostDateTimeSystem}

VMware.Vim.HostDateTimeSystem

VMware.Vim.HostDateTimeSystem

VMware.Vim.HostDateTimeSystem

VMware.Vim.HostDateTimeSystem

VMware.Vim.HostDateTimeSystem

{VMware.Vim.HostDateTimeSystem, VMware.Vim.HostDateTimeSystem}

VMware.Vim.HostDateTimeSystem

VMware.Vim.HostDateTimeSystem

VMware.Vim.HostDateTimeSystem

VMware.Vim.HostDateTimeSystem

VMware.Vim.HostDateTimeSystem

{VMware.Vim.HostDateTimeSystem, VMware.Vim.HostDateTimeSystem}

Alguém tem alguma idéia de por que / como uma mão cheia de hosts tem 2 entradas de tempo? Isso pode ser corrigido para que possamos ter certeza de que os hosts estão configurados para um único horário definitivo?

    
por user230027 09.07.2014 / 20:52

1 resposta

0

Não consegui encontrar nenhum host ESXi exibindo várias datas. Você poderia postar seu script inteiro?

Abaixo está um script PowerCLI para mostrar a distorção de tempo entre os hosts da estação de trabalho, do vcenter e do ESXi. Estou curioso para ver a saída contra seus hosts com vários timestamps:

Clear-Host
$ErrorActionPreference = "Continue"
$DebugPreference = "SilentlyContinue"
$VerbosePreference = "SilentlyContinue"

@"
## get_TIMEDRIFT.ps1 ##########################################################
Usage:        powershell -ExecutionPolicy Bypass -File ./get_TIMEDRIFT.ps1

Version:      1.0 (20140915)

Purpose:      Quickly Display time-drift between Workstation, vCenter, and ESXi
              hosts.  For the purpose of finding ESXi hosts which can cause
              issues if VMs are set to sync time through VMware Tools.
              vCAC/IAAS servers will not work propertly if not in sync with SSO

Requirements: Windows Powershell and running on machine with VI Tools/powercli

History:      09/15/2014  -  Created

###############################################################################
"@

## Virtual Center Server to test for time-drift against.
$VCServer = "VCEN.TEST.LOCAL"

## If running PS1 script from Powershell instead of PowerCLI, load vcen snap-in
$SIval = Get-PSSnapin -Name VMware.VimAutomation.Core '
                      -ErrorAction SilentlyContinue
if (($SIval) -eq $null) { Add-PSSnapin VMware.VimAutomation.Core }

## Logon to vCenter Server, will prompt for name/password if not saved.
Set-PowerCLIConfiguration -InvalidCertificateAction Ignore '
                          -Scope Session '
                          -Confirm:$false
$VC = Connect-VIServer $VCServer
Write-Output "Connected to '$($VC.Name):$($VC.port)' as '$($VC.User)'"

## Get vCenter and LocalSystem timestamps and drift
    # get LocalSystem time
    $_localtime = Get-Date
    $_localtimeUTC = $_localtime.ToUniversalTime()
    # get vCenter time
    $_vctime = $VC.ExtensionData.ServerClock
    $_vctimeUTC = $_vctime.ToUniversalTime() 
    # determine time drift between LocalSystem and vCenter
    $_localdrift = ($_localtimeUTC - $_vctimeUTC).duration()


## Loop through ESX hosts writing output for each
$vmhosts = Get-VMHost
foreach($esx in $vmhosts){
    $esxview = Get-View -viewtype "HostSystem" -Filter @{"Name" = $esx.Name}
    $esxdatetimesystem = $esxview.configmanager.datetimesystem
    $_remote = Get-View -Id $esxdatetimesystem
    $_remotetime = $_remote.QueryDateTime()
    $_remotetimeUTC = $_remotetime.ToUniversalTime()
    $_vctime = $VC.ExtensionData.ServerClock
    $_vctimeUTC = $_vctime.ToUniversalTime()
    $_remotedrift = ($_remotetimeUTC - $_vctimeUTC).duration()
    Write-Output "  $esx Time drift from vCenter in minutes:: '$($_remotedrift.Totalminutes)'"
    }

## Ouput timestamps for Local Workstation, and vCenter Server
Write-Output "  vCenter Server UTC:: $_vctime"
Write-Output "  Workstation (Actual | UTC):: $_localtime | $_localtimeUTC"
Write-Output "  Local workstation Time drift from vCenter in minutes:: '$($_localdrift.Totalminutes)'"

## Disconnect user from vCenter Server
Write-Output "Disconnecting '$($VC.User)' from '$($VC.Name):$($VC.port)'"
Disconnect-VIServer $VC -Confirm:$false

Exemplo de saída abaixo:

Connected to 'VCEN.TEST.LOCAL:443' as 'TEST\FMLast'
  192.168.15.149 Time drift from vCenter in minutes:: '10280.9866862833'
  192.168.15.159 Time drift from vCenter in minutes:: '10281.0125832833'
  192.168.15.167 Time drift from vCenter in minutes:: '10281.0392954333'
  192.168.15.168 Time drift from vCenter in minutes:: '10281.0690222667'
  192.168.15.26 Time drift from vCenter in minutes:: '10281.0986537667'
  192.168.15.24 Time drift from vCenter in minutes:: '10281.1276888833'
  192.168.15.25 Time drift from vCenter in minutes:: '10281.1569679333'
  192.168.15.22 Time drift from vCenter in minutes:: '10281.1863135333'
  192.168.15.27 Time drift from vCenter in minutes:: '10281.2183166667'
  192.168.15.23 Time drift from vCenter in minutes:: '10281.246763'
  vCenter Server UTC:: 09/08/2014 16:38:04
  Workstation (Actual | UTC):: 09/15/2014 15:59:01 | 09/15/2014 19:59:01
  Local workstation Time drift from vCenter in minutes:: '10280.9408839317'
Disconnecting 'TEST\FMLast' from 'VCEN.TEST.LOCAL:443'
    
por 15.09.2014 / 22:11