Editar

Partilhar via


Update-AzRecoveryServicesAsrProtectionDirection

Updates the replication direction for the specified replication protected item or recovery plan. Used to re-protect/reverse replicate a failed over replicated item or recovery plan.

Syntax

Update-AzRecoveryServicesAsrProtectionDirection
      -ReplicationProtectedItem <ASRReplicationProtectedItem>
      -Direction <String>
      [-DefaultProfile <IAzureContextContainer>]
      [-WhatIf]
      [-Confirm]
      [<CommonParameters>]
Update-AzRecoveryServicesAsrProtectionDirection
      [-AzureToVMware]
      [-Account <ASRRunAsAccount>]
      -DataStore <ASRDataStore>
      [-MasterTarget <ASRMasterTargetServer>]
      -ProcessServer <ASRProcessServer>
      -ProtectionContainerMapping <ASRProtectionContainerMapping>
      -ReplicationProtectedItem <ASRReplicationProtectedItem>
      -Direction <String>
      -RetentionVolume <ASRRetentionVolume>
      [-DefaultProfile <IAzureContextContainer>]
      [-WhatIf]
      [-Confirm]
      [<CommonParameters>]
Update-AzRecoveryServicesAsrProtectionDirection
      [-VMwareToAzure]
      -Account <ASRRunAsAccount>
      [-MasterTarget <ASRMasterTargetServer>]
      -ProcessServer <ASRProcessServer>
      -ProtectionContainerMapping <ASRProtectionContainerMapping>
      [-LogStorageAccountId <String>]
      [-RecoveryAzureStorageAccountId <String>]
      -ReplicationProtectedItem <ASRReplicationProtectedItem>
      -Direction <String>
      [-DefaultProfile <IAzureContextContainer>]
      [-WhatIf]
      [-Confirm]
      [<CommonParameters>]
Update-AzRecoveryServicesAsrProtectionDirection
      [-ReplicateAzureToVMware]
      -ProtectionContainerMapping <ASRProtectionContainerMapping>
      -DataStoreName <String>
      -ApplianceName <String>
      -Fabric <ASRFabric>
      -LogStorageAccountId <String>
      -ReplicationProtectedItem <ASRReplicationProtectedItem>
      -Direction <String>
      [-DefaultProfile <IAzureContextContainer>]
      [-WhatIf]
      [-Confirm]
      [<CommonParameters>]
Update-AzRecoveryServicesAsrProtectionDirection
      [-ReplicateVMwareToAzure]
      -SiteId <String>
      -CredentialsToAccessVm <String>
      -ProtectionContainerMapping <ASRProtectionContainerMapping>
      -ApplianceName <String>
      -Fabric <ASRFabric>
      -ReplicationProtectedItem <ASRReplicationProtectedItem>
      -Direction <String>
      [-DefaultProfile <IAzureContextContainer>]
      [-WhatIf]
      [-Confirm]
      [<CommonParameters>]
Update-AzRecoveryServicesAsrProtectionDirection
      [-HyperVToAzure]
      [-LogStorageAccountId <String>]
      [-RecoveryAzureStorageAccountId <String>]
      -ReplicationProtectedItem <ASRReplicationProtectedItem>
      -Direction <String>
      [-DefaultProfile <IAzureContextContainer>]
      [-WhatIf]
      [-Confirm]
      [<CommonParameters>]
Update-AzRecoveryServicesAsrProtectionDirection
      [-VmmToVmm]
      -ReplicationProtectedItem <ASRReplicationProtectedItem>
      -Direction <String>
      [-DefaultProfile <IAzureContextContainer>]
      [-WhatIf]
      [-Confirm]
      [<CommonParameters>]
Update-AzRecoveryServicesAsrProtectionDirection
      [-AzureToAzure]
      -ProtectionContainerMapping <ASRProtectionContainerMapping>
      -LogStorageAccountId <String>
      [-RecoveryAzureStorageAccountId <String>]
      -ReplicationProtectedItem <ASRReplicationProtectedItem>
      [-RecoveryResourceGroupId <String>]
      [-RecoveryCloudServiceId <String>]
      [-RecoveryAvailabilitySetId <String>]
      [-RecoveryProximityPlacementGroupId <String>]
      [-RecoveryVirtualMachineScaleSetId <String>]
      [-RecoveryCapacityReservationGroupId <String>]
      [-RecoveryBootDiagStorageAccountId <String>]
      [-DiskEncryptionVaultId <String>]
      [-DiskEncryptionSecretUrl <String>]
      [-KeyEncryptionKeyUrl <String>]
      [-KeyEncryptionVaultId <String>]
      [-DefaultProfile <IAzureContextContainer>]
      [-WhatIf]
      [-Confirm]
      [<CommonParameters>]
Update-AzRecoveryServicesAsrProtectionDirection
      [-AzureToAzure]
      -ProtectionContainerMapping <ASRProtectionContainerMapping>
      -AzureToAzureDiskReplicationConfiguration <ASRAzuretoAzureDiskReplicationConfig[]>
      -ReplicationProtectedItem <ASRReplicationProtectedItem>
      [-RecoveryResourceGroupId <String>]
      [-RecoveryCloudServiceId <String>]
      [-RecoveryAvailabilitySetId <String>]
      [-RecoveryProximityPlacementGroupId <String>]
      [-RecoveryVirtualMachineScaleSetId <String>]
      [-RecoveryCapacityReservationGroupId <String>]
      [-RecoveryBootDiagStorageAccountId <String>]
      [-DiskEncryptionVaultId <String>]
      [-DiskEncryptionSecretUrl <String>]
      [-KeyEncryptionKeyUrl <String>]
      [-KeyEncryptionVaultId <String>]
      [-DefaultProfile <IAzureContextContainer>]
      [-WhatIf]
      [-Confirm]
      [<CommonParameters>]
Update-AzRecoveryServicesAsrProtectionDirection
      -RecoveryPlan <ASRRecoveryPlan>
      -Direction <String>
      [-DefaultProfile <IAzureContextContainer>]
      [-WhatIf]
      [-Confirm]
      [<CommonParameters>]
Update-AzRecoveryServicesAsrProtectionDirection
      -Direction <String>
      [-DefaultProfile <IAzureContextContainer>]
      [-WhatIf]
      [-Confirm]
      [<CommonParameters>]

Description

The Update-AzRecoveryServicesAsrProtectionDirection cmdlet updates the replication direction for the specified Azure Site Recovery object after the completion of a commit failover operation.

Examples

Example 1

$currentJob = Update-AzRecoveryServicesAsrProtectionDirection -RecoveryPlan $RP -Direction PrimaryToRecovery

Start the update direction operation for the specified recovery plan and returns the ASR job object used to track the operation.

Example 2

$currentJob = Update-AzRecoveryServicesAsrProtectionDirection -AzureToAzure -ProtectionContainerMapping $B2ApcmMapping -LogStorageAccountId $cacheStorageId `
 -ReplicationProtectedItem $rpi

Start the update direction operation for the specified replication protected item in target azure region defined by protection container mapping and using cache storage (in same region as VM).

Example 3

$currentJob = Update-AzRecoveryServicesAsrProtectionDirection -AzureToAzure -ProtectionContainerMapping $B2ApcmMapping `
 -AzureToAzureDiskReplicationConfiguration $disk1,$disk2 -ReplicationProtectedItem  $rpi

Start the update direction operation for the specified replication protected item in target azure region defined by protection container mapping and provided disk replication configuration.

Example 4

$currentJob = Update-AzRecoveryServicesAsrProtectionDirection -AzureToAzure -ProtectionContainerMapping $B2ApcmMapping `
 -AzureToAzureDiskReplicationConfiguration $disk1,$disk2 -ReplicationProtectedItem  $rpi `
 -DiskEncryptionVaultId  $DiskEncryptionVaultId -DiskEncryptionSecretUrl $DiskEncryptionSecertUrl `
 -KeyEncryptionVaultId $KeyEncryptionVaultId  -KeyEncryptionKeyUrl $KeyEncryptionKeyUrl

Start the update direction operation for the specified encrypted replication protected item in target azure region defined by protection container mapping and provided disk replication configuration.

Example 5

$currentJob = Update-AzRecoveryServicesAsrProtectionDirection -AzureToAzure -ProtectionContainerMapping $B2ApcmMapping -LogStorageAccountId $cacheStorageId `
 -ReplicationProtectedItem $rpi -RecoveryProximityPlacementGroupId $ppg

Start the update direction operation for the specified replication protected item in target azure region defined by protection container mapping and using cache storage (in same region as VM) and proximity placement group.

Example 6

$currentJob = Update-AzRecoveryServicesAsrProtectionDirection -AzureToAzure -ProtectionContainerMapping $B2ApcmMapping -LogStorageAccountId $cacheStorageId `
 -ReplicationProtectedItem $rpi -RecoveryVirtualMachineScaleSetId $vmss

Start the update direction operation for the specified replication protected item in target azure region defined by protection container mapping and using cache storage (in same region as VM) and virtual machine scale set.

Parameters

-Account

The run as account to be used to push install the Mobility service if needed. Must be one from the list of run as accounts in the ASR fabric.

Type:ASRRunAsAccount
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-ApplianceName

Specifies the name of appliance to be used to replicate this machine.

Type:String
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-AzureToAzure

Specifies the Azure to Azure disaster recovery.

Type:SwitchParameter
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-AzureToAzureDiskReplicationConfiguration

Specifies the disk configuration for disaster recovery.

Type:ASRAzuretoAzureDiskReplicationConfig[]
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-AzureToVMware

Specifies the switch azure to vMWare scenario.

Type:SwitchParameter
Position:0
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-Confirm

Prompts you for confirmation before running the cmdlet.

Type:SwitchParameter
Aliases:cf
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-CredentialsToAccessVm

Specifies the name of credentials to be used to push install the Mobility service on source machine if needed.

Type:String
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-DataStore

The VMware data-store to be used for the vmdisk's.

Type:ASRDataStore
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-DataStoreName

Name of the VMware data store to be used for the VM disk's.

Type:String
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-DefaultProfile

The credentials, account, tenant, and subscription used for communication with Azure.

Type:IAzureContextContainer
Aliases:AzContext, AzureRmContext, AzureCredential
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Direction

Specifies the direction to be used for the update operation post a failover. The acceptable values for this parameter are:

  • PrimaryToRecovery
  • RecoveryToPrimary
Type:String
Accepted values:PrimaryToRecovery, RecoveryToPrimary
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-DiskEncryptionSecretUrl

Specifies the disk encryption secret URL with version(Azure disk encryption) to be used be recovery VM after failover.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-DiskEncryptionVaultId

Specifies the disk encryption secret vault ID(Azure disk encryption) to be used be recovery VM after failover.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Fabric

Specifies the ASR Fabric object.

Type:ASRFabric
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-HyperVToAzure

Reprotect a Hyper-V virtual machine after failback.

Type:SwitchParameter
Position:0
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-KeyEncryptionKeyUrl

Specifies the disk encryption key URL(Azure disk encryption) to be used be recovery VM after failover.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-KeyEncryptionVaultId

Specifies the disk encryption key keyVault ID(Azure disk encryption) to be used be recovery VM after failover.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-LogStorageAccountId

Specifies the storage account ID to store the replication log of VMs.

Type:String
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-MasterTarget

Master Target Server Details.

Type:ASRMasterTargetServer
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-ProcessServer

Process Server to be used for replication.

Type:ASRProcessServer
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-ProtectionContainerMapping

Protection containerMapping to be used for replication.

Type:ASRProtectionContainerMapping
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-RecoveryAvailabilitySetId

The availability set that the virtual machine should be created in upon failover

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-RecoveryAzureStorageAccountId

Specifies the ID of the Azure storage account to replicate to.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-RecoveryBootDiagStorageAccountId

Specifies the storage account for boot diagnostics for recovery azure VM.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-RecoveryCapacityReservationGroupId

Specify the capacity reservation group Id to be used by the failover VM in target recovery region.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-RecoveryCloudServiceId

The resource ID of the recovery cloud service to failover this virtual machine to.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-RecoveryPlan

Specifies an ASR recovery plan object.

Type:ASRRecoveryPlan
Position:Named
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-RecoveryProximityPlacementGroupId

The resource ID of the recovery proximity placement group to failover this virtual machine to.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-RecoveryResourceGroupId

Recovery resourceGroup id for protected Vm.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-RecoveryVirtualMachineScaleSetId

Specifies the reccovery virtual machine scale set id.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-ReplicateAzureToVMware

Switch parameter specifying Azure to VMware replication scenario..

Type:SwitchParameter
Position:0
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-ReplicateVMwareToAzure

Switch parameter specifying VMware to Azure replication scenario..

Type:SwitchParameter
Position:0
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-ReplicationProtectedItem

Specifies an ASR replication protected item.

Type:ASRReplicationProtectedItem
Position:Named
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-RetentionVolume

Retention Volume on the master target server to be used.

Type:ASRRetentionVolume
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-SiteId

Specifies the VMware site Id where the protectable item was discovered. Use site Id from fabric specific details in the ASR fabric to specify one.

Type:String
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-VmmToVmm

Update replication direction for a failed over Hyper-V virtual machine that is protected between two VMM managed Hyper-V sites.

Type:SwitchParameter
Position:0
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-VMwareToAzure

Update replication direction from VMware to Azure.

Type:SwitchParameter
Position:0
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Type:SwitchParameter
Aliases:wi
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

Inputs

ASRRecoveryPlan

ASRReplicationProtectedItem

Outputs

ASRJob