18 Commits

Author SHA1 Message Date
Wes Carroll 291aae9dcd Merge pull request #83 from ZertoPublic/ReleasePrep
Release prep
2020-05-17 11:26:23 -04:00
Wes Carroll f8f0d980d0 Update Unreleased to Release Number 2020-05-17 11:22:12 -04:00
Wes Carroll b72099559c Bump Version 2020-05-17 11:21:56 -04:00
Wes Carroll 6046103da0 Merge pull request #82 from ZertoPublic/Fix-ZertoStartClone
Fix zerto start clone
2020-05-17 11:18:15 -04:00
Wes Carroll cccd45b7fd Update ChangeLog 2020-05-17 11:07:31 -04:00
Wes Carroll 77b7e1c376 Fix Body Creation Method 2020-05-17 11:05:15 -04:00
Wes Carroll 8f735bee62 Correct body creation method 2020-05-17 11:04:41 -04:00
Wes Carroll de505debf9 Merge pull request #81 from ZertoPublic/Invoke-ZertoMoveCommit-Fix
Fix Invoke-ZertoMoveCommit
2020-05-13 10:38:31 -04:00
Wes Carroll bc570e9005 Update Changlog with MoveCommit Changes 2020-05-09 20:52:55 -04:00
Wes Carroll 804a60be77 Update for explicit switches 2020-05-09 20:10:13 -04:00
Wes Carroll 1e678214b1 Update for explicit reverse and keep params 2020-05-09 20:10:13 -04:00
Wes Carroll ba0b12e83c Add accepted values 2020-05-09 20:10:13 -04:00
Wes Carroll b33b07b524 Set Explicit Reverse\Keep Options 2020-05-09 20:10:13 -04:00
Wes Carroll d4b4d1b4d7 Merge pull request #80 from ZertoPublic:Get-ZertoEvent-Fix
Get zerto event fix
2020-05-09 11:04:59 -04:00
Wes Carroll fbe3f4d031 Add Get-ZertoEvent Fix 2020-05-09 10:36:37 -04:00
Wes Carroll 26cfb832a4 Update CHANGELOG.md 2020-05-07 20:49:16 -04:00
Wes Carroll 865ca1dd39 Update Logic to Convert VpgName to VpgIdentifier 2020-05-07 20:21:39 -04:00
Wes Carroll 2887f6d450 Update README.md
Fix link to updated WIKI page
2020-05-07 13:54:14 -04:00
13 changed files with 89 additions and 39 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/),
and this project is transitioning to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [1.4.2]
### Zerto Virtual Manager
#### Fixed
* Updated `Get-ZertoEvent` to translate a vpg name parameter to a vpgIdentifier per the API documentation
* Updated `Invoke-ZertoMoveCommit` to ensure that when one of the parameter switches is defined, all required parameters are sent to avoid conflicts with parameters passed with the `Invoke-ZertoMove` command.
* Updated `Start-ZertoCloneVpg` to fix an issue where an error would be thrown if an operation specified a subset of VMs to be cloned.
## [1.4.1]
### General
+1 -1
View File
@@ -27,7 +27,7 @@ PS> Install-Module -name ZertoApiWrapper
## Getting Started
* [Getting Started with Zerto Virtual Manager and the ZertoApiWrapper](https://github.com/ZertoPublic/ZertoApiWrapper/wiki/Getting-Stated-with-Zerto-Virtual-Manager)
* [Getting Started with Zerto Virtual Manager and the ZertoApiWrapper](https://github.com/ZertoPublic/ZertoApiWrapper/wiki/Getting-Started-with-Zerto-Virtual-Manager)
* [Getting Started with Zerto Analytics and the ZertoApiWrapper](https://github.com/ZertoPublic/ZertoApiWrapper/wiki/Getting-Started-with-Zerto-Analytics)
## Recent Updates
+1 -1
View File
@@ -12,7 +12,7 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' {
$ParameterTestCases = @(
@{ParameterName = 'startDate'; Type = 'String'; Mandatory = $false; Validation = 'NotNullOrEmpty' }
@{ParameterName = 'endDate'; Type = 'String'; Mandatory = $false; Validation = 'NotNullOrEmpty' }
@{ParameterName = 'vpgName'; Type = 'String'; Mandatory = $false; Validation = 'NotNullOrEmpty' }
@{ParameterName = 'vpg'; Type = 'String'; Mandatory = $false; Validation = 'NotNullOrEmpty' }
@{ParameterName = 'vpgIdentifier'; Type = 'String'; Mandatory = $false; Validation = 'NotNullOrEmpty' }
@{ParameterName = 'eventType'; Type = 'String'; Mandatory = $false; Validation = 'NotNullOrEmpty' }
@{ParameterName = 'siteName'; Type = 'String'; Mandatory = $false; Validation = 'NotNullOrEmpty' }
+6 -2
View File
@@ -19,8 +19,8 @@ function Get-ZertoEvent {
HelpMessage = "The name of the VPG for which you want to return events."
)]
[ValidateNotNullOrEmpty()]
[Alias("vpg")]
[string]$vpgName,
[Alias("vpgName")]
[string]$vpg,
[Parameter(
ParameterSetName = "filter",
HelpMessage = "The identifier of the VPG for which you want to return events."
@@ -137,6 +137,10 @@ function Get-ZertoEvent {
# If a filter is applied, create the filter and return the events that fall in that filter
"filter" {
$filter = Get-ZertoApiFilter -filterTable $PSBoundParameters
if ($PSBoundParameters.Keys -contains 'vpg') {
$vpgIdentifier = (Get-ZertoVpg -name $vpg).vpgIdentifier
$filter = $filter.replace("vpg=$vpg", "vpg=$vpgIdentifier")
}
$uri = "{0}{1}" -f $baseUri, $filter
$returnObject = Invoke-ZertoRestRequest -uri $uri
}
@@ -1,6 +1,6 @@
<# .ExternalHelp ./en-us/ZertoApiWrapper-help.xml #>
function Invoke-ZertoMoveCommit {
[cmdletbinding(SupportsShouldProcess = $true)]
[cmdletbinding(SupportsShouldProcess = $true, DefaultParameterSetName = "Main")]
param(
[Parameter(
HelpMessage = "Name(s) of the VPG(s) to commit.",
@@ -9,11 +9,16 @@ function Invoke-ZertoMoveCommit {
[ValidateNotNullOrEmpty()]
[string[]]$vpgName,
[Parameter(
HelpMessage = "Set this to True to reverse protect the VPG(s) to the source site. If not set, will use selection made during move initiation. True or False"
HelpMessage = "Use this switch to reverse protect the VPG(s) to the source site. If neither 'ReverseProtction' nor 'KeepSourceVms' switch is specified, the commit process will use selection made during move initiation.",
ParameterSetName = 'ReverseProtect',
Mandatory
)]
[switch]$reverseProtection,
[Parameter(
HelpMessage = "Use this switch to keep the source VMs. If not set, they will be destroyed."
HelpMessage = "Use this switch to keep the source VMs at the source site. If neither 'ReverseProtction' nor 'KeepSourceVms' switch is specified, the commit process will use selection made during move initiation.",
ParameterSetName = 'KeepSource',
Mandatory
)]
[switch]$keepSourceVms
)
@@ -21,10 +26,16 @@ function Invoke-ZertoMoveCommit {
begin {
$baseUri = "vpgs"
$body = @{ }
if ($reverseProtection) {
$body["ReverseProtection"] = $true
} elseif ($keepSourceVms) {
$body["KeepSourceVms"] = $true
Switch ($PSCmdlet.ParameterSetName){
'KeepSource' {
$body["KeepSourceVms"] = $true
$body["ReverseProtection"] = $false
}
'ReverseProtect' {
$body["ReverseProtection"] = $true
$body["KeepSourceVms"] = $false
}
}
}
+11 -16
View File
@@ -27,18 +27,25 @@ function Start-ZertoCloneVpg {
)
begin {
}
process {
$baseUri = "vpgs"
$vpgInfo = Get-ZertoVpg -name $vpgName
if ( -not $vpgInfo ) {
Write-Error "VPG: $vpgName could not be found. Please check the name and try again."
}
$vpgIdentifier = $vpgInfo.vpgIdentifier
$body = @{ }
if ( $PSBoundParameters.ContainsKey('datastoreName') ) {
$recoverysiteIdentifier = $vpgInfo.recoverysite.identifier
$recoverySiteDatastores = Get-ZertoVirtualizationSite -siteIdentifier $recoverysiteIdentifier -datastores
$datastoreIdentifier = $($recoverySiteDatastores | Where-Object { $_.datastoreName -like $datastoreName }).DatastoreIdentifier
if ( -not $datastoreIdentifier ) {
Write-Error "Datastore: $datastoreName is not a valid datastore. Please check the name and try again." -ErrorAction Stop
} else {
$body['DatastoreIdentifier'] = $datastoreIdentifier
}
}
if ( $PSBoundParameters.ContainsKey('vmName') ) {
@@ -55,32 +62,20 @@ function Start-ZertoCloneVpg {
}
}
$body['VmIdentifiers'] = $vmIdentifiers
if ($checkpointIdentifier) {
$body['CheckpointIdentifier'] = $checkpointIdentifier
}
}
}
process {
$uri = "{0}/{1}/CloneStart" -f $baseUri, $vpgIdentifier
$body = [ordered]@{ }
if ( $PSBoundParameters.ContainsKey('checkpointIdentifier') ) {
$body['checkpointId'] = $checkpointIdentifier
}
if ( $datastoreIdentifier ) {
$body['DatastoreIdentifier'] = $datastoreIdentifier
}
if ( $vmIdentifiers ) {
$body['VmIdentifiers'] = $vmIdentifiers
}
Write-Verbose $body
$uri = "{0}/{1}/CloneStart" -f $baseUri, $vpgIdentifier
if ($PSCmdlet.ShouldProcess("Clone Vpg")) {
Invoke-ZertoRestRequest -uri $uri -body $($body | ConvertTo-Json) -method "POST"
Write-Verbose "Call Submitted to $uri"
Write-Verbose "With the following information: $($body | ConvertTo-Json)"
}
}
end {
Write-Verbose "Call Submitted to $uri"
Write-Verbose "With the following information: $($body | ConvertTo-Json)"
}
}
+3
View File
@@ -112,6 +112,7 @@ The type of event to return. This filter behaves in the same way as the eventCat
Type: String
Parameter Sets: filter
Aliases:
Accepted values: All, Events, Alerts
Required: False
Position: Named
@@ -159,6 +160,7 @@ The type of entity for which you wish to return results. Possible Values are: 'V
Type: String
Parameter Sets: filter
Aliases:
Accepted values: VPG, VRA, Unknown, Site
Required: False
Position: Named
@@ -174,6 +176,7 @@ This filter behaves in the same way as the category filter. If both category and
Type: String
Parameter Sets: filter
Aliases:
Accepted values: All, Events, Alerts
Required: False
Position: Named
+1
View File
@@ -88,6 +88,7 @@ The priority specified for the VPG. Possible values are: 'Low', 'Medium', or 'Hi
Type: String
Parameter Sets: filter
Aliases:
Accepted values: Low, Medium, High
Required: False
Position: Named
+1
View File
@@ -102,6 +102,7 @@ Possible values are: 'Failover', 'Failover Test', or 'Move'
Type: String
Parameter Sets: filter
Aliases:
Accepted values: Failover, Failover Test, Move
Required: False
Position: Named
+1
View File
@@ -129,6 +129,7 @@ The status of the task. Possible values are: 'InProgress', 'Paused', 'Failed', '
Type: String
Parameter Sets: filter
Aliases:
Accepted values: InProgress, Paused, Failed, Completed, Cancelling
Required: False
Position: Named
+1
View File
@@ -271,6 +271,7 @@ The VPG priority. Possible values are: 'Low', 'Medium', 'High'
Type: String
Parameter Sets: filter
Aliases:
Accepted values: Low, Medium, High
Required: False
Position: Named
+34 -11
View File
@@ -12,9 +12,19 @@ Commit a VPG currently undergoing a move operation.
## SYNTAX
### Main (Default)
```
Invoke-ZertoMoveCommit [-vpgName] <String[]> [-reverseProtection] [-keepSourceVms] [-WhatIf] [-Confirm]
[<CommonParameters>]
Invoke-ZertoMoveCommit -vpgName <String[]> [-WhatIf] [-Confirm] [<CommonParameters>]
```
### ReverseProtect
```
Invoke-ZertoMoveCommit -vpgName <String[]> [-reverseProtection] [-WhatIf] [-Confirm] [<CommonParameters>]
```
### KeepSource
```
Invoke-ZertoMoveCommit -vpgName <String[]> [-keepSourceVms] [-WhatIf] [-Confirm] [<CommonParameters>]
```
## DESCRIPTION
@@ -27,20 +37,33 @@ Commit a VPG currently undergoing a move operation.
PS C:\> Invoke-ZertoMoveCommit -vpgName "MyVpg"
```
Commit VPG "MyVpg" after a move has been started.
Commit VPG "MyVpg" after a move operation has been completed. This commit process with use the `-KeepSourceVms` or `-ReverseProtection` selection made during the move initation.
### Example 2
```powershell
PS C:\> Invoke-ZertoMoveCommit -vpgName "MyVpg" -keepSourceVms
```
Commit VPG "MyVpg" after a move operation has been completed specifying to keep the vms at the source location and NOT reverse protection. This commit process will overrule any reverse protection or keep source vms selection made during the move initiation.
### Example 3
```powershell
PS C:\> Invoke-ZertoMoveCommit -vpgName "MyVpg" -reverseProtection
```
Commit VPG "MyVpg" after a move operation has been completed specifying to reverse protection of the VMs back to the source location. The VMs at the source location will be removed from inventory at the source location and the disks will be used as pre-seed volumes. This commit process will overrule any reverse protection or keep source vms selection made during the move initiation.
## PARAMETERS
### -keepSourceVms
Use this switch to keep the source VMs.
If not set, they will be destroyed.
"Use this switch to keep the source VMs at the source site. If neither 'ReverseProtction' nor 'KeepSourceVms' switch is specified, the commit process will use selection made during move initiation."
```yaml
Type: SwitchParameter
Parameter Sets: (All)
Parameter Sets: KeepSource
Aliases:
Required: False
Required: True
Position: Named
Default value: None
Accept pipeline input: False
@@ -48,14 +71,14 @@ Accept wildcard characters: False
```
### -reverseProtection
Set this to True to reverse protect the VPG(s) to the source site. If not set, will use selection made during move initiation. True or False
"Use this switch to reverse protect the VPG(s) to the source site. If neither 'ReverseProtction' nor 'KeepSourceVms' switch is specified, the commit process will use selection made during move initiation."
```yaml
Type: SwitchParameter
Parameter Sets: (All)
Parameter Sets: ReverseProtect
Aliases:
Required: False
Required: True
Position: Named
Default value: None
Accept pipeline input: False
@@ -71,7 +94,7 @@ Parameter Sets: (All)
Aliases:
Required: True
Position: 0
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
+1 -1
View File
@@ -1 +1 @@
1.4.1
1.4.2