Add-AzResourceMoverMoveResource
Skapar eller uppdaterar en flyttresurs i flyttsamlingen.
Kommandot "Add-AzResourceMoverMoveResource" förblir detsamma för flyttsamlingar av typen "RegionToRegion" och "RegionToZone".
Syntax
Add-AzResourceMoverMoveResource
-MoveCollectionName <String>
-Name <String>
-ResourceGroupName <String>
[-SubscriptionId <String>]
[-DependsOnOverride <IMoveResourceDependencyOverride[]>]
[-ExistingTargetId <String>]
[-ResourceSetting <IResourceSettings>]
[-SourceId <String>]
[-DefaultProfile <PSObject>]
[-AsJob]
[-NoWait]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Description
Skapar eller uppdaterar en flyttresurs i flyttsamlingen.
Kommandot "Add-AzResourceMoverMoveResource" förblir detsamma för flyttsamlingar av typen "RegionToRegion" och "RegionToZone".
Exempel
Exempel 1: Lägg till en resurs i flyttsamlingen. (RegionToRegion)
$targetResourceSettingsObj = New-Object Microsoft.Azure.PowerShell.Cmdlets.ResourceMover.Models.Api20230801.VirtualMachineResourceSettings
$targetResourceSettingsObj.ResourceType = "Microsoft.Compute/virtualMachines"
$targetResourceSettingsObj.TargetResourceName = "PSDemoVM"
Add-AzResourceMoverMoveResource -ResourceGroupName "RG-MoveCollection-demoRMS" -MoveCollectionName "PS-centralus-westcentralus-demoRMS" -SourceId "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/PSDemoRM/providers/Microsoft.Compute/virtualMachines/PSDemoVM" -Name "PSDemoVM" -ResourceSetting $targetResourceSettingsObj
DependsOn : {}
DependsOnOverride : {}
ErrorsPropertiesCode :
ErrorsPropertiesDetail :
ErrorsPropertiesMessage :
ErrorsPropertiesTarget :
ExistingTargetId :
Id : /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/RG-MoveCollection-demoRMS/providers/Microsoft.Migrate/moveCollections/PS-centralus-westcentralus-demoRMS/moveResources/PSDemoVM
IsResolveRequired : False
JobStatusJobName :
JobStatusJobProgress :
MoveStatusErrorsPropertiesCode : DependencyComputationPending
MoveStatusErrorsPropertiesDetail : {}
MoveStatusErrorsPropertiesMessage : The dependency computation is not completed for resource - /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/PSDemoRM/providers/Microsoft.Compute/virtualMachines/PSDemoVM. Possible Causes: Dependency computation is pending for resource. Recommended Action: Validate dependencies to compute the dependencies.
MoveStatusErrorsPropertiesTarget :
MoveStatusMoveState : PreparePending
Name : PSDemoVM
ProvisioningState : Succeeded
ResourceSetting : Microsoft.Azure.PowerShell.Cmdlets.ResourceMover.Models.Api20230801.VirtualMachineResourceSettings
SourceId : /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/PSDemoRM/providers/Microsoft.Compute/virtualMachines/PSDemoVM
SourceResourceSetting : Microsoft.Azure.PowerShell.Cmdlets.ResourceMover.Models.Api20230801.VirtualMachineResourceSettings
SystemDataCreatedAt :
SystemDataCreatedBy :
SystemDataCreatedByType :
SystemDataLastModifiedAt :
SystemDataLastModifiedBy :
SystemDataLastModifiedByType :
TargetId :
Type :
Lägg till en resurs i "RegionToRegion"-typen Flytta samling.
Exempel 2: Lägg till en resurs i flyttsamlingen. (RegionToZone)
$targetResourceSettingsObj = New-Object Microsoft.Azure.PowerShell.Cmdlets.ResourceMover.Models.Api20230801.VirtualMachineResourceSettings
$targetResourceSettingsObj.ResourceType = "Microsoft.Compute/virtualMachines"
$targetResourceSettingsObj.TargetResourceName = "demo-RegionToZone-VM-Target"
$targetResourceSettingsObj.TargetAvailabilityZone = "1"
Add-AzResourceMoverMoveResource -ResourceGroupName "RG-MoveCollection-demoRMS" -MoveCollectionName "PS-demo-RegionToZone" -SourceId "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/PS-demo-RegionToZone-RG/providers/Microsoft.Compute/virtualMachines/demo-RegionToZone-VM" -Name "PSDemoVM-RegionToZone" -ResourceSetting $targetResourceSettingsObj
DependsOn : {}
DependsOnOverride : {}
ErrorsPropertiesCode :
ErrorsPropertiesDetail :
ErrorsPropertiesMessage :
ErrorsPropertiesTarget :
ExistingTargetId :
Id : /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/RG-MoveCollection-demoRMS/providers/Microsoft.Migrate/moveCollection
s/PS-demo-RegionToZone/moveResources/PSDemoVM-RegionToZone
IsResolveRequired : False
JobStatusJobName :
JobStatusJobProgress :
MoveStatusErrorsPropertiesCode : DependencyComputationPending
MoveStatusErrorsPropertiesDetail : {Microsoft.Azure.PowerShell.Cmdlets.ResourceMover.Models.Api20230801.MoveResourceErrorBody,
Microsoft.Azure.PowerShell.Cmdlets.ResourceMover.Models.Api20230801.MoveResourceErrorBody}
MoveStatusErrorsPropertiesMessage : The dependency computation is not completed for resource - /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/PS-demo-R
egionToZone-RG/providers/Microsoft.Compute/virtualMachines/demo-RegionToZone-VM'.
Possible Causes: Dependency computation is pending for resource.
Recommended Action: Validate dependencies to compute the dependencies.
MoveStatusErrorsPropertiesTarget :
MoveStatusMoveState : MovePending
Name : PSDemoVM-RegionToZone
ProvisioningState : Succeeded
ResourceSetting : Microsoft.Azure.PowerShell.Cmdlets.ResourceMover.Models.Api20230801.VirtualMachineResourceSettings
SourceId : /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/PS-demo-RegionToZone-RG/providers/Microsoft.Compute/virtualMachines/
demo-RegionToZone-VM
SourceResourceSetting : Microsoft.Azure.PowerShell.Cmdlets.ResourceMover.Models.Api20230801.VirtualMachineResourceSettings
SystemDataCreatedAt : 9/5/2023 11:13:46 AM
SystemDataCreatedBy : xxxxxxx
SystemDataCreatedByType : User
SystemDataLastModifiedAt : 9/5/2023 11:13:46 AM
SystemDataLastModifiedBy : xxxxxxx
SystemDataLastModifiedByType : User
TargetId :
Type :
Lägg till en resurs i "RegionToZone"-typen Flytta samling.
Exempel 3: Lägg till en resurs i flyttsamlingen som har en befintlig målresurs. (RegionToRegion)
Add-AzResourceMoverMoveResource -ResourceGroupName "RG-MoveCollection-demoRMS" -MoveCollectionName "PS-centralus-westcentralus-demoRMS" -SourceId "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourcegroups/psdemorm" -Name "psdemorm" -ExistingTargetId "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourcegroups/PSDemoRM-target"
DependsOn : {}
DependsOnOverride : {}
ErrorsPropertiesCode :
ErrorsPropertiesDetail :
ErrorsPropertiesMessage :
ErrorsPropertiesTarget :
ExistingTargetId : /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourcegroups/PSDemoRM-target
Id : /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/RG-MoveCollection-demoRMS/providers/Microsoft.Migrate/moveCollections/PS-centralus-westcentralus-demoRMS/moveResources/psdemorm
IsResolveRequired : False
JobStatusJobName :
JobStatusJobProgress :
MoveStatusErrorsPropertiesCode :
MoveStatusErrorsPropertiesDetail :
MoveStatusErrorsPropertiesMessage :
MoveStatusErrorsPropertiesTarget :
MoveStatusMoveState : CommitPending
Name : psdemorm
ProvisioningState : Succeeded
ResourceSetting : Microsoft.Azure.PowerShell.Cmdlets.ResourceMover.Models.Api20230801.ResourceSettings
SourceId : /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourcegroups/psdemorm
SourceResourceSetting : Microsoft.Azure.PowerShell.Cmdlets.ResourceMover.Models.Api20230801.ResourceSettings
SystemDataCreatedAt :
SystemDataCreatedBy :
SystemDataCreatedByType :
SystemDataLastModifiedAt :
SystemDataLastModifiedBy :
SystemDataLastModifiedByType :
TargetId :
Type :
Lägg till en resurs i Typen RegionToRegion Flytta samling som har en befintlig målresurs.
Exempel 4: Lägg till en resurs i flyttsamlingen som har en befintlig målresurs. (RegionToZone)
Add-AzResourceMoverMoveResource -ResourceGroupName "RG-MoveCollection-demoRMS" -MoveCollectionName "PS-demo-RegionToZone" -SourceId "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourcegroups/PS-demo-RegionToZone-RG/providers/Microsoft.Network/networkinterfaces/nic_demo-RegionToZone-VM" -Name "PSDemoNIC-RegionToZone" -ExistingTargetId "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourcegroups/PS-demo-Existing/providers/Microsoft.Network/networkinterfaces/nic-demo-existing-target"
DependsOn : {}
DependsOnOverride : {}
ErrorsPropertiesCode :
ErrorsPropertiesDetail :
ErrorsPropertiesMessage :
ErrorsPropertiesTarget :
ExistingTargetId : /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourcegroups/PS-demo-Existing/providers/Microsoft.Network/networkinterfaces/nic-demo-existing-target
Id : /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/RG-MoveCollection-demoRMS/providers/Microsoft.Migrate/moveCollections/PS-demo-RegionToZone/moveResources/PSDemoNIC-RegionToZone
IsResolveRequired : False
JobStatusJobName :
JobStatusJobProgress :
MoveStatusErrorsPropertiesCode :
MoveStatusErrorsPropertiesDetail :
MoveStatusErrorsPropertiesMessage :
MoveStatusErrorsPropertiesTarget :
MoveStatusMoveState : CommitPending
Name : PSDemoNIC-RegionToZone
ProvisioningState : Succeeded
ResourceSetting : Microsoft.Azure.PowerShell.Cmdlets.ResourceMover.Models.Api20230801.ResourceSettings
SourceId : /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourcegroups/PS-demo-RegionToZone-RG/providers/Microsoft.Network/networkinterfaces/nic_demo-RegionToZone-VM
SourceResourceSetting : Microsoft.Azure.PowerShell.Cmdlets.ResourceMover.Models.Api20230801.ResourceSettings
SystemDataCreatedAt :
SystemDataCreatedBy :
SystemDataCreatedByType :
SystemDataLastModifiedAt :
SystemDataLastModifiedBy :
SystemDataLastModifiedByType :
TargetId :
Type :
Lägg till en resurs i Typen RegionToZone Flytta samling som har en befintlig målresurs.
Exempel 5: Uppdatera målresursinställningarna när flyttresursen har lagts till. (RegionToRegion)
$moveResourceObj = Get-AzResourceMoverMoveResource -MoveCollectionName "PS-centralus-westcentralus-demoRMS1" -ResourceGroupName "RG-MoveCollection-demoRMS" -Name "PSDemoVM"
$TargetResourceSettingObj = $moveResourceObj.ResourceSetting
$TargetResourceSettingObj.TargetResourceName="PSDemoVM-target"
Update-AzResourceMoverMoveResource -ResourceGroupName "RG-MoveCollection-demoRMS" -MoveCollectionName "PS-centralus-westcentralus-demoRMS" -SourceId "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/PSDemoRM/providers/Microsoft.Compute/virtualMachines/PSDemoVM" -Name "PSDemoVM" -ResourceSetting $TargetResourceSettingObj
DependsOn : {/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/PSDemoRM/providers/Microsoft.Network/networkInterfaces/psdemov
m111, /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourcegroups/PSDemoRM}
DependsOnOverride : {}
ErrorsPropertiesCode :
ErrorsPropertiesDetail :
ErrorsPropertiesMessage :
ErrorsPropertiesTarget :
ExistingTargetId :
Id : /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/RG-MoveCollection-demoRMS/providers/Microsoft.Migrate/moveCollections/PS-centralus-westcentralus-demoRMS/moveResources/PSDemoVM
IsResolveRequired : True
JobStatusJobName :
JobStatusJobProgress :
MoveStatusErrorsPropertiesCode :
MoveStatusErrorsPropertiesDetail :
MoveStatusErrorsPropertiesMessage :
MoveStatusErrorsPropertiesTarget :
MoveStatusMoveState : PreparePending
Name : PSDemoVM
ProvisioningState : Succeeded
ResourceSetting : Microsoft.Azure.PowerShell.Cmdlets.ResourceMover.Models.Api20230801.VirtualMachineResourceSettings
SourceId : /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/PSDemoRM/providers/Microsoft.Compute/virtualMachines/PSDemoVM
SourceResourceSetting : Microsoft.Azure.PowerShell.Cmdlets.ResourceMover.Models.Api20230801.VirtualMachineResourceSettings
SystemDataCreatedAt :
SystemDataCreatedBy :
SystemDataCreatedByType :
SystemDataLastModifiedAt :
SystemDataLastModifiedBy :
SystemDataLastModifiedByType :
TargetId :
Type :
Uppdatera målresursinställningarna efter att flyttresursen har lagts till i typen "RegionToRegion".
Exempel 6: Uppdatera målresursinställningarna när flyttresursen har lagts till. (RegionToZone)
$moveResourceObj = Get-AzResourceMoverMoveResource -MoveCollectionName "PS-demo-RegionToZone" -ResourceGroupName "RG-MoveCollection-demoRMS" -Name "PSDemoVM-RegionToZone"
$TargetResourceSettingObj = $moveResourceObj.ResourceSetting
$TargetResourceSettingObj.TargetVMSize = "Standard_D4s_v3"
Update-AzResourceMoverMoveResource -ResourceGroupName "RG-MoveCollection-demoRMS" -MoveCollectionName "PS-centralus-westcentralus-demoRMS" -SourceId "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/PSDemoRM/providers/Microsoft.Compute/virtualMachines/PSDemoVM" -Name "PSDemoVM" -ResourceSetting $TargetResourceSettingObj
DependsOn : {}
DependsOnOverride : {}
ErrorsPropertiesCode :
ErrorsPropertiesDetail :
ErrorsPropertiesMessage :
ErrorsPropertiesTarget :
ExistingTargetId :
Id : /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/RG-MoveCollection-demoRMS/providers/Microsoft.Migrate/moveCollections/PS-demo-RegionToZone/moveResources/PSDemoVM-RegionToZone
IsResolveRequired : False
JobStatusJobName :
JobStatusJobProgress :
MoveStatusErrorsPropertiesCode : DependencyComputationPending
MoveStatusErrorsPropertiesDetail : {Microsoft.Azure.PowerShell.Cmdlets.ResourceMover.Models.Api20230801.MoveResourceErrorBody,
Microsoft.Azure.PowerShell.Cmdlets.ResourceMover.Models.Api20230801.MoveResourceErrorBody}
MoveStatusErrorsPropertiesMessage : The dependency computation is not completed for resource - /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/PS-demo-RegionToZone-RG/providers/Microsoft.Compute/virtualMachines/demo-RegionToZone-VM'.
Possible Causes: Dependency computation is pending for resource.
Recommended Action: Validate dependencies to compute the dependencies.
MoveStatusErrorsPropertiesTarget :
MoveStatusMoveState : MovePending
Name : PSDemoVM-RegionToZone
ProvisioningState : Succeeded
ResourceSetting : Microsoft.Azure.PowerShell.Cmdlets.ResourceMover.Models.Api20230801.VirtualMachineResourceSettings
SourceId : /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/PS-demo-RegionToZone-RG/providers/Microsoft.Compute/virtualMachines/
demo-RegionToZone-VM
SourceResourceSetting : Microsoft.Azure.PowerShell.Cmdlets.ResourceMover.Models.Api20230801.VirtualMachineResourceSettings
SystemDataCreatedAt : 9/5/2023 11:13:46 AM
SystemDataCreatedBy : xxxxxxx
SystemDataCreatedByType : User
SystemDataLastModifiedAt : 9/5/2023 11:13:46 AM
SystemDataLastModifiedBy : xxxxxxx
SystemDataLastModifiedByType : User
TargetId :
Type :
Uppdatera målresursinställningarna när flyttresursen har lagts till i typen "RegionToZone" flytta samling.
Parametrar
-AsJob
Kör kommandot som ett jobb
Typ: | SwitchParameter |
Position: | Named |
Standardvärde: | None |
Obligatorisk: | False |
Godkänn pipeline-indata: | False |
Godkänn jokertecken: | False |
-Confirm
Uppmanar dig att bekräfta innan du kör cmdleten.
Typ: | SwitchParameter |
Alias: | cf |
Position: | Named |
Standardvärde: | None |
Obligatorisk: | False |
Godkänn pipeline-indata: | False |
Godkänn jokertecken: | False |
-DefaultProfile
Parametern DefaultProfile fungerar inte. Använd parametern SubscriptionId när den är tillgänglig om du kör cmdleten mot en annan prenumeration.
Typ: | PSObject |
Alias: | AzureRMContext, AzureCredential |
Position: | Named |
Standardvärde: | None |
Obligatorisk: | False |
Godkänn pipeline-indata: | False |
Godkänn jokertecken: | False |
-DependsOnOverride
Hämtar eller anger åsidosättningar för flyttresursberoenden. Information om hur du skapar finns i AVSNITTET ANTECKNINGAR för EGENSKAPER FÖR DEPENDSONOVERRIDE och skapa en hash-tabell.
Typ: | IMoveResourceDependencyOverride[] |
Position: | Named |
Standardvärde: | None |
Obligatorisk: | False |
Godkänn pipeline-indata: | False |
Godkänn jokertecken: | False |
-ExistingTargetId
Hämtar eller anger resursens befintliga ARM-mål-ID.
Typ: | String |
Position: | Named |
Standardvärde: | None |
Obligatorisk: | False |
Godkänn pipeline-indata: | False |
Godkänn jokertecken: | False |
-MoveCollectionName
Flytta samlingsnamn.
Typ: | String |
Position: | Named |
Standardvärde: | None |
Obligatorisk: | True |
Godkänn pipeline-indata: | False |
Godkänn jokertecken: | False |
-Name
Flytta resursnamn.
Typ: | String |
Alias: | MoveResourceName |
Position: | Named |
Standardvärde: | None |
Obligatorisk: | True |
Godkänn pipeline-indata: | False |
Godkänn jokertecken: | False |
-NoWait
Kör kommandot asynkront
Typ: | SwitchParameter |
Position: | Named |
Standardvärde: | None |
Obligatorisk: | False |
Godkänn pipeline-indata: | False |
Godkänn jokertecken: | False |
-ResourceGroupName
Resursgruppens namn.
Typ: | String |
Position: | Named |
Standardvärde: | None |
Obligatorisk: | True |
Godkänn pipeline-indata: | False |
Godkänn jokertecken: | False |
-ResourceSetting
Hämtar eller anger resursinställningarna. Mer information finns i AVSNITTET ANTECKNINGAR för RESOURCESETTING-egenskaper och skapa en hash-tabell.
Typ: | IResourceSettings |
Position: | Named |
Standardvärde: | None |
Obligatorisk: | False |
Godkänn pipeline-indata: | False |
Godkänn jokertecken: | False |
-SourceId
Hämtar eller anger resursens ARM-käll-ID.
Typ: | String |
Position: | Named |
Standardvärde: | None |
Obligatorisk: | False |
Godkänn pipeline-indata: | False |
Godkänn jokertecken: | False |
-SubscriptionId
Prenumerations-ID:t.
Typ: | String |
Position: | Named |
Standardvärde: | (Get-AzContext).Subscription.Id |
Obligatorisk: | False |
Godkänn pipeline-indata: | False |
Godkänn jokertecken: | False |
-WhatIf
Visar vad som skulle hända om cmdleten körs. Cmdleten körs inte.
Typ: | SwitchParameter |
Alias: | wi |
Position: | Named |
Standardvärde: | None |
Obligatorisk: | False |
Godkänn pipeline-indata: | False |
Godkänn jokertecken: | False |
Utdata
Kommentarer
ALIAS
Update-AzResourceMoverMoveResource
Azure PowerShell