I have ASR set up from Vmware to Azure. I downloaded the ASR appliance from Azure, installed it in Vmware, registered and replicated a couple of VMs. I have done a test failover and a full failover and failback. All worked. I have done much of this with powershell.
Now Im trying to automate enabling replication with powershell and some things are not working.
I can get the fabric and the container
$asrFabric = Get-AzRecoveryServicesAsrFabric
$asrContainer = Get-AzRecoveryServicesAsrProtectionContainer -Fabric $asrFabric
But I cannot get info on the vcenter, this command returns blank.
Get-AzRecoveryServicesAsrvCenter -Fabric $asrFabric
In the portal, under the vault and Site Recovery, Enable Replication, I can see my vCenter Server, and all the virtual machines from Vmware. This is how I set up the replication I already have going. So don't know why Get-AzRecoveryServicesAsrvCenter returns nothing.
I can get the vmware siteID.
$VmwareSiteID = $asrFabric.FabricSpecificDetails.VmwareSiteId
And I can get all protectable items.
$allProtectableItems = Get-AzRecoveryServicesAsrProtectableItem -ProtectionContainer $asrContainer -SiteId $VmwareSiteID
I get 631 items.
Following the link https://learn.microsoft.com/en-us/azure/site-recovery/vmware-azure-disaster-recovery-powershell .. I was trying to enable replication for a VM.
New-AzRecoveryServicesAsrReplicationProtectedItem requires the -Account parameter. This is account credentials that I supplied at registration. The article says that the accounts can be found this way:
$AccountHandles = $asrabric.FabricSpecificDetails.RunAsAccounts
but my fabric has no item called .RunAsAccounts.
My $asrFabric.FabricSpecificDetails looks like this
VmwareSiteId : /subscriptions/xx/resourceGroups/zz/providers/Microsoft.OffAzure/VMwareSites/yyy
PhysicalSiteId : /subscriptions/xx/resourceGroups/zz/providers/Microsoft.OffAzure/ServerSites/yyy
ServiceEndpoint : https://pod01-srs1.ukw.hypervrecoverymanager.windowsazure.com
ServiceResourceId : 111111111111111111
ServiceContainerId : 22222222222222
DataPlaneUri : https://pod01-prot2.ukw.backup.windowsazure.com
ControlPlaneUri : https://pod01-rcm1.ukw.hypervrecoverymanager.windowsazure.com
ProcessServers : {}
RcmProxies : {}
PushInstallers : {}
ReplicationAgents : {}
ReprotectAgents : {}
MarsAgents : {}
Dras : {}
AgentDetails : {}
and as you can see there is no RunAssAccounts and also there is no ProcessServer. I absolutely have a processServer. When I go to Site Recovery Infrastructure > ASR Replication Appliances, I can see my appliance or processServer. It shows as LMGMT-ASR01 (10.4.10.27).
If I start to enable replication for a VM in portal, I can see the vcenter, the process server and the RunAs accounts. But I cannot get them with powershell. Am I doing something wrong, is there another way to get the info I need?
thanks