Accepted Solution

Get-NaSnapshot created date incorrect

Since the timezone change in the UK to British Summer Time (UTC+1), Get-NaSnapShot created time has been incorrect when using the Powershell module. On the filer, the date time is correct.

We check snapshots creation date/time against the current time using Powershell when mounting flexclones to other servers. We always want to make sure we have the most recent snap. This verification is no longer working due to the time zone. Note how the time generated by SMSQL during snapshot creation in the snap name is different to that in the AccessTimeDT field.

PS C:\> Get-NaSnapshot SQLmirr_TMLIVESQLCLSTR_UserDB | Format-List

Name : sqlsnap__tmlivesqlclu01_03-27-2012_08.45.35__weekly

AccessTimeDT : 27/03/2012 07:47:47

Busy : False

Dependency :

Total : 603217920

PercentageOfTotalBlocks : 0

PercentageOfUsedBlocks : 0

CumulativeTotal : 2617794560

CumulativePercentageOfTotalBlocks : 0

CumulativePercentageOfUsedBlocks : 0

SnapshotOwnersList :

We could adjust the verification to account for this difference as a workaround, but is there anything that can be done to fix this?


Re: Get-NaSnapshot created date incorrect


I think AccessTimeDT shows the UTC time which has no daylight saving time.

PS H:\> Get-NaSnapshot nas_esxi_data_02 smvi__SMVI_daily_nfs-store02_recent |format-list


Name                              : smvi__SMVI_daily_nfs-store02_recent

AccessTimeDT                      : 28.03.2012 00:16:50

Busy                              : False

Dependency                        : snapvault

Total                             : 6332911616

PercentageOfTotalBlocks           : 0

PercentageOfUsedBlocks            : 2

CumulativeTotal                   : 6332911616

CumulativePercentageOfTotalBlocks : 0

CumulativePercentageOfUsedBlocks  : 2

SnapshotOwnersList                :

You can convert the timezone:

PS H:\> Get-NaSnapshot nas_esxi_data_02 smvi__SMVI_daily_nfs-store02_recent | select name,busy,dependency,total, @{Name="AccessTimeDT2"; Expression={[timezone]::CurrentTimeZone.ToLocalTime(([datetime]'1/1/1970').AddSeconds($_.AccessTime))}} |format-list

Name          : smvi__SMVI_daily_nfs-store02_recent

Busy          : False

Dependency    : snapvault

Total         : 6333468672

AccessTimeDT2 : 28.03.2012 02:16:50

PS H:\>


Re: Get-NaSnapshot created date incorrect

Was hoping I wouldn't have to add code to account for timezone changes but seems there is no other way.