ZertoPublic / ZertoApiWrapper

PowerShell wrapper for Zerto Virtual Manager API
GNU General Public License v3.0
15 stars 12 forks source link

Copy-Zerto VPG bug fixes and VCD compatibility #130

Open alex-colvin opened 2 weeks ago

alex-colvin commented 2 weeks ago

Copy-ZertoVPG is lacking functionality when run at the recovery site ZVM and for VCD sites. I'm proposing adding an optional parameter to this function to add the VCD StorageProfile Identifier, which is added to the appropriate spot in the vpg settings object. On top of this I am adding source site IDs parameters to bother get-zerto(un)protectedVM functions to be able to run this function at the recovery site ZVM. Ordinarily I make 2 commits here, but these changes paired together were necessary for the function to work for me.

Description

Added Parameter for VCD compatibility Used parameters in the VM functions to specify source site. updated error action on the vm POST request so you can run the function in a for loop without breaking when vms aren't found. Added if statement to check for VCD settings and to input the VCD storage profile identifier Updated Docs

Related Issue

Copy-ZertoVpg bug fixes and VCD compatibility #129

Motivation and Context

When mapping the VMs to add to the VPG, The VMs only populate from the local site. If you are connected to the recovery site, the function will not find the VMs. Additionally, VPG settings PUTs and POSTs fail without the VCD StorageProfile added to the VPG settings object, so I will throw that in my solutions as well.

How Has This Been Tested?

I tested this on Mulittenant cloud ZVMA connected to VCD Module version used: 2.0.0 Operating System and PowerShell version: Windows 10 PSVersion 5.1.19041.4648 Zerto Virtual Manager Version: 10.0.1 U2

Screenshots (if appropriate):

Types of changes

Checklist: