- This topic has 1 reply, 2 voices, and was last updated December 20, 2022 by Chris R.
VGP Failover Test
The forum ‘Scripting and APIs’ is closed to new topics and replies.
Hello everyone: I’m trying to create a power shell script to be able to do a failover test of several VPG’s that can be read from a csv file the name of each VPG that I need to test. If anyone can help me or guide me with this, please. Thanks for the help.
To failover VPGs (Virtual Protection Groups) in Zerto using PowerShell, you can use the following steps:
Install-Module -Name Zerto -Scope CurrentUser
Import-Module Zerto
Connect-Zvm -ZvmIPAddress “zvm_ip_address” -UserName “username” -Password “password”
$vpgs = Get-ZertoVpg -Name “vpg_name”
$vpgNames = Import-Csv -Path “C:\path\to\vpgs.csv”
foreach ($vpgName in $vpgNames) {
$vpg = Get-ZertoVpg -Name $vpgName.Name
Start-ZertoVpgFailover -Vpg $vpg -AsTest
}
This code will read the CSV file, retrieve the VPG object for each VPG name, and then start a test failover for each VPG.
Regards
Chris
The forum ‘Scripting and APIs’ is closed to new topics and replies.