5 Commits

Author SHA1 Message Date
justin b3e27c8ef7 Updates for 10.7p1
Added Scope to the keycloak call.
2025-09-17 08:32:17 -04:00
justin 5b9c692f5b updated comment lines and port for pairing
Updated pairing port to default for zvma, and fixed external docs line for pester testing
2025-02-17 16:20:07 -05:00
justin 31638c5f48 Delete test.ps1
removed old test file
2025-02-17 14:31:47 -05:00
justin a7642eee67 Bumped Version for 131 Fix
This commit and the previous commit fix the Import-ZertoVmNicSettings function for 10.0.

Fixes #131
2025-02-17 13:52:17 -05:00
justin 42ac97ca4c Update Import-ZertoVmNicSetting.ps1 2025-02-17 13:45:49 -05:00
12 changed files with 25 additions and 36 deletions
+10
View File
@@ -5,6 +5,16 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project is transitioning to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). and this project is transitioning to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [2.1.0]
### Added
* Added Support for Zerto 10.7u1 Virtual Appliance - You can now authenticate to Zerto Virtual Appliances and run the other functions of this module.
### Updated
* Updated `Invoke-ZertoRestRequest` function [help documentation](https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Install-ZertoVra.md)
## [2.0.0] ## [2.0.0]
### Added ### Added
-1
View File
@@ -36,7 +36,6 @@ All recent updates can now be tracked via the [Change Log](https://github.com/Ze
## TODO ## TODO
* Support ZVM appliance (different connection flow)
* JFLR Functionality * JFLR Functionality
* Create VPG (Per-VM modification and Backup Settings) * Create VPG (Per-VM modification and Backup Settings)
* Edit VPG * Edit VPG
+3 -3
View File
@@ -9,12 +9,12 @@ function Add-ZertoPeerSite {
[ValidateNotNullOrEmpty()] [ValidateNotNullOrEmpty()]
[string]$targetHost, [string]$targetHost,
[Parameter( [Parameter(
HelpMessage = "Target communication port. Default is 9081" HelpMessage = "Target communication port. Default is 9071 for Zerto 10.0 and Later. For ZVR 9.7 and earlier, use port 9081."
)] )]
[ValidateRange(1024, 65535)] [ValidateRange(1024, 65535)]
[int]$targetPort = 9081, [int]$targetPort = 9071,
[Parameter( [Parameter(
HelpMessage = "The generated token from the destination site. Note: This is only supported when both sites support pairing authentication. This was implemented to support ZVR 7.5 and later." HelpMessage = "The generated token from the destination site. Note: This is only supported when both sites support pairing authentication. This was implemented to support ZVR 10.0 and later."
)] )]
[ValidateNotNullOrEmpty()] [ValidateNotNullOrEmpty()]
[string]$token [string]$token
@@ -1,5 +1,4 @@
<# .ExternalHelp ./en-us/ZertoApiWrapper-help.xml <# .ExternalHelp ./en-us/ZertoApiWrapper-help.xml #>
#>
function Connect-ZertoAnalytics { function Connect-ZertoAnalytics {
[cmdletbinding()] [cmdletbinding()]
param( param(
@@ -1,5 +1,4 @@
<# .ExternalHelp ./en-us/ZertoApiWrapper-help.xml <# .ExternalHelp ./en-us/ZertoApiWrapper-help.xml #>
#>
function Connect-ZertoServer { function Connect-ZertoServer {
[cmdletbinding()] [cmdletbinding()]
[OutputType([hashtable])] [OutputType([hashtable])]
@@ -1,5 +1,4 @@
<# .ExternalHelp ./en-us/ZertoApiWrapper-help.xml <# .ExternalHelp ./en-us/ZertoApiWrapper-help.xml #>
#>
function Disconnect-ZertoServer { function Disconnect-ZertoServer {
[cmdletbinding()] [cmdletbinding()]
param() param()
+1 -2
View File
@@ -1,5 +1,4 @@
<# .ExternalHelp ./en-us/ZertoApiWrapper-help.xml <# .ExternalHelp ./en-us/ZertoApiWrapper-help.xml #>
#>
function Get-ZertoVpg { function Get-ZertoVpg {
[cmdletbinding( DefaultParameterSetName = "main" )] [cmdletbinding( DefaultParameterSetName = "main" )]
param( param(
@@ -53,6 +53,7 @@ function Import-ZertoVmNicSetting {
$NicUri = "{0}/nics/{1}" -f $uri, $nic.NicIdentifier $NicUri = "{0}/nics/{1}" -f $uri, $nic.NicIdentifier
Invoke-ZertoRestRequest -uri $NicUri -Method "DELETE" > $null Invoke-ZertoRestRequest -uri $NicUri -Method "DELETE" > $null
$nicSettings = Invoke-ZertoRestRequest -uri $NicUri -Method "GET" $nicSettings = Invoke-ZertoRestRequest -uri $NicUri -Method "GET"
$nicSettings.failover.Hypervisor.ShouldReplaceIpConfiguration = "True"
$nicSettings.failover.Hypervisor.NetworkIdentifier = $NetworkMap[$vm.LiveNetwork] $nicSettings.failover.Hypervisor.NetworkIdentifier = $NetworkMap[$vm.LiveNetwork]
$nicSettings.failover.Hypervisor.ShouldReplaceMacAddress = $vm.LiveShouldReplaceMac $nicSettings.failover.Hypervisor.ShouldReplaceMacAddress = $vm.LiveShouldReplaceMac
if ($vm.LiveIsDHCP -imatch "true") { if ($vm.LiveIsDHCP -imatch "true") {
@@ -77,6 +78,7 @@ function Import-ZertoVmNicSetting {
$nicSettings.failover.Hypervisor.IpConfig = $IpConfig $nicSettings.failover.Hypervisor.IpConfig = $IpConfig
$nicSettings.failover.Hypervisor.DnsSuffix = $vm.LiveDnsSuffix $nicSettings.failover.Hypervisor.DnsSuffix = $vm.LiveDnsSuffix
} }
$nicSettings.failoverTest.Hypervisor.ShouldReplaceIpConfiguration = "True"
$nicSettings.failoverTest.Hypervisor.NetworkIdentifier = $NetworkMap[$vm.TestNetwork] $nicSettings.failoverTest.Hypervisor.NetworkIdentifier = $NetworkMap[$vm.TestNetwork]
$nicSettings.failoverTest.Hypervisor.ShouldReplaceMacAddress = $vm.TestShouldReplaceMac $nicSettings.failoverTest.Hypervisor.ShouldReplaceMacAddress = $vm.TestShouldReplaceMac
if ($vm.TestIsDHCP -imatch "true" ) { if ($vm.TestIsDHCP -imatch "true" ) {
@@ -1,3 +1,6 @@
<#
.ExternalHelp ./en-us/ZertoApiWrapper-help.xml
#>
function Invoke-ZertoRestRequest { function Invoke-ZertoRestRequest {
[cmdletbinding()] [cmdletbinding()]
param( param(
@@ -63,6 +66,7 @@ function Invoke-ZertoRestRequest {
'username' = $credential.GetNetworkCredential().UserName 'username' = $credential.GetNetworkCredential().UserName
'password' = $credential.GetNetworkCredential().Password 'password' = $credential.GetNetworkCredential().Password
'grant_type' = 'password' 'grant_type' = 'password'
'scope' = 'openid'
} }
$params = @{ $params = @{
+1 -1
View File
@@ -12,7 +12,7 @@
RootModule = '.\ZertoApiWrapper.psm1' RootModule = '.\ZertoApiWrapper.psm1'
# Version number of this module. # Version number of this module.
ModuleVersion = '2.0.0' ModuleVersion = '2.1.0'
# Supported PSEditions # Supported PSEditions
# CompatiblePSEditions = @() # CompatiblePSEditions = @()
-22
View File
@@ -1,22 +0,0 @@
$Body = @{
'client_id' = 'zerto-client'
'username' = 'admin'
'password' = 'Zertodata987!'
'grant_type' = 'password'
}
$Params = @{
'Uri' = 'https://192.168.50.60/auth/realms/zerto/protocol/openid-connect/token'
'Method' = 'Post'
'Body' = $Body
'ContentType' = 'application/x-www-form-urlencoded'
}
$Result = Invoke-RestMethod @Params -SkipCertificateCheck
Write-Host $Result
$ExpiresIn = $Result.expires_in
$ExpiresAt = (Get-Date).AddSeconds($ExpiresIn)
Write-Host $ExpiresAt
Write-Host $Result
+1 -1
View File
@@ -1 +1 @@
2.0.0 2.1.0