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

Get-RubrikDatabase does not use "-PrimaryClusterID" and defaults to "local" #691

Closed
JanPillarRubrik opened this issue Sep 20, 2020 · 1 comment · Fixed by #714
Closed

Comments

@JanPillarRubrik
Copy link

JanPillarRubrik commented Sep 20, 2020

Current Behavior:

  • When running get-RubrikDatabase cmdlet against a replication target cluster, and specifying a parituclar SLA + primary ID of the source cluster, it uses "-primaryClusterID" = local instead.
PS C:\Users\Jan> Get-RubrikDatabase -SLA 'Silver_with_replication' -PrimaryClusterID 6257d11b-33a0-432f-a02d-ba80742a347a -verbose
VERBOSE: Validate the Rubrik token exists
VERBOSE: Found a Rubrik token for authentication
VERBOSE: Gather API Data for Get-RubrikDatabase
VERBOSE: Selected 1.0 API Data for Get-RubrikDatabase
VERBOSE: Load API data for Get-RubrikDatabase
VERBOSE: Description: Returns a list of summary information for Microsoft SQL databases.
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://192.168.75.180/api/v2/sla_domain
VERBOSE: Build the query parameters for primary_cluster_id
VERBOSE: URI = https://192.168.75.180/api/v2/sla_domain?primary_cluster_id=local <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
VERBOSE: Submitting the request
VERBOSE: Invoking request with a custom timeout of 15 seconds
VERBOSE: GET https://192.168.75.180/api/v2/sla_domain?primary_cluster_id=local with 0-byte payload
VERBOSE: received 19371-byte response of content type application/json
VERBOSE: Received HTTP Status 200
VERBOSE: Formatting return value
VERBOSE: Filter the results
VERBOSE: Filter match = Name
No SLA Domains were found that match Silver_with_replication for local
At C:\Users\Jan\Documents\WindowsPowerShell\Modules\Rubrik\5.0.3\Private\Test-RubrikSLA.ps1:36 char:7
+       throw "No SLA Domains were found that match $SLA for $PrimaryCl ...
+       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : OperationStopped: (No SLA Domains ...ation for local:String) [], RuntimeException
    + FullyQualifiedErrorId : No SLA Domains were found that match Silver_with_replication for local

As a comparison, get-rubrikvm works and uses provided PrimaryClusterID:

PS C:\Users\Jan> Get-RubrikVM -SLA 'Silver_with_replication' -PrimaryClusterID 6257d11b-33a0-432f-a02d-ba80742a347a -verbose
VERBOSE: Validate the Rubrik token exists
VERBOSE: Found a Rubrik token for authentication
VERBOSE: Gather API Data for Get-RubrikVM
VERBOSE: Selected 1.0 API Data for Get-RubrikVM
VERBOSE: Load API data for Get-RubrikVM
VERBOSE: Description: Get summary of all the VMs
VERBOSE: Primary cluster ID currently set to: 6257d11b-33a0-432f-a02d-ba80742a347a
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://192.168.75.180/api/v2/sla_domain
VERBOSE: Build the query parameters for primary_cluster_id
VERBOSE: URI = https://192.168.75.180/api/v2/sla_domain?primary_cluster_id=6257d11b-33a0-432f-a02d-ba80742a347a <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
VERBOSE: Submitting the request
VERBOSE: Invoking request with a custom timeout of 15 seconds
VERBOSE: GET https://192.168.75.180/api/v2/sla_domain?primary_cluster_id=6257d11b-33a0-432f-a02d-ba80742a347a with 0-byte payload
VERBOSE: received 21228-byte response of content type application/json
VERBOSE: Received HTTP Status 200
VERBOSE: Formatting return value
VERBOSE: Filter the results
VERBOSE: Filter match = Name
VERBOSE: Getting SLA Domain frequency summary
VERBOSE: No advanced config found
VERBOSE: Applying Rubrik.SLADomain TypeName to results
VERBOSE: Build the URI
VERBOSE: URI = https://192.168.75.180/api/v1/vmware/vm
VERBOSE: Build the query parameters for sla_assignment,is_relic,name,primary_cluster_id,effective_sla_domain_id
VERBOSE: URI =
https://192.168.75.180/api/v1/vmware/vm?is_relic=False&primary_cluster_id=6257d11b-33a0-432f-a02d-ba80742a347a&effective_sla_domain_id=55402e2f-2223-4b7b-9126-443edc5c0b52
VERBOSE: Submitting the request
VERBOSE: Invoking request with a custom timeout of 15 seconds
VERBOSE: GET
https://192.168.75.180/api/v1/vmware/vm?is_relic=False&primary_cluster_id=6257d11b-33a0-432f-a02d-ba80742a347a&effective_sla_domain_id=55402e2f-2223-4b7b-9126-443edc5c0b52 with 0-byte payload
VERBOSE: received 12882-byte response of content type application/json
VERBOSE: Received HTTP Status 200
VERBOSE: Formatting return value
VERBOSE: Filter the results
VERBOSE: Filter match = Name
VERBOSE: Filter match = SLA
VERBOSE: Applying Rubrik.VMwareVM TypeName to results
Name            Operating System                                SLA Domain                              RBS Status Id
----            ----------------                                ----------                              ---------- --
<results>

Expected Behavior:

It should use the -PrimaryClusterID provided, the same way get-rubrikvm cmdlet does.

Steps to Reproduce:

Connect to a replication target cluster using connect-rubrik.
Run get-rubrikdb -sla '<SLA_NAME>' -PrimaryClusterID <id_of_replication_source_cluster>
Failure happens.
Run get-rubrikvm -sla '<SLA_NAME>' -PrimaryClusterID <id_of_replication_source_cluster>
It succeeds and displays expected output.

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.3
  • PowerShell Version: 5.1.18362.752
  • Operating System: Microsoft Windows 10 Pro

Failure Logs

Comparing get-rubrikdatabase.ps1 and get-rubrikvm.ps1, this is the possible cause:

Process {
    #region One-off
    # If SLA paramter defined, resolve SLAID
    If ($SLA) {
      $SLAID = Test-RubrikSLA -SLA $SLA -Inherit $Inherit -DoNotProtect $DoNotProtect
    }

I guess it should be:

  Process {
    #region One-off
    # If SLA paramter defined, resolve SLAID
    If ($SLA) {
      $SLAID = Test-RubrikSLA -SLA $SLA -Inherit $Inherit -DoNotProtect $DoNotProtect -PrimaryClusterID $PrimaryClusterID
    }
@jaapbrasser
Copy link
Contributor

Hey @JanPillarRubrik,

I've added the functionality to #714, the issue has been resolved there and will be merged shortly!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants