Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not checking correct cluster with Test-RubrikSLA on various cmdlets #659

Closed
railroadmanuk opened this issue Jul 14, 2020 · 3 comments · Fixed by #687
Closed

Not checking correct cluster with Test-RubrikSLA on various cmdlets #659

railroadmanuk opened this issue Jul 14, 2020 · 3 comments · Fixed by #687
Assignees
Labels

Comments

@railroadmanuk
Copy link
Contributor

railroadmanuk commented Jul 14, 2020

Current Behavior:

Get-RubrikVM uses the following code to test the SLA before firing the request:

$SLAID = Test-RubrikSLA -SLA $SLA -Inherit $Inherit -DoNotProtect $DoNotProtect -PrimaryClusterID $PrimaryClusterID

The following cmdlets use different code:

Get-RubrikFileset
Get-RubrikNutanixVM
Get-RubrikHyperVVM
Get-RubrikDatabase
Get-RubrikManagedVolume
Get-RubrikVolumeGroup

These use:

$SLAID = Test-RubrikSLA -SLA $SLA -Inherit $Inherit -DoNotProtect $DoNotProtect

And because Test-RubrikSLA defaults to PrimaryClusterID="local", we cannot search for these objects when passing a remote SLA.

Expected Behavior:

If we pass primaryclusterid to these cmdlets they should honour it, and work for remote SLAs.

Steps to Reproduce:

Store a remote SLA domain as $sla_data, run following:

$all_mvs = Get-RubrikManagedVolume -SLA $sla_data.name -PrimaryClusterId $sla_data.primaryclusterid

You will see something like this:

PS C:\Users\mrtim> $all_filesets = Get-RubrikFileset -SLA $sla_data.name -PrimaryClusterId $sla_data.primaryclusterid -Verbose
VERBOSE: Validate the Rubrik token exists
VERBOSE: Found a Rubrik token for authentication
VERBOSE: Gather API Data for Get-RubrikFileset
VERBOSE: Selected 1.0 API Data for Get-RubrikFileset
VERBOSE: Load API data for /api/v1/fileset
VERBOSE: Description: Retrieve summary information for each fileset. Optionally, filter the retrieved information.
VERBOSE: Primary cluster ID currently set to:
VERBOSE: Null value found. Setting primary cluster ID to local
VERBOSE: Determining the SLA Domain id
VERBOSE: Validate the Rubrik token exists
VERBOSE: Found a Rubrik token for authentication
VERBOSE: Gather API Data for Get-RubrikSLA
VERBOSE: Selected 5.0 API Data for Get-RubrikSLA
VERBOSE: Load API data for Get-RubrikSLA
VERBOSE: Description: Retrieve summary information for all SLA Domains
VERBOSE: Build the URI
VERBOSE: URI = https://172.200.300.400/api/v2/sla_domain
VERBOSE: Build the query parameters for primary_cluster_id
VERBOSE: URI = https://172.200.300.400/api/v2/sla_domain?primary_cluster_id=local
VERBOSE: Submitting the request
VERBOSE: GET https://172.200.300.400/api/v2/sla_domain?primary_cluster_id=local with 0-byte payload
VERBOSE: received 22835-byte response of content type application/json; charset=UTF-8
VERBOSE: Received HTTP Status 200
VERBOSE: Formatting return value
VERBOSE: Filter the results
VERBOSE: Filter match = Name
No SLA Domains were found that match TH-CascadingArchiveTest for local
At C:\Users\mrtim\Documents\WindowsPowerShell\Modules\Rubrik\5.0.1\Private\Test-RubrikSLA.ps1:36 char:7
+       throw "No SLA Domains were found that match $SLA for $PrimaryCl ...
+       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : OperationStopped: (No SLA Domains ...eTest for local:String) [], RuntimeException
    + FullyQualifiedErrorId : No SLA Domains were found that match TH-CascadingArchiveTest for local

PS C:\Users\mrtim>

Context:

Please provide any relevant information about your setup. This is important in case the issue is not reproducible except for under certain conditions.

  • Rubrik PowerShell Module Version: 5.0.1
  • PowerShell Version: 5.1
  • Operating System: Microsoft Windows 10

Failure Logs

Please include any relevant log snippets or files here, IMPORTANT all information will be visible publicly on GitHub. Do not include computer or user names, passwords, API tokens or any identifiable information when submitting failure logs.

@JanosPesti
Copy link

please add Get-RubrikVolumeGroup to this issue as well. thanks

@railroadmanuk
Copy link
Contributor Author

please add Get-RubrikVolumeGroup to this issue as well. thanks

Added to main description @JanosPesti, thanks for clarifying!

jaapbrasser added a commit that referenced this issue Sep 7, 2020
@jaapbrasser
Copy link
Contributor

Thanks for reporting this @railroadmanuk & @JanosPesti,

I have updated the cmdlet and also implemented overrides that might cause additional bugs through the use of $PSDefaultParameterValues. The changes will be merged into the next release of the module!

💯

@jaapbrasser jaapbrasser self-assigned this Sep 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants