Merge pull request #58 from ZertoPublic/FoT-Fix
Fixes Failover Test function
This commit is contained in:
@@ -7,6 +7,7 @@
|
|||||||
* A new function has been added; `New-ZertoPairingToken`. This function will allow users to generate a pairing authentication token from the target ZVM to be used in the pairing process. [Issue 47](https://github.com/ZertoPublic/ZertoApiWrapper/issues/47) covers additional details.
|
* A new function has been added; `New-ZertoPairingToken`. This function will allow users to generate a pairing authentication token from the target ZVM to be used in the pairing process. [Issue 47](https://github.com/ZertoPublic/ZertoApiWrapper/issues/47) covers additional details.
|
||||||
* A new function has been added; `Invoke-ZertoEvacuateVra`. This function will allow users to evacuate a target VRA by specifying a Host Name, VRA Name, or VRA Identifier. All VMs currently replicating to the specified location will be migrated to different targets. [Issue 51](https://github.com/ZertoPublic/ZertoApiWrapper/issues/51)
|
* A new function has been added; `Invoke-ZertoEvacuateVra`. This function will allow users to evacuate a target VRA by specifying a Host Name, VRA Name, or VRA Identifier. All VMs currently replicating to the specified location will be migrated to different targets. [Issue 51](https://github.com/ZertoPublic/ZertoApiWrapper/issues/51)
|
||||||
* A function has been added; `Copy-ZertoVpg`. This function will allow users to copy the settings of a single VPG and add new VMs to it. There is currently no customization beyond specifying the VMs to be placed in the newly created VPG. Should additional edits \ updates be required, they should be done post creation. [Issue 54](https://github.com/ZertoPublic/ZertoApiWrapper/issues/54)
|
* A function has been added; `Copy-ZertoVpg`. This function will allow users to copy the settings of a single VPG and add new VMs to it. There is currently no customization beyond specifying the VMs to be placed in the newly created VPG. Should additional edits \ updates be required, they should be done post creation. [Issue 54](https://github.com/ZertoPublic/ZertoApiWrapper/issues/54)
|
||||||
|
* Fixed [issue 57](https://github.com/ZertoPublic/ZertoApiWrapper/issues/57) where a `Start-ZertoFailoverTest` would throw an error complaining about validating the body parameter. This has been fixed and tested against Zerto Virtual Manager 7.5 Update 1 with Windows PowerShell 5.1 and PowerShell Core 6.2.
|
||||||
|
|
||||||
### Zerto Analytics
|
### Zerto Analytics
|
||||||
|
|
||||||
|
|||||||
@@ -89,7 +89,7 @@ function Invoke-ZertoMove {
|
|||||||
Write-Error "VPG: $name not found. Please check the name and try again. Skipping"
|
Write-Error "VPG: $name not found. Please check the name and try again. Skipping"
|
||||||
} else {
|
} else {
|
||||||
$uri = "{0}/{1}/move" -f $baseUri, $vpgId
|
$uri = "{0}/{1}/move" -f $baseUri, $vpgId
|
||||||
if ($PSCmdlet.ShouldProcess("Moving VPG: $name wiht settings: $($body | convertto-json)")) {
|
if ($PSCmdlet.ShouldProcess("Moving VPG: $name with settings: $($body | convertto-json)")) {
|
||||||
Invoke-ZertoRestRequest -uri $uri -method "POST" -body $($body | ConvertTo-Json)
|
Invoke-ZertoRestRequest -uri $uri -method "POST" -body $($body | ConvertTo-Json)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -27,11 +27,12 @@ function Start-ZertoFailoverTest {
|
|||||||
if ( -not $vpgIdentifier) {
|
if ( -not $vpgIdentifier) {
|
||||||
Write-Error "VPG: $vpgName Not Found. Please check the name and try again!" -ErrorAction Stop
|
Write-Error "VPG: $vpgName Not Found. Please check the name and try again!" -ErrorAction Stop
|
||||||
}
|
}
|
||||||
|
$body = @{ }
|
||||||
if ( $PSBoundParameters.ContainsKey('vmName') ) {
|
if ( $PSBoundParameters.ContainsKey('vmName') ) {
|
||||||
$vpgVmInformation = Get-ZertoProtectedVm -vpgName $vpgName
|
$vpgVmInformation = Get-ZertoProtectedVm -vpgName $vpgName
|
||||||
[System.Collections.ArrayList]$vmIdentifiers = @()
|
$vmIdentifiers = [System.Collections.Generic.List[string]]::new()
|
||||||
foreach ( $name in $vmName ) {
|
foreach ( $name in $vmName ) {
|
||||||
$selectedVm = $vpgVmInformation | Where-Object {$_.VmName.toLower() -eq $name.toLower()}
|
$selectedVm = $vpgVmInformation | Where-Object { $_.VmName.toLower() -eq $name.toLower() }
|
||||||
if ($null -eq $selectedVm) {
|
if ($null -eq $selectedVm) {
|
||||||
Write-Error "VM: $name NOT found in VPG $vpgName. Check the name and try again." -ErrorAction Stop
|
Write-Error "VM: $name NOT found in VPG $vpgName. Check the name and try again." -ErrorAction Stop
|
||||||
} elseif ($vmIdentifiers.Contains($selectedVm.vmIdentifier.toString())) {
|
} elseif ($vmIdentifiers.Contains($selectedVm.vmIdentifier.toString())) {
|
||||||
|
|||||||
Reference in New Issue
Block a user