Set-​Azure​Site​Recovery​VM

Sets the recovery-side options for a Site Recovery protection entity.

Syntax

Set-AzureSiteRecoveryVM
   [-Name <String>]
   [-PrimaryNic <String>]
   [-Profile <AzureSMProfile>]
   [-RecoveryNetworkId <String>]
   [-Size <String>]
   -VirtualMachine <ASRVirtualMachine>
   [<CommonParameters>]

Description

The Set-AzureSiteRecoveryVM cmdlet sets the recovery-side protection options, such as the recovery virtual machine size and recovery virtual machine network, for Azure Site Recovery protection entities.

Examples

Example 1: Allow the update on a protected virtual machine

PS C:\> $ProtectionContainer = Get-AzureSiteRecoveryProtectionContainer
PS C:\> $VirtualMachines = Get-AzureSiteRecoveryVM -ProtectionContainer $ProtectionContainer 
PS C:\> Set-AzureSiteRecoveryVM -VirtualMachine $VirtualMachines[0] -Name "NewVirtualMachine05"
Name             : 
ID               : 8170d274-1e48-404a-b080-172ada140bc3
ClientRequestId  : 09354052-8430-4fa8-9a35-63196dd4b2b4-2015-02-03 04:19:06Z-P
State            : NotStarted
StateDescription : NotStarted
StartTime        : 
EndTime          : 
AllowedActions   : 
Tasks            : {}
Errors           : {}

The first command uses the Get-AzureSiteRecoveryProtectionContainer cmdlet to get a protected container, and then stores it in the $ProtectionContainer variable.

The second command gets the virtual machines in $ProtectionContainer, by using the Get-AzureSiteRecoveryVM cmdlet, and then stores them in the $VitrualMachines variable.

The final command allows updates for the first virtual machine in the $VitrualMachines array, named NewVirtualMachine05.

Required Parameters

-VirtualMachine

Specifies the Site Recovery virtual machine object.

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

Optional Parameters

-Name

Specifies the name of the target virtual machine.

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

Specifies the primary network adapter card.

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

Specifies the Azure profile from which this cmdlet reads. If you do not specify a profile, this cmdlet reads from the local default profile.

Type:AzureSMProfile
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-RecoveryNetworkId

Specifies the recovery network ID.

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

Specifies the target virtual machine size.

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