VMware Cloud Community
rshenoy
Enthusiast
Enthusiast

New SRM powercli cmdlets introduced in 6.5 should be executed from protected vCenter or recovery vCenter.

Our organization is mainly in to disaster recovery. We mainly manage the DR environment and Prod is managed by customer themselves,SRM is one of the technologies used for DR.

Hence we do not have required access on protected sites.

We have been planning to automate SRM tasks using powercli like fetching reports for protection group, protected VM status but by connecting from recovery site. I have observed that API called using powercli contacts vCenter MOB for any information. In this scenario if you need to fetch appropriate results one can connect to recovery site and get the desired results or we must connect via protected site and execute the required scripts.

When i execute Get-SRMProtectedVM I do not get the necessary details and I keep getting error along with the output as listed below. I was under a impression I would get VM name too but that does not seem to be the case.

Get-SrmProtectedVM : Exception calling "UpdateViewData" with "0" argument(s): "The object has already been deleted or has not been completely created"

At line:1 char:1

+ Get-SrmProtectedVM

+ ~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [Write-Error], WriteErrorException

    + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Get-SrmProtectedVM

Vm                 : VMware.Vim.VirtualMachine

ProtectedVm        : protected-vm-44339

PeerProtectedVm    : protected-vm-55893

State              : Shadowing

PeerState          : Ready

NeedsConfiguration : False

Faults             :

Any leads would be very helpful.

Tags (1)
Reply
0 Kudos
1 Reply
kriskearley
Contributor
Contributor

I know this is an old post and you may have figured it out already but if you map the vm value you can use the get-view command to get the full object details.

$vm = get-srmprotectedvm -name "SERVER NAME" | select vm

get-view $vm

Pretty sure that's the correct syntax.

Reply
0 Kudos