Search code examples
powershellreplicationhyper-vdisaster-recovery

Bypass the 24 snapshot limitation in set-vmreplication -RecoveryHistory. (powershell,hyperv replica)


It my first question in here, I work in project to automate hyper-v replica solution.

so my problem is that in powershell

set-vmreplication -RecoveryHistory  

-RecoveryHistory

has 24 like a max value and i want to pypass that my need it's 72.

  1. i try to see the code source but it's in binary i can't do anything in that way (#microsoft : * _ *:).
  2. i post in microsoft forum and nothing

enter image description here the error (in french) it say 72 > 24 that all.

so if someone has a solution or a beginning of solution that will be very helpfull.

thank you all. and have a nice day.


@gvee #gvee

Hi and thank you for your help but...

i test that in my lab and that's not true the ps cmd :

Set-VMReplication VM01 -RecoveryHistory 24 -VSSSnapshotFrequencyHour 4

it does 24 snapshot and every 4 hours it does a synch snapshot and in total i have 24 snapshots( 18 standart ans 6 coherent )

so in final it doesn't solve my initial problem : store more than 24 hours snap with hyper-v replica


Solution

  • It is well documented that 24 is the maximum value allowed for -RecoveryHistory.

    -RecoveryHistory

    Specifies whether to store additional recovery points on the Replica virtual machine. Storing more than the most recent recovery point of the primary virtual machine allows you to recover to an earlier point in time. However, storing additional recovery points requires more storage and processing resources. You can configure as many as 24 recovery points to be stored.

    Based on your comment:

    my need it's more than 24h

    It sounds like you're assuming your interval can only be 24*1hr; which is untrue.

    The 24 snapshots is a fixed maximum; but you can change the frequency the snapshots are taken using the -VSSSnapshotFrequencyHour parameter.

    Specifies the frequency, in hours, at which Volume Shadow Copy Service (VSS) performs a snapshot backup of the virtual machines

    So for example you could do:

    Set-VMReplication VM01 -RecoveryHistory 24 -VSSSnapshotFrequencyHour 4
    

    Effectively that would give you 4 days of history!