azure-powershell icon indicating copy to clipboard operation
azure-powershell copied to clipboard

New-AzRecoveryServicesAsrInMageRcmDiskInput object is not compatible w/ -InMageRcmDiskInput parameter of New-AzRecoveryServicesAsrReplicationProtectedItem

Open ChristopherGLewis opened this issue 3 years ago • 1 comments

Description

Using this URL for reference: https://docs.microsoft.com/en-us/azure/site-recovery/vmware-azure-disaster-recovery-powershell

I'm trying to replicate a VM to azure with an OS disk set to standard_ssd and data disk set to premium_ssd and it looks like the only way to do this is via the -InMageRcmDiskInput parameter of this parameter set:

New-AzRecoveryServicesAsrReplicationProtectedItem
   [-ReplicateVMwareToAzure]
   -ProtectableItem <ASRProtectableItem>
   -InMageRcmDiskInput <ASRInMageRcmDiskInput[]>
   -Name <String>
   [-RecoveryVmName <String>]
   [-LicenseType <String>]
   [-TestNetworkId <String>]
   [-TestSubnetName <String>]
   -ProtectionContainerMapping <ASRProtectionContainerMapping>
   [-CredentialsToAccessVm <String>]
   -ApplianceName <String>
   -Fabric <ASRFabric>
   [-RecoveryAzureNetworkId <String>]
   [-RecoveryAzureSubnetName <String>]
   -RecoveryResourceGroupId <String>
   [-ReplicationGroupName <String>]
   [-RecoveryAvailabilityZone <String>]
   [-RecoveryProximityPlacementGroupId <String>]
   [-RecoveryAvailabilitySetId <String>]
   [-Size <String>]
   [-RecoveryBootDiagStorageAccountId <String>]
   [-WaitForCompletion]
   

However, building up a disk object with the New-AzRecoveryServicesAsrInMageRcmDiskInput command results in an incompatible object and this error:

 461 |          New-AzRecoveryServicesAsrReplicationProtectedItem @ParamSplat
     |          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     | Operation Failed. ErrorCode: InvalidParameter Message: An invalid parameter logStorageAccountId was passed. Possible Causes: Parameter value is not correct for this action. Recommended Action:
     | Correct the parameter value and retry the last action. If the issue persists, contact Support. ClientRequestId: 0c24d411-bfb8-4e9b-bd5d-1a23fef0e535 ActivityId: 4a9cef85-61f4-4d7f-9b8d-c1afd97df3aa

I can get this to work with this parameter set :

New-AzRecoveryServicesAsrReplicationProtectedItem
   [-ReplicateVMwareToAzure]
   -ProtectableItem <ASRProtectableItem>
   -Name <String>
   [-RecoveryVmName <String>]
   [-LicenseType <String>]
   [-TestNetworkId <String>]
   [-TestSubnetName <String>]
   -ProtectionContainerMapping <ASRProtectionContainerMapping>
   [-CredentialsToAccessVm <String>]
   -LogStorageAccountId <String>
   -ApplianceName <String>
   -Fabric <ASRFabric>
   [-RecoveryAzureNetworkId <String>]
   [-RecoveryAzureSubnetName <String>]
   -RecoveryResourceGroupId <String>
   [-ReplicationGroupName <String>]
   [-RecoveryAvailabilityZone <String>]
   [-RecoveryProximityPlacementGroupId <String>]
   [-RecoveryAvailabilitySetId <String>]
   [-Size <String>]
   [-RecoveryBootDiagStorageAccountId <String>]
   [-WaitForCompletion]
   -DiskType <String>
   [-DiskEncryptionSetId <String>]
   [-DefaultProfile <IAzureContextContainer>]

but this sets all the disks to the same type.

My Disk commands:

    #make an InMage Rcm DiskMap
    Write-Host "  Creating InMage Rcm DiskMap" -ForegroundColor Green
    $DisksToInclude = @()
    foreach ($Disk in $VMObject.Disks ) {
        if ($VMObject.Disks.Count -GT 1 -and -not $DestDataDiskSKU) {
            Write-Host "    Data disks found, but no DestDataDisk SKU entered." -ForegroundColor red
            Return
        }
        #Assume 0:0 is boot disk 
        if ($Disk.name -eq 'scsi0:0') {
            Write-Host "    Adding OS disk '$($disk.ID)' - '$($DestOSDiskSKU)'." -ForegroundColor cyan
            $RcmDisk = New-AzRecoveryServicesAsrInMageRcmDiskInput -DiskID $disk.id -DiskType $DestOSDiskSKU -LogStorageAccountId $StorageAccountObject.id
        } else {
            Write-Host "    Adding Data disk '$($disk.ID)' - '$($DestDataDiskSKU)'." -ForegroundColor cyan
            $RcmDisk = New-AzRecoveryServicesAsrInMageRcmDiskInput -DiskID $disk.id -DiskType $DestDataDiskSKU -LogStorageAccountId $StorageAccountObject.id
        }
        $DisksToInclude += $RcmDisk
    }

And my parameter splat object and command:

    $ParamSplat = @{
        #Required
        "ReplicateVMwareToAzure"     = $true
        "ProtectableItem"            = $VMObject
        "Name"                       = (New-Guid).Guid
        "ProtectionContainerMapping" = $ASRProtectionContainerMap
        "ApplianceName"              = $ASRFabricObject.FabricSpecificDetails.ProcessServers[0].Name
        "Fabric"                     = $ASRFabricObject
        "RecoveryResourceGroupId"    = $DestRGObject.ResourceId
        "InMageRcmDiskInput"         = $DisksToInclude

        #Optional to cmdlet, but we always specify them
        "Size"                       = $DestVMSize
        "CredentialsToAccessVm"      = $VMCredAccount
        "RecoveryAzureNetworkId"     = $DestVnetObject.Id
        "RecoveryAzureSubnetName"    = $DestSubnet
        "TestNetworkId"              = $DestBubblevNetObject.id
        "TestSubnetName"             = $DestBubbleSubnet
    }


    # Enable replication for virtual machine
    New-AzRecoveryServicesAsrReplicationProtectedItem @ParamSplat

Issue script & Debug output

Adding OS disk '6000C29b-d7d6-2dda-589f-dae5d850785f' - 'Premium_LRS'.
DEBUG: 5:39:51 PM - AzureRmAsrInMageRcmDiskInput begin processing with ParameterSet 'ReplicateVMwareToAzure'.
DEBUG: 5:39:51 PM - using account id '[email protected]'...
DEBUG: 5:39:51 PM - [ConfigManager] Got nothing from [DisplayBreakingChangeWarning], Module = [], Cmdlet = []. Returning default value [True].
DEBUG: 5:39:51 PM - [ConfigManager] Got [True] from [EnableDataCollection], Module = [], Cmdlet = [].
DEBUG: AzureQoSEvent: Module: Az.RecoveryServices:5.4.1; CommandName: New-AzRecoveryServicesAsrInMageRcmDiskInput; PSVersion: 7.2.5; IsSuccess: True; Duration: 00:00:00.0017465
DEBUG: Finish sending metric.
DEBUG: 5:39:51 PM - AzureRmAsrInMageRcmDiskInput end processing.
  -- Parameters --
      Name                       Value
      -------------------------- --------------------------------------------------------------------------------------------------------------------------------------------------
      ApplianceName              MyAppliance
      CredentialsToAccessVm      Azure
      Fabric                     Microsoft.Azure.Commands.RecoveryServices.SiteRecovery.ASRFabric
      InMageRcmDiskInput         Microsoft.Azure.Commands.RecoveryServices.SiteRecovery.ASRInMageRcmDiskInput
      Name                       471d0da9-434d-498e-abaf-3d3b53b2221c
      ProtectableItem            Microsoft.Azure.Commands.RecoveryServices.SiteRecovery.ASRProtectableItem
      ProtectionContainerMapping Microsoft.Azure.Commands.RecoveryServices.SiteRecovery.ASRProtectionContainerMapping
      RecoveryAvailabilitySetId  /subscriptions/11-22-33-44/resourceGroups/MyRG/providers/Microsoft.Compute/availabilitySets/MyAS
      RecoveryAzureNetworkId     /subscriptions/11-22-33-44/resourceGroups/MyNetRG/providers/Microsoft.Network/virtualNetworks/MySpoke
      RecoveryAzureSubnetName    appsn01
      RecoveryResourceGroupId    /subscriptions/11-22-33-44/resourceGroups/MyRG
      ReplicateVMwareToAzure     True
      Size                       Standard_F4s_v2
      TestNetworkId              /subscriptions/11-22-33-44/resourceGroups/MyNetRG/providers/Microsoft.Network/virtualNetworks/MyASRBubble
      TestSubnetName             bubblesn01
  ----------------
  Creating server replication for MyServer
DEBUG: 5:39:51 PM - NewAzureRmRecoveryServicesAsrReplicationProtectedItem begin processing with ParameterSet 'ReplicateVMwareToAzureWithDiskInput'.
DEBUG: 5:39:51 PM - using account id '[email protected]'...
DEBUG: 5:39:51 PM - [ConfigManager] Got nothing from [DisplayBreakingChangeWarning], Module = [], Cmdlet = []. Returning default value [True].
DEBUG: [Common.Authentication]: Authenticating using Account: '[email protected]', environment: 'AzureCloud', tenant: '55-66-77-88'
DEBUG: 5:39:51 PM - [SilentAuthenticator] Calling SharedTokenCacheCredential.GetTokenAsync - TenantId:'55-66-77-88', Scopes:'https://management.core.windows.net//.default', AuthorityHost:'https://login.microsoftonline.com/', UserId:'[email protected]'
DEBUG: SharedTokenCacheCredential.GetToken invoked. Scopes: [ https://management.core.windows.net//.default ] ParentRequestId: 
DEBUG: False MSAL 4.39.0.0 MSAL.NetCore .NET 6.0.6 Microsoft Windows 10.0.22000 [08/04 22:39:51.45 - b0670909-dafc-4dd1-a90e-c7098c0bcdfb] IsLegacyAdalCacheEnabled: yes
DEBUG: False MSAL 4.39.0.0 MSAL.NetCore .NET 6.0.6 Microsoft Windows 10.0.22000 [08/04 22:39:51.45 - b0670909-dafc-4dd1-a90e-c7098c0bcdfb] [Region discovery] Not using a regional authority. 
DEBUG: False MSAL 4.39.0.0 MSAL.NetCore .NET 6.0.6 Microsoft Windows 10.0.22000 [08/04 22:39:51.45 - b0670909-dafc-4dd1-a90e-c7098c0bcdfb] [Region discovery] Not using a regional authority. 
DEBUG: False MSAL 4.39.0.0 MSAL.NetCore .NET 6.0.6 Microsoft Windows 10.0.22000 [08/04 22:39:51.45 - b0670909-dafc-4dd1-a90e-c7098c0bcdfb] [Region discovery] Not using a regional authority. 
DEBUG: False MSAL 4.39.0.0 MSAL.NetCore .NET 6.0.6 Microsoft Windows 10.0.22000 [08/04 22:39:51.45 - b0670909-dafc-4dd1-a90e-c7098c0bcdfb] IsLegacyAdalCacheEnabled: yes
DEBUG: False MSAL 4.39.0.0 MSAL.NetCore .NET 6.0.6 Microsoft Windows 10.0.22000 [08/04 22:39:51.45 - b0670909-dafc-4dd1-a90e-c7098c0bcdfb] IsLegacyAdalCacheEnabled: yes
DEBUG: False MSAL 4.39.0.0 MSAL.NetCore .NET 6.0.6 Microsoft Windows 10.0.22000 [08/04 22:39:51.45] Found 2 cache accounts and 0 broker accounts
DEBUG: False MSAL 4.39.0.0 MSAL.NetCore .NET 6.0.6 Microsoft Windows 10.0.22000 [08/04 22:39:51.45] Returning 2 accounts
DEBUG: False MSAL 4.39.0.0 MSAL.NetCore .NET 6.0.6 Microsoft Windows 10.0.22000 [08/04 22:39:51.45 - 4b00cdcb-5b5d-47af-bbf1-fe1297a8771c] MSAL MSAL.NetCore with assembly version '4.39.0.0'. CorrelationId(4b00cdcb-5b5d-47af-bbf1-fe1297a8771c)
DEBUG: False MSAL 4.39.0.0 MSAL.NetCore .NET 6.0.6 Microsoft Windows 10.0.22000 [08/04 22:39:51.45 - 4b00cdcb-5b5d-47af-bbf1-fe1297a8771c] === AcquireTokenSilent Parameters ===
DEBUG: False MSAL 4.39.0.0 MSAL.NetCore .NET 6.0.6 Microsoft Windows 10.0.22000 [08/04 22:39:51.45 - 4b00cdcb-5b5d-47af-bbf1-fe1297a8771c] LoginHint provided: False
DEBUG: False MSAL 4.39.0.0 MSAL.NetCore .NET 6.0.6 Microsoft Windows 10.0.22000 [08/04 22:39:51.45 - 4b00cdcb-5b5d-47af-bbf1-fe1297a8771c] Account provided: True
DEBUG: False MSAL 4.39.0.0 MSAL.NetCore .NET 6.0.6 Microsoft Windows 10.0.22000 [08/04 22:39:51.45 - 4b00cdcb-5b5d-47af-bbf1-fe1297a8771c] ForceRefresh: False
DEBUG: False MSAL 4.39.0.0 MSAL.NetCore .NET 6.0.6 Microsoft Windows 10.0.22000 [08/04 22:39:51.45 - 4b00cdcb-5b5d-47af-bbf1-fe1297a8771c] 
=== Request Data ===
Authority Provided? - True
Scopes - https://management.core.windows.net//.default
Extra Query Params Keys (space separated) - 
ApiId - AcquireTokenSilent
IsConfidentialClient - False
SendX5C - False
LoginHint ? False
IsBrokerConfigured - False
HomeAccountId - False
CorrelationId - 4b00cdcb-5b5d-47af-bbf1-fe1297a8771c
UserAssertion set: False
LongRunningOboCacheKey set: False

DEBUG: False MSAL 4.39.0.0 MSAL.NetCore .NET 6.0.6 Microsoft Windows 10.0.22000 [08/04 22:39:51.45 - 4b00cdcb-5b5d-47af-bbf1-fe1297a8771c] === Token Acquisition (SilentRequest) started:
. . .


=== Request Data ===
Authority Provided? - True
Scopes - https://management.core.windows.net//.default
Extra Query Params Keys (space separated) - 
ApiId - AcquireTokenSilent
IsConfidentialClient - False
SendX5C - False
LoginHint ? False
IsBrokerConfigured - False
HomeAccountId - False
CorrelationId - 04722a3c-045b-4d18-b161-69fe2a68f553
UserAssertion set: False
LongRunningOboCacheKey set: False

. . .

=== Request Data ===
Authority Provided? - True
Scopes - https://management.core.windows.net//.default
Extra Query Params Keys (space separated) - 
ApiId - AcquireTokenSilent
IsConfidentialClient - False
SendX5C - False
LoginHint ? False
IsBrokerConfigured - False
HomeAccountId - False
CorrelationId - 7e3ec1d6-47d2-45be-9c5e-5741592de94e
UserAssertion set: False
LongRunningOboCacheKey set: False


. . .

=== Request Data ===
Authority Provided? - True
Scopes - https://management.core.windows.net//.default
Extra Query Params Keys (space separated) - 
ApiId - AcquireTokenSilent
IsConfidentialClient - False
SendX5C - False
LoginHint ? False
IsBrokerConfigured - False
HomeAccountId - False
CorrelationId - 182bae7e-b856-487e-909d-beb6c8edd041
UserAssertion set: False
LongRunningOboCacheKey set: False

. . .

DEBUG: ============================ HTTP REQUEST ============================

HTTP Method:
GET

Absolute Uri:
https://management.azure.com/subscriptions/11-22-33-44/resourceGroups/MyASRRG/providers/Microsoft.RecoveryServices/vaults/MyVault/replicationPolicies/24-hour-replication-policy?api-version=2021-11-01

Headers:
x-ms-client-request-id        : 0c24d411-bfb8-4e9b-bd5d-1a23fef0e535
Accept-Language               : en-US
Agent-Authentication          : {"NotBeforeTimestamp":"\/Date(1659649191581)\/","NotAfterTimestamp":"\/Date(1660253991581)\/","ClientRequestId":"95005262-37b8-418f-bf18-59e2460828ce-2022-08-04 22:39:51Z-Ps","HashFunction":"HMACSHA256","Hmac":"YmiWcuBh7Vf2OufSNeLcUlY8qCPUF2Cvje6ihSbLzkM=","Version":"1.2","PropertyBag":{}}

Body:



DEBUG: ============================ HTTP RESPONSE ============================

Status Code:
OK

Headers:
Cache-Control                 : no-cache
Pragma                        : no-cache
x-ms-ratelimit-remaining-subscription-reads: 11989
Server                        : Microsoft-IIS/10.0,Kestrel
Strict-Transport-Security     : max-age=31536000; includeSubDomains
x-ms-request-id               : 0c24d411-bfb8-4e9b-bd5d-1a23fef0e535 8/4/2022 10:39:52 PM
X-Content-Type-Options        : nosniff
x-ms-client-request-id        : 0c24d411-bfb8-4e9b-bd5d-1a23fef0e535
x-ms-correlation-request-id   : f4a557fe-b9b1-444d-a6a1-5b841f153134
x-ms-routing-request-id       : NORTHCENTRALUS:20220804T223952Z:f4a557fe-b9b1-444d-a6a1-5b841f153134
Date                          : Thu, 04 Aug 2022 22:39:52 GMT

Body:
{
  "id": "/Subscriptions/11-22-33-44/resourceGroups/MyASRRG/providers/Microsoft.RecoveryServices/vaults/MyVault/replicationPolicies/24-hour-replication-policy",
  "name": "24-hour-replication-policy",
  "type": "Microsoft.RecoveryServices/vaults/replicationPolicies",
  "properties": {
    "friendlyName": "24-hour-replication-policy",
    "providerSpecificDetails": {
      "instanceType": "InMageRcm",
      "recoveryPointHistoryInMinutes": 4320,
      "appConsistentFrequencyInMinutes": 240,
      "crashConsistentFrequencyInMinutes": 5,
      "enableMultiVmSync": "true"
    }
  }
}


. . .

=== Request Data ===
Authority Provided? - True
Scopes - https://management.core.windows.net//.default
Extra Query Params Keys (space separated) - 
ApiId - AcquireTokenSilent
IsConfidentialClient - False
SendX5C - False
LoginHint ? False
IsBrokerConfigured - False
HomeAccountId - False
CorrelationId - 09f64d0a-3581-4157-a944-f43447a12751
UserAssertion set: False
LongRunningOboCacheKey set: False

  . . .


DEBUG: SharedTokenCacheCredential.GetToken succeeded. Scopes: [ https://management.core.windows.net//.default ] ParentRequestId:  ExpiresOn: 2022-08-04T23:39:43.0000000+00:00
DEBUG: [Common.Authentication]: Received token with LoginType 'User', Tenant: '55-66-77-88', UserId: '[email protected]'
DEBUG: [Common.Authentication]: Authenticating using Account: '[email protected]', environment: 'AzureCloud', tenant: '55-66-77-88'
DEBUG: 5:39:51 PM - [SilentAuthenticator] Calling SharedTokenCacheCredential.GetTokenAsync - TenantId:'55-66-77-88', Scopes:'https://management.core.windows.net//.default', AuthorityHost:'https://login.microsoftonline.com/', UserId:'[email protected]'
DEBUG: SharedTokenCacheCredential.GetToken invoked. Scopes: [ https://management.core.windows.net//.default ] ParentRequestId: 

. . .

=== Request Data ===
Authority Provided? - True
Scopes - https://management.core.windows.net//.default
Extra Query Params Keys (space separated) - 
ApiId - AcquireTokenSilent
IsConfidentialClient - False
SendX5C - False
LoginHint ? False
IsBrokerConfigured - False
HomeAccountId - False
CorrelationId - 5f3fdeb0-24a8-4c19-bff7-ded1350ac11c
UserAssertion set: False
LongRunningOboCacheKey set: False

DEBUG: False MSAL 4.39.0.0 MSAL.NetCore .NET 6.0.6 Microsoft Windows 10.0.22000 [08/04 22:39:51.95 - 5f3fdeb0-24a8-4c19-bff7-ded1350ac11c] === Token Acquisition (SilentRequest) started:
         Scopes: https://management.core.windows.net//.default
        Authority Host: login.microsoftonline.com
. . .

DEBUG: SharedTokenCacheCredential.GetToken succeeded.Scopes: [https://management.core.windows.net//.default ] ParentRequestId:  ExpiresOn: 2022-08-04T23:39:43.0000000+00:00
DEBUG: [Common.Authentication]: Received token with LoginType 'User', Tenant: '55-66-77-88', UserId: '[email protected]'
DEBUG: ============================ HTTP REQUEST ============================

HTTP Method:
GET

Absolute Uri:
https://management.azure.com/subscriptions/11-22-33-44/resourceGroups/MyASRRG/providers/Microsoft.RecoveryServices/vaults/MyVault/replicationFabrics/MyVault-vmwarefabric?api-version=2021-11-01

Headers:
x-ms-client-request-id        : 0c24d411-bfb8-4e9b-bd5d-1a23fef0e535
Accept-Language               : en-US
Agent-Authentication          : {"NotBeforeTimestamp":"\/Date(1659649191963)\/","NotAfterTimestamp":"\/Date(1660253991963)\/","ClientRequestId":"7f0fd11e-c33f-4e0e-945c-36ca982ea18e-2022-08-04 22:39:51Z-Ps","HashFunction":"HMACSHA256","Hmac":"f93pZeSwwJ+8P3cgsulQVU7xx+YZJQ4ZDcqjtNt+6R8=","Version":"1.2","PropertyBag":{}}

Body:



DEBUG: ============================ HTTP RESPONSE ============================

Status Code:
OK

Headers:
Cache-Control                 : no-cache
Pragma                        : no-cache
x-ms-ratelimit-remaining-subscription-reads: 11990
Server                        : Microsoft-IIS/10.0,Kestrel
Strict-Transport-Security     : max-age=31536000; includeSubDomains
x-ms-request-id               : 0c24d411-bfb8-4e9b-bd5d-1a23fef0e535 8/4/2022 10:39:53 PM
X-Content-Type-Options        : nosniff
x-ms-client-request-id        : 0c24d411-bfb8-4e9b-bd5d-1a23fef0e535
x-ms-correlation-request-id   : 3209234a-82be-4f65-a2e5-c4dcf192aadb
x-ms-routing-request-id       : NORTHCENTRALUS:20220804T223953Z:3209234a-82be-4f65-a2e5-c4dcf192aadb
Date                          : Thu, 04 Aug 2022 22:39:53 GMT

Body:
{
  "name": "MyVault-vmwarefabric",
  "type": "Microsoft.RecoveryServices/vaults/replicationFabrics",
  "id": "/Subscriptions/11-22-33-44/resourceGroups/MyASRRG/providers/Microsoft.RecoveryServices/vaults/MyVault/replicationFabrics/MyVault-vmwarefabric",
  "properties": {
    "friendlyName": "MyVault-vmwarefabric",
    "encryptionDetails": {
      "kekState": "None",
      "kekCertThumbprint": null
    },
    "rolloverEncryptionDetails": {
      "kekState": "None",
      "kekCertThumbprint": null
    },
    "internalIdentifier": "cc67019a-72de-5ddc-b9cc-80316fd258e1",
    "bcdrState": "Valid",
    "customDetails": {
      "instanceType": "InMageRcm",
      "vmwareSiteId": "/subscriptions/11-22-33-44/resourceGroups/MyASRRG/providers/Microsoft.OffAzure/VMwareSites/prd-usce-a32d1vmwaresite",
      "physicalSiteId": "/subscriptions/11-22-33-44/resourceGroups/MyASRRG/providers/Microsoft.OffAzure/ServerSites/prd-usce-a32d1physicalsite",
      "serviceEndpoint": "https://pod01-srs1.cus.hypervrecoverymanager.windowsazure.com",
      "serviceResourceId": "2812141050297939088",
      "serviceContainerId": "5608089813922",
      "dataPlaneUri": "https://pod01-prot2.cus.backup.windowsazure.com",
      "controlPlaneUri": "https://pod01-rcm1.cus.hypervrecoverymanager.windowsazure.com",
      "sourceAgentIdentityDetails": {
        "tenantId": "55-66-77-88",
        "applicationId": "7cda4bc8-3f6e-4b5e-bf93-9cce8e8f757d",
        "objectId": "6cb36de1-74f3-41cc-ad85-bfbfb85cc3ef",
        "audience": "api://55-66-77-88/prd-usce-a32d1failbackagentauthaadapp",
        "aadAuthority": "https://login.windows.net/55-66-77-88"
      },
      "processServers": [
        {
          "id": "e54d1061-9924-4454-abea-7165082f1799",
          "name": "MyAppliance",
          "biosId": "3FEA0142-4C57-8D68-B55C-01E0C94E03DF",
          "fabricObjectId": "/subscriptions/11-22-33-44/resourceGroups/MyASRRG/providers/Microsoft.OffAzure/VMwareSites/prd-usce-a32d1vmwaresite/machines/vsphere_5001d7e9-a688-c534-4052-03b72efc6fc5",
          "fqdn": "MyAppliance.fqdh.local",
          "ipAddresses": [
            "10.60.10.248"
          ],
          "version": "9.50.6419.1",
          "lastHeartbeatUtc": "2022-08-04T22:38:34.2657431Z",
          "totalMemoryInBytes": 39727845376,
          "availableMemoryInBytes": 34503633709,
          "usedMemoryInBytes": 5224211667,
          "memoryUsagePercentage": 13.15000000014096,
          "totalSpaceInBytes": 665717829632,
          "availableSpaceInBytes": 661701154816,
          "usedSpaceInBytes": 4016674816,
          "freeSpacePercentage": 99.39664004219019,
          "throughputUploadPendingDataInBytes": 85487024,
          "throughputInBytes": 981268,
          "processorUsagePercentage": 1.0,
          "throughputStatus": "Healthy",
          "systemLoad": 0,
          "systemLoadStatus": "Healthy",
          "diskUsageStatus": "Healthy",
          "memoryUsageStatus": "Healthy",
          "processorUsageStatus": "Healthy",
          "health": "Normal",
          "healthErrors": [],
          "historicHealth": "Normal"
        }
      ],
      "rcmProxies": [
        {
          "id": "e54d1061-9924-4454-abea-7165082f1799",
          "name": "MyAppliance",
          "biosId": "3FEA0142-4C57-8D68-B55C-01E0C94E03DF",
          "fabricObjectId": "/subscriptions/11-22-33-44/resourceGroups/MyASRRG/providers/Microsoft.OffAzure/VMwareSites/prd-usce-a32d1vmwaresite/machines/vsphere_5001d7e9-a688-c534-4052-03b72efc6fc5",
          "fqdn": "MyAppliance.fqdh.local",
          "clientAuthenticationType": "Certificate",
          "version": "1.35.8419.34591",
          "lastHeartbeatUtc": "2022-08-04T22:39:20.5994152Z",
          "health": "Normal",
          "healthErrors": []
        }
      ],
      "pushInstallers": [
        {
          "id": "e54d1061-9924-4454-abea-7165082f1799",
          "name": "MyAppliance",
          "biosId": "3FEA0142-4C57-8D68-B55C-01E0C94E03DF",
          "fabricObjectId": "/subscriptions/11-22-33-44/resourceGroups/MyASRRG/providers/Microsoft.OffAzure/VMwareSites/prd-usce-a32d1vmwaresite/machines/vsphere_5001d7e9-a688-c534-4052-03b72efc6fc5",
          "fqdn": "MyAppliance.fqdh.local",
          "version": "1.35.8427.21864",
          "lastHeartbeatUtc": "2022-08-04T22:38:41.6283492Z",
          "health": "Normal",
          "healthErrors": []
        }
      ],
      "replicationAgents": [
        {
          "id": "e54d1061-9924-4454-abea-7165082f1799",
          "name": "MyAppliance",
          "biosId": "3FEA0142-4C57-8D68-B55C-01E0C94E03DF",
          "fabricObjectId": "/subscriptions/11-22-33-44/resourceGroups/MyASRRG/providers/Microsoft.OffAzure/VMwareSites/prd-usce-a32d1vmwaresite/machines/vsphere_5001d7e9-a688-c534-4052-03b72efc6fc5",
          "fqdn": "MyAppliance.fqdh.local",
          "version": "1.35.8433.24227",
          "lastHeartbeatUtc": "2022-08-04T22:38:53.3860982Z",
          "health": "Normal",
          "healthErrors": []
        }
      ],
      "reprotectAgents": [
        {
          "id": "e54d1061-9924-4454-abea-7165082f1799",
          "name": "MyAppliance",
          "biosId": "3FEA0142-4C57-8D68-B55C-01E0C94E03DF",
          "fabricObjectId": "/subscriptions/11-22-33-44/resourceGroups/MyASRRG/providers/Microsoft.OffAzure/VMwareSites/prd-usce-a32d1vmwaresite/machines/vsphere_5001d7e9-a688-c534-4052-03b72efc6fc5",
          "fqdn": "MyAppliance.fqdh.local",
          "version": "1.36.8433.24288",
          "lastHeartbeatUtc": "2022-08-04T22:39:10.774943Z",
          "health": "Normal",
          "healthErrors": [],
          "accessibleDatastores": [
            "DATASTORE-01"
          ],
          "vcenterId": "/subscriptions/11-22-33-44/resourceGroups/MyASRRG/providers/Microsoft.OffAzure/VMwareSites/prd-usce-a32d1vmwaresite/vcenters/vsphere",
          "lastDiscoveryInUtc": "2022-08-04T22:38:35.4774023Z"
        }
      ],
      "marsAgents": [
        {
          "id": "e54d1061-9924-4454-abea-7165082f1799",
          "name": "MyAppliance",
          "biosId": "3FEA0142-4C57-8D68-B55C-01E0C94E03DF",
          "fabricObjectId": "/subscriptions/11-22-33-44/resourceGroups/MyASRRG/providers/Microsoft.OffAzure/VMwareSites/prd-usce-a32d1vmwaresite/machines/vsphere_5001d7e9-a688-c534-4052-03b72efc6fc5",
          "fqdn": "MyAppliance.fqdh.local",
          "version": "2.0.9249.0",
          "lastHeartbeatUtc": "2022-08-04T22:39:26.9578827Z",
          "health": "Normal",
          "healthErrors": []
        }
      ],
      "dras": [
        {
          "id": "e54d1061-9924-4454-abea-7165082f1799",
          "name": "MyAppliance",
          "biosId": "3FEA0142-4C57-8D68-B55C-01E0C94E03DF",
          "version": "5.1.7627.0",
          "lastHeartbeatUtc": "2022-08-04T22:39:44.3922857Z",
          "health": "Normal",
          "healthErrors": []
        }
      ],
      "agentDetails": []
    },
    "healthErrorDetails": [],
    "health": "Normal"
  }
}


. . .

=== Request Data ===
Authority Provided? - True
Scopes - https://management.core.windows.net//.default
Extra Query Params Keys (space separated) - 
ApiId - AcquireTokenSilent
IsConfidentialClient - False
SendX5C - False
LoginHint ? False
IsBrokerConfigured - False
HomeAccountId - False
CorrelationId - 8461e17b-22fd-4944-8133-872e640c1008
UserAssertion set: False
LongRunningOboCacheKey set: False

  . . .

=== Request Data ===
Authority Provided? - True
Scopes - https://management.core.windows.net//.default
Extra Query Params Keys (space separated) - 
ApiId - AcquireTokenSilent
IsConfidentialClient - False
SendX5C - False
LoginHint ? False
IsBrokerConfigured - False
HomeAccountId - False
CorrelationId - d8750c5a-6bdd-41df-8fc9-cca403e38e19
UserAssertion set: False
LongRunningOboCacheKey set: False

  . . .

=== Request Data ===
Authority Provided? - True
Scopes - https://management.core.windows.net//.default
Extra Query Params Keys (space separated) - 
ApiId - AcquireTokenSilent
IsConfidentialClient - False
SendX5C - False
LoginHint ? False
IsBrokerConfigured - False
HomeAccountId - False
CorrelationId - ecb02dae-b6a9-4107-b979-1b7642286196
UserAssertion set: False
LongRunningOboCacheKey set: False

  . . .

DEBUG: ============================ HTTP REQUEST ============================

HTTP Method:
PUT

Absolute Uri:
https://management.azure.com/subscriptions/11-22-33-44/resourceGroups/MyASRRG/providers/Microsoft.RecoveryServices/vaults/MyVault/replicationFabrics/MyVault-vmwarefabric/replicationProtectionContainers/prd-usce-a32d1replicationcontainer/replicationProtectedItems/471d0da9-434d-498e-abaf-3d3b53b2221c?api-version=2021-11-01

Headers:
x-ms-client-request-id        : 0c24d411-bfb8-4e9b-bd5d-1a23fef0e535
Accept-Language               : en-US
Agent-Authentication          : {"NotBeforeTimestamp":"\/Date(1659649192715)\/","NotAfterTimestamp":"\/Date(1660253992715)\/","ClientRequestId":"04460eca-2329-4e3d-b6b9-7d41ad8a3057-2022-08-04 22:39:52Z-Ps","HashFunction":"HMACSHA256","Hmac":"72NhLnQ2dKBDsdLTUQ9Do2xELfOgEh5fqUphjsUTo+c=","Version":"1.2","PropertyBag":{}}

Body:
{
  "properties": {
    "policyId": "/Subscriptions/11-22-33-44/resourceGroups/MyASRRG/providers/Microsoft.RecoveryServices/vaults/MyVault/replicationPolicies/24-hour-replication-policy",       
    "providerSpecificDetails": {
      "instanceType": "InMageRcm",
      "fabricDiscoveryMachineId": "/subscriptions/11-22-33-44/resourceGroups/MyASRRG/providers/Microsoft.OffAzure/VMwareSites/prd-usce-a32d1vmwaresite/machines/vsphere_50016560-87a8-ee9f-c059-1a1e098e324f",
      "disksToInclude": [
        {
          "diskId": "6000C29b-d7d6-2dda-589f-dae5d850785f",
          "logStorageAccountId": "/subscriptions/11-22-33-44/resourceGroups/MySARG/providers/Microsoft.Storage/storageAccounts/myuniquesaname1234",
          "diskType": "Premium_LRS"
        }
      ],
      "disksDefault": {},
      "targetResourceGroupId": "/subscriptions/11-22-33-44/resourceGroups/MyRG",
      "targetNetworkId": "/subscriptions/11-22-33-44/resourceGroups/MyNetRG/providers/Microsoft.Network/virtualNetworks/MySpoke",
      "testNetworkId": "/subscriptions/11-22-33-44/resourceGroups/MyNetRG/providers/Microsoft.Network/virtualNetworks/MyASRBubble",
      "targetSubnetName": "appsn01",
      "testSubnetName": "bubblesn01",
      "targetVmName": "MyServer",
      "targetVmSize": "Standard_F4s_v2",
      "targetAvailabilitySetId": "/subscriptions/11-22-33-44/resourceGroups/MyRG/providers/Microsoft.Compute/availabilitySets/MyAS",
      "runAsAccountId": "/subscriptions/11-22-33-44/resourceGroups/MyASRRG/providers/Microsoft.OffAzure/VMwareSites/prd-usce-a32d1vmwaresite/runasaccounts/cc59086c-2156-5c6b-8b4a-51f49dc6b903",
      "processServerId": "e54d1061-9924-4454-abea-7165082f1799"
    }
  }
}


DEBUG: ============================ HTTP RESPONSE ============================

Status Code:
BadRequest

Headers:
Cache-Control                 : no-cache
Pragma                        : no-cache
x-ms-ratelimit-remaining-subscription-writes: 1199
Server                        : Microsoft-IIS/10.0,Kestrel
Strict-Transport-Security     : max-age=31536000; includeSubDomains
x-ms-request-id               : 0c24d411-bfb8-4e9b-bd5d-1a23fef0e535 8/4/2022 10:39:54 PM
X-Content-Type-Options        : nosniff
x-ms-client-request-id        : 0c24d411-bfb8-4e9b-bd5d-1a23fef0e535
x-ms-correlation-request-id   : 4a9cef85-61f4-4d7f-9b8d-c1afd97df3aa
x-ms-routing-request-id       : NORTHCENTRALUS:20220804T223954Z:4a9cef85-61f4-4d7f-9b8d-c1afd97df3aa
Date                          : Thu, 04 Aug 2022 22:39:53 GMT

Body:
{
  "error": {
    "code": "BadRequest",
    "message": "An invalid parameter logStorageAccountId was passed.",
    "details": [
      {
        "code": "InvalidParameter",
        "message": "An invalid parameter logStorageAccountId was passed.",
        "possibleCauses": "Parameter value is not correct for this action.",
        "recommendedAction": "Correct the parameter value and retry the last action. If the issue persists, contact Support.",
        "clientRequestId": "0c24d411-bfb8-4e9b-bd5d-1a23fef0e535",
        "activityId": "4a9cef85-61f4-4d7f-9b8d-c1afd97df3aa"
      }
    ]
  }
}


DEBUG: 5:39:53 PM - [ConfigManager] Got [True] from [EnableDataCollection], Module = [], Cmdlet = [].
New-AzRecoveryServicesAsrReplicationProtectedItem: C:\VSProjects\DevOps\Master\AzASRAutomation\Start-AzASRReplication.ps1:461:9
Line |
 461 |          New-AzRecoveryServicesAsrReplicationProtectedItem @ParamSplat
     |          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     | Operation Failed. ErrorCode: InvalidParameter Message: An invalid parameter logStorageAccountId was passed. Possible Causes: Parameter value is not correct for this action. Recommended Action:
     | Correct the parameter value and retry the last action. If the issue persists, contact Support. ClientRequestId: 0c24d411-bfb8-4e9b-bd5d-1a23fef0e535 ActivityId: 4a9cef85-61f4-4d7f-9b8d-c1afd97df3aa

DEBUG: 5:39:53 PM - [ConfigManager] Got nothing from [DisplayBreakingChangeWarning], Module = [], Cmdlet = []. Returning default value [True].
DEBUG: AzureQoSEvent: Module: Az.RecoveryServices:5.4.1; CommandName: New-AzRecoveryServicesAsrReplicationProtectedItem; PSVersion: 7.2.5; IsSuccess: False; Duration: 00:00:02.1444256; Exception: Operation Failed.   
ActivityId: 4a9cef85-61f4-4d7f-9b8d-c1afd97df3aa

;
DEBUG: Finish sending metric.
DEBUG: 5:39:53 PM - NewAzureRmRecoveryServicesAsrReplicationProtectedItem end processing.

Environment data

> $PSVersionTable

Name                           Value
----                           -----
PSVersion                      7.2.5
PSEdition                      Core
GitCommitId                    7.2.5
OS                             Microsoft Windows 10.0.22000
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

DEBUG: Setting WindowTitle: Master [Client/Fredrickson] - PowerShell 7.2 (69324)

Module versions

> get-module az*

ModuleType Version    PreRelease Name                                ExportedCommands
---------- -------    ---------- ----                                ----------------
Script     2.9.1                 Az.Accounts                         {Add-AzEnvironment, Clear-AzConfig, Clear-AzContext, Clear-AzDefault…}
Script     4.30.0                Az.Compute                          {Add-AzImageDataDisk, Add-AzVhd, Add-AzVMAdditionalUnattendContent, Add-AzVMDataDisk…}
Script     0.7.2                 Az.ManagementPartner                {Get-AzManagementPartner, New-AzManagementPartner, Remove-AzManagementPartner, Update-AzManagementPartner}
Script     1.1.3                 Az.Migrate                          {Get-AzMigrateDiscoveredServer, Get-AzMigrateJob, Get-AzMigrateProject, Get-AzMigrateReplicationEligibilityResult…}
Script     4.19.0                Az.Network                          {Add-AzApplicationGatewayAuthenticationCertificate, Add-AzApplicationGatewayBackendAddressPool, Add-AzApplicationGatewayBackendHttpSetting, Add-A… 
Script     5.4.1                 Az.RecoveryServices                 {Add-AzRecoveryServicesAsrReplicationProtectedItemDisk, Backup-AzRecoveryServicesBackupItem, Copy-AzRecoveryServicesVault, Disable-AzRecoveryServ… 
Script     6.1.0                 Az.Resources                        {Export-AzResourceGroup, Export-AzTemplateSpec, Get-AzDenyAssignment, Get-AzDeployment…}
Script     1.1.0                 Az.SqlVirtualMachine                {Get-AzAvailabilityGroupListener, Get-AzSqlVM, Get-AzSqlVMGroup, New-AzAvailabilityGroupListener…}
Script     4.8.0                 Az.Storage                          {Add-AzRmStorageContainerLegalHold, Add-AzStorageAccountManagementPolicyAction, Add-AzStorageAccountNetworkRule, Close-AzStorageFileHandle…}

Error output

WARNING: Upcoming breaking changes in the cmdlet 'Resolve-AzError' :
The `Resolve-Error` alias will be removed in a future release.  Please change any scripts that use this alias to use `Resolve-AzError` instead.
Note : Go to https://aka.ms/azps-changewarnings for steps to suppress this breaking change warning, and other information on breaking changes in Azure PowerShell.

   HistoryId: 214

Message        : Operation Failed.
                 ErrorCode: InvalidParameter
                 Message: An invalid parameter logStorageAccountId was passed.
                 Possible Causes: Parameter value is not correct for this action.
                 Recommended Action: Correct the parameter value and retry the last action. If the issue persists, contact Support.
                 ClientRequestId: 0c24d411-bfb8-4e9b-bd5d-1a23fef0e535
                 ActivityId: 4a9cef85-61f4-4d7f-9b8d-c1afd97df3aa


StackTrace     :    at Microsoft.Azure.Commands.RecoveryServices.SiteRecovery.SiteRecoveryCmdletBase.HandleException(Exception ex)
                    at Microsoft.Azure.Commands.RecoveryServices.SiteRecovery.SiteRecoveryCmdletBase.ExecuteCmdlet()
                    at Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet.ProcessRecord()
Exception      : System.InvalidOperationException
InvocationInfo : {New-AzRecoveryServicesAsrReplicationProtectedItem}
Line           :         New-AzRecoveryServicesAsrReplicationProtectedItem @ParamSplat

Position       : At C:\VSProjects\DevOps\Master\AzASRAutomation\Start-AzASRReplication.ps1:461 char:9
                 +         New-AzRecoveryServicesAsrReplicationProtectedItem @ParamSplat
                 +         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
HistoryId      : 214

ChristopherGLewis avatar Aug 04 '22 23:08 ChristopherGLewis

Thank you for your feedback. This has been routed to the support team for assistance.

msftbot[bot] avatar Aug 06 '22 00:08 msftbot[bot]

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @Sharmistha-Rai.