none
Strange warning trying to set offsetinminutes...

    Question

  • Hello, I wrote this script to cycle through the PGs on a DPM server and set the offset to 15 minutes.  But I get this warning that seems to tell me I'm on the right track but the setting does not update in the GUI:

    Disconnect-DPMServer
    $pgList = Get-ProtectionGroup ws002165
    ForEach($pg in $pgList) {

      $Schedule = Get-DPMPolicySchedule $pg -offsetschedule
     
    Set-DPMPolicySchedule -ProtectionGroup $pg -OffsetInMinutes 15
    }

    PS C:\Users\admweigojmi> \\ws000194\users-06\weigojmi\offset.ps1
    WARNING: Connecting to DPM server: ws002165
    WARNING: This is a recurring schedule and will be rounded off to the nearest acceptable value.
    WARNING: This is a recurring schedule and will be rounded off to the nearest acceptable value.

    Any ideas?  Thanks in advance

    Monday, February 4, 2019 3:57 PM

All replies

  • Hello!

    The default synchronization frequency is 15 minutes, so I believe it just warns you that the value you put will be rounded to one of the following nearest acceptable values:

    • 15 (min)
    • 30 (min)
    • 45 (min)
    • 60 (1 hour)
    • 120 (2 hours)
    • 240 (4 hours)
    • 360 (6 hours)
    • 720 (12 hours)
    • 1440 (24 hours)

    Examples:

    If you would set the OffsetInMinutes to 10, it would be rounded to 15.

    If you would set the OffsetInMinutes to 25, it would be rounded to 30.

    Best regards,
    Leon


    Blog: https://thesystemcenterblog.com LinkedIn:

    Monday, February 4, 2019 4:14 PM
  • OK thanks.  Problem is I set it to 15 and it still warns me...but the bigger issue is the setting doesn't seem to be applying as I don't see it in the gui after.
    Monday, February 4, 2019 5:26 PM
  • Could you provide a screenshot of what you see in the console (GUI)?

    Blog: https://thesystemcenterblog.com LinkedIn:

    Monday, February 4, 2019 6:10 PM
  • Unfortunately my account is not verified still for some reason so I can't upload a pic.  But what I'm seeing is the offset  in minutes box stays at 0 under the PG's "Optimize" button.

    • Edited by weigojmi Monday, February 4, 2019 6:57 PM
    Monday, February 4, 2019 6:35 PM
  • Do note that the offset cannot be greater than the synchronization frequency, so if you have a frequency of 15 minutes, then your offset can be max 15 min.

    I believe this is a GUI bug that it doesn't update the values, I did some testing as well, and also tested by just changing the recovery point times in the DPM shell and they didn't update in the GUI but when checking these values within the DPM shell they returned the correct values.

    So if you run the command below you should get your offset value:

    Get-DPMPolicySchedule -ProtectionGroup $pg -OffsetSchedule


    Blog: https://thesystemcenterblog.com LinkedIn:

    Tuesday, February 5, 2019 9:12 AM
  • Our minimum sync frequency is 2 hrs so I don't think that's the issue when setting it to 15 min. offset.

    If I've checked correctly below, it looks like the offset is actually 0 for each PG I have checked:

    PS Microsoft.PowerShell.Core\FileSystem::\\ws000194\users-06\weigojmi> $Schedule
    0

    PS Microsoft.PowerShell.Core\FileSystem::\\ws000194\users-06\weigojmi> $pg

    Name                             ProtectionMethod     
    ----                             ----------------     
    PG-US-Wooster-9-FileServices_000 Short-term using disk

    To make it cleaner, is there a way to omit the PGs that don't have incremental backups when I get the PGs in the beginning?

    Thanks again for the help!




    • Edited by weigojmi Tuesday, February 5, 2019 3:18 PM
    Tuesday, February 5, 2019 3:18 PM
  • Did you try running the script that you posted in your first post and then check the offset value in the DPM Shell? I tested it in my lab and it successfully changed the offset, but not in the DPM GUI (console).

    I'm actually not sure if it's possible to omit protection groups that don't have incremental backups.


    Blog: https://thesystemcenterblog.com LinkedIn:

    Tuesday, February 5, 2019 6:50 PM
  • Yep, I pasted it in my previous post...shows 0.

    • Edited by weigojmi Tuesday, February 5, 2019 7:27 PM
    Tuesday, February 5, 2019 7:27 PM
  • Hmm did you update the variable $Schedule? As it still seems to contain the old value of "0"


    Blog: https://thesystemcenterblog.com LinkedIn:

    Tuesday, February 5, 2019 8:48 PM
  • So pardon my ignorance as I'm new to scripting but what do you mean by "update"?  I thought if I "broke" the script and checked that variable ($Schedule) after one of the warnings it would show other than 0 if it worked?  So maybe I'm not checking it correctly.  How do I check that offset setting via PS for just 1 PG after the script runs?
    Tuesday, February 5, 2019 10:18 PM
  • By "updating" I mean basically a "refresh", when you run the following:

    $pgList = Get-ProtectionGroup ws002165
    ForEach($pg in $pgList) {
    
      $Schedule = Get-DPMPolicySchedule $pg -offsetschedule
     
    Set-DPMPolicySchedule -ProtectionGroup $pg -OffsetInMinutes 15
    }

    The $Schedule variable will get a value, but after we get the value of the $Schedule variable we make a change to the $pg variable when using the Set-DPMPolicySchedule cmdlet.

    This means that if you now run the $Schedule variable, you will still get the old value (the same value as previously).

    So you will need to "update/refresh" the value of the $Schedule variable by running the following command:

    $Schedule = Get-DPMPolicySchedule $pg -offsetschedule
    Now it should get the latest value from the $pg variable, which should be the offset that you configured with the Set-DPMPolicySchedule cmdlet.


    Blog: https://thesystemcenterblog.com LinkedIn:

    Tuesday, February 5, 2019 10:26 PM
  • OK so I assume that is displaying the current value of $pg which is the PG below.  It is one that should be updated and is still showing 0 so I suppose it isn't working...

    PS Microsoft.PowerShell.Core\FileSystem::\\ws000194\users-06\weigojmi> $Schedule = Get-DPMPolicySchedule $pg -offsetschedule

    PS Microsoft.PowerShell.Core\FileSystem::\\ws000194\users-06\weigojmi> $Schedule
    0

    PS Microsoft.PowerShell.Core\FileSystem::\\ws000194\users-06\weigojmi> $pg

    Name                             ProtectionMethod     
    ----                             ----------------     
    PG-US-Wooster-9-FileServices_000 Short-term using disk

    Wednesday, February 6, 2019 11:57 AM
  • Since I was unsure about needing the $Schedule variable at all I removed the line.  And it seems to give the same results:

    Disconnect-DPMServer
    $pgList = Get-ProtectionGroup ws002165
    ForEach($pg in $pgList) {

    Set-DPMPolicySchedule -ProtectionGroup $pg -OffsetInMinutes 15 
    }

    PS Microsoft.PowerShell.Core\FileSystem::\\ws000194\users-06\weigojmi> \\ws000194\users-06\weigojmi\offset.ps1
    WARNING: Connecting to DPM server: ws002165
    WARNING: This is a recurring schedule and will be rounded off to the nearest acceptable value.
    WARNING: This is a recurring schedule and will be rounded off to the nearest acceptable value.
    Set-DPMPolicySchedule : You can offset synchronization frequency only for incremental backups. (ID: 31217)
    At \\ws000194\users-06\weigojmi\offset.ps1:5 char:1
    + Set-DPMPolicySchedule -ProtectionGroup $pg -OffsetInMinutes 15
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : NotSpecified: (:) [Set-DPMPolicySchedule], DlsException
        + FullyQualifiedErrorId : OffsetValidOnlyForSyncJob,Microsoft.Internal.EnterpriseStorage.Dls.UI.Cmdlet.ProtectionCmdLets.SetPolicyScheduleCmdlet


    Seems like my biggest issue is why I get that warning with the 15 minute setting and 2 hour synch interval and is this why its not updating the values?

    Wednesday, February 6, 2019 4:51 PM
  • Well a warning is not an error, so it should still apply the "nearest value" as it says, but nothing seems to happen.

    I couldn't get this to work with the DPM Shell, is there any reason why you're not using the GUI (if it works)?


    Blog: https://thesystemcenterblog.com LinkedIn:

    Thursday, February 7, 2019 9:10 AM
  • Yes, we have to change this on about 100 DPM servers...

    By the way I found I needed to use this cmd to enable the changing of PG settings: Get-ModifiableProtectionGroup

    Thursday, February 7, 2019 8:40 PM
  • Ah I see, then I fully understand.

    Yes the Get-ModifiableProtectionGroup will make a protection group modifiable, you will then need to use the Set-DPMProtectionGroup to save the changes.

    I did try with these in my lab, but still no luck..


    Blog: https://thesystemcenterblog.com LinkedIn:

    Thursday, February 7, 2019 8:43 PM
  • $DPMServer = Invoke-Command -ComputerName WS002092.schaeffler.com -ScriptBlock {Get-SCSMObject -Class (Get-SCClass -DisplayName 'DPM Server') | select DPMversion,DPMServername,Displayname | Sort-Object Dpmservername}  
    $DPMServerlist = $DPMServer.DisplayName
    
    foreach ($server in $DPMServerlist){
        Disconnect-DPMServer
        $pgList = Get-ProtectionGroup -DPMServerName $server | where {$_.ScheduleOffset -eq '0'} #get the protection groups where offset is set to default/zero
        ForEach($pg in $pgList){
            "$($pg.name)"
            $sched = Get-DPMPolicySchedule $pg -ShortTerm
            if ($sched.scheduletype -match 'sync'){  # allow incremental , and only sync based to avoid errors
                $mpg = Get-ModifiableProtectionGroup $pg                          #gets the protection group in modify mode
                Set-DPMPolicySchedule -ProtectionGroup $mpg -OffsetInMinutes 15 
                Set-ProtectionGroup $mpg -Confirm:$false                          #skips confirming on big locations >120TB
            }
        }
    }

    So ultimately this is the script that worked...
    • Proposed as answer by Leon Laude Saturday, February 9, 2019 9:39 AM
    Friday, February 8, 2019 5:51 PM
  • I ran it in my lab and it does indeed seem to work, great job!

    I haven't really used the offset much so I'm not too familiar with it, but thanks for sharing this with the community, it will definitely come in handy!


    Blog: https://thesystemcenterblog.com LinkedIn:

    Saturday, February 9, 2019 9:39 AM