VMware Cloud Community
Susanta_Dutta
Contributor
Contributor

Automating SRM 8.3 vVol replication operations through PowerCLI Cmdlets

Hello,

We are trying to automate SRM 8.3 vVol operations through PowerCLI Cmdlets

SRM PowerCLI Cmdlets available are working for failover and reprotect of vVol replication groups, but not creation and deletion of Protection Groups. Can someone help to get latest script that includes SRM 8.3 vVol replication.

https://code.vmware.com/web/sdk/8.3/site-recovery-manager

We also do not find these new vVol Specific APIs. Are we missing something

o. SrmProtection/CreateVvolProtectionGroup
o. SrmProtectionGroup/GetVvolGroupDetails
o. SrmProtectionGroup/ReconfigureVvolProtectionGroup
o. SrmVvolReplication/GetDomains
o. SrmVvolReplication/GetUnprotectedVms
o. SrmVvolReplication/Rescan

PS /> Connect-VIServer -Server 'vCenter.domain.com' -User 'Administrator@vsphere.local' -Password ‘Password'

Name Port User
---- ---- ----
vCenter.domain.com… 443 VSPHERE.LOCAL\Administrator

PS />
PS /> $SrmServer = Connect-SrmServer -Port 443
PS /> $SrmServer
ServiceUri : https://SRM1.domain.com/vcdr/extapi/sdk
SessionSecret : "8a7adc020608f4412a714685fbf51073514b27bb"
User : VSPHERE.LOCAL\Administrator
IsConnected : True
Port : 443
Version : 8.3.0
Build : 15928802
ProductLine : srm
InstanceUuid : baf2bf5b-0040-474f-8c72-3ff0609b6b55
RefCount : 1
ExtensionData : VMware.VimAutomation.Srm.Views.SrmServiceInstance
Uid : /SrmServer=vsphere.local\administrator@SRM1.domain.com:443/
Id : /SrmServer=vsphere.local\administrator@SRM1.domain.com:443/
Name : SRM1.domain.com
IsInUse : True


PS />
PS /> $SrmApi = $SrmServer.ExtensionData
PS /> $SrmApi |FL

Content : VMware.VimAutomation.Srm.Views.SrmServiceInstanceContent
Recovery : VMware.VimAutomation.Srm.Views.SrmRecovery
Protection : VMware.VimAutomation.Srm.Views.SrmProtection
Storage : VMware.VimAutomation.Srm.Views.SrmStorage
MoRef : SrmServiceInstance-SrmServiceInstance


PS />
PS /> $SrmApi.Protection | gm


TypeName: VMware.VimAutomation.Srm.Views.SrmProtection

Name MemberType Definition
---- ---------- ----------
CreateAbrProtectionGroup Method VMware.VimAutomation.Srm.Views.SrmCreateProtectionGroupTask CreateAbrProtec…
CreateHbrProtectionGroup Method VMware.VimAutomation.Srm.Views.SrmCreateProtectionGroupTask CreateHbrProtec…
Equals Method bool Equals(System.Object obj)
GetHashCode Method int GetHashCode()
GetProtectionGroupRootFolder Method VMware.VimAutomation.Srm.Views.SrmProtectionGroupFolder GetProtectionGroupR…
GetType Method type GetType()
ListInventoryMappings Method VMware.VimAutomation.Srm.Views.SrmProtectionInventoryMappingInfo ListInvent…
ListProtectedDatastores Method System.Collections.Generic.List[VMware.Vim.Datastore] ListProtectedDatastor…
ListProtectedVms Method System.Collections.Generic.List[VMware.Vim.VirtualMachine] ListProtectedVms…
ListProtectionGroups Method System.Collections.Generic.List[VMware.VimAutomation.Srm.Views.SrmProtectio…
ListReplicatedDatastores Method System.Collections.Generic.List[VMware.Vim.Datastore] ListReplicatedDatasto…
ListUnassignedReplicatedDatastores Method System.Collections.Generic.List[VMware.Vim.Datastore] ListUnassignedReplica…
ListUnassignedReplicatedVms Method System.Collections.Generic.List[VMware.Vim.VirtualMachine] ListUnassignedRe…
RemoveProtectionGroup Method VMware.VimAutomation.Srm.Views.RemoveProtectionGroupTask RemoveProtectionGr…
ToString Method string ToString()
MoRef Property VMware.Vim.ManagedObjectReference MoRef {get;set;}

PS />
PS /> $pgs = $SrmApi.Protection.ListProtectionGroups()
PS /> $pgs[0] | gm


TypeName: VMware.VimAutomation.Srm.Views.SrmProtectionGroup

Name MemberType Definition
---- ---------- ----------
AddDatastores Method void AddDatastores(VMware.Vim.ManagedObjectReference[] datastores)
AssociateVms Method void AssociateVms(VMware.Vim.ManagedObjectReference[] vms)
CheckConfigured Method bool CheckConfigured()
Equals Method bool Equals(System.Object obj)
GetHashCode Method int GetHashCode()
GetInfo Method VMware.VimAutomation.Srm.Views.SrmProtectionGroupInfo GetInfo()
GetParentFolder Method VMware.VimAutomation.Srm.Views.SrmProtectionGroupFolder GetParentFolder()
GetPeer Method VMware.VimAutomation.Srm.Views.SrmProtectionGroupPeer GetPeer()
GetProtectionState Method VMware.VimAutomation.Srm.Views.SrmProtectionGroupProtectionState GetProtectionState()
GetType Method type GetType()
ListAssociatedVms Method System.Collections.Generic.List[VMware.Vim.VirtualMachine] ListAssociatedVms()
ListProtectedDatastores Method System.Collections.Generic.List[VMware.Vim.Datastore] ListProtectedDatastores()
ListProtectedVms Method System.Collections.Generic.List[VMware.VimAutomation.Srm.Views.SrmProtectionGroupProtectedVm] ListProtectedVms()
ListRecoveryPlans Method System.Collections.Generic.List[VMware.VimAutomation.Srm.Views.SrmRecoveryPlan] ListRecoveryPlans()
ProtectionGroupGetOperationalLocation Method string ProtectionGroupGetOperationalLocation()
ProtectVms Method VMware.VimAutomation.Srm.Views.SrmProtectionTask ProtectVms(VMware.VimAutomation.Srm.Views.SrmProtectionGroupVmProtec…
QueryVmProtection Method System.Collections.Generic.List[VMware.VimAutomation.Srm.Views.SrmProtectionGroupVmProtectionInfo] QueryVmProtection(…
RemoveDatastores Method void RemoveDatastores(VMware.Vim.ManagedObjectReference[] datastores)
ToString Method string ToString()
UnassociateVms Method void UnassociateVms(VMware.Vim.ManagedObjectReference[] vms)
UnprotectVms Method VMware.VimAutomation.Srm.Views.SrmProtectionTask UnprotectVms(VMware.Vim.ManagedObjectReference[] vms)
MoRef Property VMware.Vim.ManagedObjectReference MoRef {get;set;}

PS />
PS /> $SrmApi.Recovery | gm


TypeName: VMware.VimAutomation.Srm.Views.SrmRecovery

Name MemberType Definition
---- ---------- ----------
CreateRecoveryPlan Method VMware.VimAutomation.Srm.Views.CreateRecoveryPlanTask CreateRecoveryPlan(string name…
DeleteRecoveryPlan Method VMware.VimAutomation.Srm.Views.DeleteRecoveryPlanTask DeleteRecoveryPlan(VMware.Vim.…
Equals Method bool Equals(System.Object obj)
GetHashCode Method int GetHashCode()
GetHistory Method VMware.VimAutomation.Srm.Views.SrmRecoveryHistory GetHistory(VMware.Vim.ManagedObjec…
GetRecoveryPlanRootFolder Method VMware.VimAutomation.Srm.Views.SrmRecoveryPlanFolder GetRecoveryPlanRootFolder()
GetType Method type GetType()
ListPlans Method System.Collections.Generic.List[VMware.VimAutomation.Srm.Views.SrmRecoveryPlan] List…
ToString Method string ToString()
MoRef Property VMware.Vim.ManagedObjectReference MoRef {get;set;}

PS />
PS /> $SrmApi.Storage | gm


TypeName: VMware.VimAutomation.Srm.Views.SrmStorage

Name MemberType Definition
---- ---------- ----------
DiscoverDevices Method VMware.VimAutomation.Srm.Views.DiscoverDevicesTask DiscoverDevices()
Equals Method bool Equals(System.Object obj)
GetHashCode Method int GetHashCode()
GetType Method type GetType()
ToString Method string ToString()
MoRef Property VMware.Vim.ManagedObjectReference MoRef {get;set;}

PS />

0 Kudos
1 Reply
SANKETHSHETTY
Contributor
Contributor

You will need powercli 12.1 to connect to SRM 8.3 

Tags (1)
0 Kudos