@@ -298,7 +298,14 @@ public ASRProtectionContainer(ProtectionContainer pc)
298
298
{
299
299
var asrProtectionProfile = new ASRProtectionProfile ( ) ;
300
300
301
- asrProtectionProfile . AssociationDetail = new List < ASRProtectionProfileAssociationDetails > ( ) ;
301
+ if ( profile . ReplicationProvider == Constants . HyperVReplicaAzure )
302
+ {
303
+ asrProtectionProfile . HyperVReplicaAzureProviderSettingsObject . AssociationDetail = new List < ASRProtectionProfileAssociationDetails > ( ) ;
304
+ }
305
+ else if ( profile . ReplicationProvider == Constants . HyperVReplica )
306
+ {
307
+ asrProtectionProfile . HyperVReplicaProviderSettingsObject . AssociationDetail = new List < ASRProtectionProfileAssociationDetails > ( ) ;
308
+ }
302
309
foreach ( var profileAssosicationDetail in profile . AssociationDetail )
303
310
{
304
311
var asrProfileDetail = new ASRProtectionProfileAssociationDetails ( ) ;
@@ -307,60 +314,68 @@ public ASRProtectionContainer(ProtectionContainer pc)
307
314
profileAssosicationDetail . PrimaryProtectionContainerId ;
308
315
asrProfileDetail . RecoveryProtectionContainerId =
309
316
profileAssosicationDetail . RecoveryProtectionContainerId ;
310
- asrProtectionProfile . AssociationDetail . Add ( asrProfileDetail ) ;
317
+
318
+ if ( profile . ReplicationProvider == Constants . HyperVReplicaAzure )
319
+ {
320
+ asrProtectionProfile . HyperVReplicaAzureProviderSettingsObject . AssociationDetail . Add ( asrProfileDetail ) ;
321
+ }
322
+ else if ( profile . ReplicationProvider == Constants . HyperVReplica )
323
+ {
324
+ asrProtectionProfile . HyperVReplicaProviderSettingsObject . AssociationDetail . Add ( asrProfileDetail ) ;
325
+ }
311
326
}
312
327
313
328
if ( profile . ReplicationProvider == Constants . HyperVReplicaAzure )
314
329
{
315
330
var details = DataContractUtils < HyperVReplicaAzureProtectionProfileDetails > . Deserialize (
316
331
profile . ReplicationProviderSetting ) ;
317
332
318
- asrProtectionProfile . AllowReplicaDeletion = false ;
319
- asrProtectionProfile . ReplicationPort = 0 ;
333
+ asrProtectionProfile . HyperVReplicaAzureProviderSettingsObject . AllowReplicaDeletion = false ;
334
+ asrProtectionProfile . HyperVReplicaAzureProviderSettingsObject . ReplicationPort = 0 ;
320
335
321
- asrProtectionProfile . ApplicationConsistentSnapshotFrequencyInHours =
336
+ asrProtectionProfile . HyperVReplicaAzureProviderSettingsObject . ApplicationConsistentSnapshotFrequencyInHours =
322
337
details . AppConsistencyFreq ;
323
- asrProtectionProfile . RecoveryAzureStorageAccountName =
338
+ asrProtectionProfile . HyperVReplicaAzureProviderSettingsObject . RecoveryAzureStorageAccountName =
324
339
details . ActiveStorageAccount . StorageAccountName ;
325
- asrProtectionProfile . RecoveryAzureSubscription =
340
+ asrProtectionProfile . HyperVReplicaAzureProviderSettingsObject . RecoveryAzureSubscription =
326
341
details . ActiveStorageAccount . SubscriptionId ;
327
- asrProtectionProfile . ReplicationFrequencyInSeconds = details . ReplicationInterval ;
328
- asrProtectionProfile . ReplicationMethod = details . OnlineIrStartTime . HasValue ?
342
+ asrProtectionProfile . HyperVReplicaAzureProviderSettingsObject . ReplicationFrequencyInSeconds = details . ReplicationInterval ;
343
+ asrProtectionProfile . HyperVReplicaAzureProviderSettingsObject . ReplicationMethod = details . OnlineIrStartTime . HasValue ?
329
344
Constants . OnlineReplicationMethod :
330
345
Constants . OfflineReplicationMethod ;
331
- asrProtectionProfile . ReplicationStartTime = details . OnlineIrStartTime ;
332
- asrProtectionProfile . CompressionEnabled = details . IsEncryptionEnabled ;
333
- asrProtectionProfile . RecoveryPoints
346
+ asrProtectionProfile . HyperVReplicaAzureProviderSettingsObject . ReplicationStartTime = details . OnlineIrStartTime ;
347
+ asrProtectionProfile . HyperVReplicaAzureProviderSettingsObject . CompressionEnabled = details . IsEncryptionEnabled ;
348
+ asrProtectionProfile . HyperVReplicaAzureProviderSettingsObject . RecoveryPoints
334
349
= details . RecoveryPointHistoryDuration ;
350
+
351
+ asrProtectionProfile . HyperVReplicaAzureProviderSettingsObject . CanDissociate = profile . CanDissociate ;
352
+
335
353
}
336
354
else if ( profile . ReplicationProvider == Constants . HyperVReplica )
337
355
{
338
356
var details = DataContractUtils < HyperVReplicaProtectionProfileDetails > . Deserialize (
339
357
profile . ReplicationProviderSetting ) ;
340
358
341
- asrProtectionProfile . AllowReplicaDeletion =
359
+ asrProtectionProfile . HyperVReplicaProviderSettingsObject . AllowReplicaDeletion =
342
360
details . VmAutoDeleteOption == "OnRecoveryCloud" ;
343
- asrProtectionProfile . ApplicationConsistentSnapshotFrequencyInHours =
361
+ asrProtectionProfile . HyperVReplicaProviderSettingsObject . ApplicationConsistentSnapshotFrequencyInHours =
344
362
details . AppConsistencyFreq ;
345
363
346
- asrProtectionProfile . CompressionEnabled = details . IsCompressionEnabled ;
364
+ asrProtectionProfile . HyperVReplicaProviderSettingsObject . CompressionEnabled = details . IsCompressionEnabled ;
365
+ asrProtectionProfile . HyperVReplicaProviderSettingsObject . ReplicationFrequencyInSeconds = 0 ;
347
366
348
- asrProtectionProfile . RecoveryAzureStorageAccountName = null ;
349
- asrProtectionProfile . RecoveryAzureSubscription = null ;
350
- asrProtectionProfile . ReplicationFrequencyInSeconds = 0 ;
351
-
352
- asrProtectionProfile . RecoveryPoints = details . NosOfRps ;
353
- asrProtectionProfile . ReplicationMethod = details . IsOnlineIr ?
367
+ asrProtectionProfile . HyperVReplicaProviderSettingsObject . RecoveryPoints = details . NosOfRps ;
368
+ asrProtectionProfile . HyperVReplicaProviderSettingsObject . ReplicationMethod = details . IsOnlineIr ?
354
369
Constants . OnlineReplicationMethod :
355
370
Constants . OfflineReplicationMethod ;
356
- asrProtectionProfile . ReplicationPort = details . RecoveryHttpsPort ;
357
- asrProtectionProfile . ReplicationStartTime = details . OnlineIrStartTime ;
371
+ asrProtectionProfile . HyperVReplicaProviderSettingsObject . ReplicationPort = details . RecoveryHttpsPort ;
372
+ asrProtectionProfile . HyperVReplicaProviderSettingsObject . ReplicationStartTime = details . OnlineIrStartTime ;
373
+ asrProtectionProfile . HyperVReplicaProviderSettingsObject . CanDissociate = profile . CanDissociate ;
358
374
}
359
375
360
376
asrProtectionProfile . ID = profile . ID ;
361
377
asrProtectionProfile . Name = profile . Name ;
362
378
asrProtectionProfile . ReplicationProvider = profile . ReplicationProvider ;
363
- asrProtectionProfile . CanDissociate = profile . CanDissociate ;
364
379
365
380
this . AvailableProtectionProfiles . Add ( asrProtectionProfile ) ;
366
381
}
@@ -495,6 +510,108 @@ public ASRProtectionProfile(ProtectionProfile protectionProfile)
495
510
/// </summary>
496
511
public string ReplicationProvider { get ; set ; }
497
512
513
+ /// <summary>
514
+ /// Gets or sets HyperVReplicaProviderSettings
515
+ /// </summary>
516
+ public HyperVReplicaProviderSettings HyperVReplicaProviderSettingsObject { get ; set ; }
517
+
518
+ /// <summary>
519
+ /// Gets or sets HyperVReplicaAzureProviderSettings
520
+ /// </summary>
521
+ public HyperVReplicaAzureProviderSettings HyperVReplicaAzureProviderSettingsObject { get ; set ; }
522
+
523
+ #endregion Properties
524
+ }
525
+
526
+ /// <summary>
527
+ /// Azure Site Recovery Protection Profile HyperVReplicaProviderSettings.
528
+ /// </summary>
529
+ [ SuppressMessage (
530
+ "Microsoft.StyleCop.CSharp.MaintainabilityRules" ,
531
+ "SA1402:FileMayOnlyContainASingleClass" ,
532
+ Justification = "Keeping all related objects together." ) ]
533
+ public class HyperVReplicaProviderSettings
534
+ {
535
+ /// <summary>
536
+ /// Initializes a new instance of the <see cref="HyperVReplicaProviderSettings" /> class.
537
+ /// </summary>
538
+ public HyperVReplicaProviderSettings ( )
539
+ {
540
+ }
541
+
542
+ #region Properties
543
+
544
+ /// <summary>
545
+ /// Gets or sets Replication Method.
546
+ /// </summary>
547
+ public string ReplicationMethod { get ; set ; }
548
+
549
+ /// <summary>
550
+ /// Gets or sets a value indicating whether profile can be dissociated or not.
551
+ /// </summary>
552
+ public bool CanDissociate { get ; set ; }
553
+
554
+ /// <summary>
555
+ /// Gets or sets Association Details.
556
+ /// </summary>
557
+ public List < ASRProtectionProfileAssociationDetails > AssociationDetail { get ; set ; }
558
+
559
+ /// <summary>
560
+ /// Gets or sets Replication Frequency in seconds.
561
+ /// </summary>
562
+ public int ReplicationFrequencyInSeconds { get ; set ; }
563
+
564
+ /// <summary>
565
+ /// Gets or sets Recovery Points.
566
+ /// </summary>
567
+ public int RecoveryPoints { get ; set ; }
568
+
569
+ /// <summary>
570
+ /// Gets or sets Application Consistent Snapshot Frequency in hours.
571
+ /// </summary>
572
+ public int ApplicationConsistentSnapshotFrequencyInHours { get ; set ; }
573
+
574
+ /// <summary>
575
+ /// Gets or sets a value indicating whether Compression is Enabled.
576
+ /// </summary>
577
+ public bool CompressionEnabled { get ; set ; }
578
+
579
+ /// <summary>
580
+ /// Gets or sets the replication port.
581
+ /// </summary>
582
+ public int ReplicationPort { get ; set ; }
583
+
584
+ /// <summary>
585
+ /// Gets or sets Replication Start Time.
586
+ /// </summary>
587
+ public TimeSpan ? ReplicationStartTime { get ; set ; }
588
+
589
+ /// <summary>
590
+ /// Gets or sets a value indicating whether Replica Deletion should be enabled.
591
+ /// </summary>
592
+ public bool AllowReplicaDeletion { get ; set ; }
593
+
594
+ #endregion
595
+ }
596
+
597
+ /// <summary>
598
+ /// Azure Site Recovery Protection Profile HyperVReplicaAzureProviderSettings.
599
+ /// </summary>
600
+ [ SuppressMessage (
601
+ "Microsoft.StyleCop.CSharp.MaintainabilityRules" ,
602
+ "SA1402:FileMayOnlyContainASingleClass" ,
603
+ Justification = "Keeping all related objects together." ) ]
604
+ public class HyperVReplicaAzureProviderSettings
605
+ {
606
+ /// <summary>
607
+ /// Initializes a new instance of the <see cref="HyperVReplicaAzureProviderSettings" /> class.
608
+ /// </summary>
609
+ public HyperVReplicaAzureProviderSettings ( )
610
+ {
611
+ }
612
+
613
+ #region Properties
614
+
498
615
/// <summary>
499
616
/// Gets or sets Replication Method.
500
617
/// </summary>
0 commit comments