Пример #1
0
        /// <summary>
        /// Creates an E2E Protection Profile object
        /// </summary>
        private void EnterpriseToEnterpriseProtectionProfileObject()
        {
            if (string.Compare(this.ReplicationProvider, Constants.HyperVReplica, StringComparison.OrdinalIgnoreCase) != 0)
            {
                throw new InvalidOperationException(
                          string.Format(
                              Properties.Resources.IncorrectReplicationProvider,
                              this.ReplicationProvider));
            }

            PSRecoveryServicesClient.ValidateReplicationStartTime(this.ReplicationStartTime);

            ushort replicationFrequencyInSeconds = PSRecoveryServicesClient.ConvertReplicationFrequencyToUshort(this.ReplicationFrequencyInSeconds);

            ASRProtectionProfile protectionProfile = new ASRProtectionProfile()
            {
                Name = this.Name,
                ReplicationProvider = this.ReplicationProvider,
                HyperVReplicaAzureProviderSettingsObject = null,
                HyperVReplicaProviderSettingsObject      = new HyperVReplicaProviderSettings()
                {
                    ReplicationMethod             = this.ReplicationMethod,
                    ReplicationFrequencyInSeconds = replicationFrequencyInSeconds,
                    RecoveryPoints = this.RecoveryPoints,
                    ApplicationConsistentSnapshotFrequencyInHours = this.ApplicationConsistentSnapshotFrequencyInHours,
                    CompressionEnabled   = this.CompressionEnabled,
                    ReplicationPort      = this.ReplicationPort,
                    Authentication       = this.Authentication,
                    ReplicationStartTime = this.ReplicationStartTime,
                    AllowReplicaDeletion = this.AllowReplicaDeletion
                }
            };

            this.WriteObject(protectionProfile);
        }
Пример #2
0
        /// <summary>
        /// Proceeds to Create an E2A Protection Profile Object after all the validations are done.
        /// </summary>
        private void ProceedToCreateProtectionProfileObject()
        {
            PSRecoveryServicesClient.ValidateReplicationStartTime(this.ReplicationStartTime);

            ushort replicationFrequencyInSeconds =
                PSRecoveryServicesClient.ConvertReplicationFrequencyToUshort(
                    this.ReplicationFrequencyInSeconds);

            ASRProtectionProfile protectionProfile = new ASRProtectionProfile()
            {
                Name = this.Name,
                ReplicationProvider = this.ReplicationProvider,
                HyperVReplicaAzureProviderSettingsObject = new HyperVReplicaAzureProviderSettings()
                {
                    RecoveryAzureSubscription       = this.RecoveryAzureSubscription,
                    RecoveryAzureStorageAccountName = this.RecoveryAzureStorageAccount,
                    //// Currently Data Encryption is not supported.
                    EncryptStoredData             = false,
                    ReplicationFrequencyInSeconds = replicationFrequencyInSeconds,
                    RecoveryPoints = this.RecoveryPoints,
                    ApplicationConsistentSnapshotFrequencyInHours = this.ApplicationConsistentSnapshotFrequencyInHours,
                    ReplicationStartTime = this.ReplicationStartTime,
                },
                HyperVReplicaProviderSettingsObject = null
            };

            this.WriteObject(protectionProfile);
        }