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-RubrikSQLInstance not returning effective SLA Domain #760

Closed
whocking opened this issue May 18, 2021 · 0 comments · Fixed by #800
Closed

Get-RubrikSQLInstance not returning effective SLA Domain #760

whocking opened this issue May 18, 2021 · 0 comments · Fixed by #800
Assignees
Labels

Comments

@whocking
Copy link

Current Behavior:

When fetching MSSQL Instances that have been Unprotected and existing Snapshot assigned to a Retention SLA Domain, Get-RubrikSQLInstance is only showing the Retention Domain configuredSlaDomainName and not informing users that the Object is actually Unprotected effectiveSlaDomainName.

VERBOSE: Validate the Rubrik token exists
VERBOSE: Found a Rubrik token for authentication
VERBOSE: Gather API Data for Get-RubrikSQLInstance
VERBOSE: Selected 1.0 API Data for Get-RubrikSQLInstance
VERBOSE: Load API data for Get-RubrikSQLInstance
VERBOSE: Description: Returns a list of summary information for Microsoft SQL instances.
VERBOSE: Build the URI
VERBOSE: URI = https://10.38.74.9/api/v1/mssql/instance
VERBOSE: Build the query parameters for instance_id,primary_cluster_id
VERBOSE: URI = https://10.38.74.9/api/v1/mssql/instance
VERBOSE: Submitting the request
VERBOSE: Invoking request with a custom timeout of 100 seconds
VERBOSE: GET https://10.38.74.9/api/v1/mssql/instance with 0-byte payload
VERBOSE: received 1302-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 = Hostname
VERBOSE: Filter match = SLA
VERBOSE: Applying Rubrik.MSSQLInstance TypeName to results

VERBOSE: Validate the Rubrik token exists
VERBOSE: Found a Rubrik token for authentication
VERBOSE: Build the URI
VERBOSE: URI = https://10.38.74.9/api/v1/mssql/instance
VERBOSE: URI string: https://10.38.74.9/api/v1/mssql/instance
VERBOSE: Body string: 
VERBOSE: Performing the operation "Invoke WebRequest" on target "https://10.38.74.9/api/v1/mssql/instance".
VERBOSE: Submitting the request
VERBOSE: Invoking request with a custom timeout of 100 seconds
VERBOSE: GET https://10.38.74.9/api/v1/mssql/instance with 0-byte payload
VERBOSE: received 1302-byte response of content type application/json
VERBOSE: Received HTTP Status 200
VERBOSE: Validate the Rubrik token exists
VERBOSE: Found a Rubrik token for authentication
VERBOSE: Build the URI
VERBOSE: URI = https://10.38.74.9/api/v1/mssql/hierarchy/Host%3A%3A%3A4e5b29c4-f9c9-4616-b452-6775b7863b32/children?has_instances=true&is_clustered=false&is_live_mount=false&limit=51&offset=0&primary_cluster_id=local&snappable_status=Protectable&sort_by=name&sort_order=asc
VERBOSE: URI string: https://10.38.74.9/api/v1/mssql/hierarchy/Host%3A%3A%3A4e5b29c4-f9c9-4616-b452-6775b7863b32/children?has_instances=true&is_clustered=false&is_live_mount=false&limit=51&offset=0&primary_cluster_id=local&snappable_status=Protectable&sort_by=name&sort_order=asc
VERBOSE: Body string: 
VERBOSE: Performing the operation "Invoke WebRequest" on target "https://10.38.74.9/api/v1/mssql/hierarchy/Host%3A%3A%3A4e5b29c4-f9c9-4616-b452-6775b7863b32/children?has_instances=true&is_clustered=false&is_live_mount=false&limit=51&offset=0&primary_cluster_id=local&snappable_status=Protec
table&sort_by=name&sort_order=asc".
VERBOSE: Submitting the request
VERBOSE: Invoking request with a custom timeout of 100 seconds
VERBOSE: GET https://10.38.74.9/api/v1/mssql/hierarchy/Host:::4e5b29c4-f9c9-4616-b452-6775b7863b32/children?has_instances=true&is_clustered=false&is_live_mount=false&limit=51&offset=0&primary_cluster_id=local&snappable_status=Protectable&sort_by=name&sort_order=asc with 0-byte payload
VERBOSE: received 1039-byte response of content type application/json
VERBOSE: Received HTTP Status 200
VERBOSE: Validate the Rubrik token exists
VERBOSE: Found a Rubrik token for authentication
VERBOSE: Build the URI
VERBOSE: URI = https://10.38.74.9/api/v1/mssql/hierarchy/Host%3A%3A%3A2913f3df-906e-4ac4-a7ca-fa52f72bd6cc/children?has_instances=true&is_clustered=false&is_live_mount=false&limit=51&offset=0&primary_cluster_id=local&snappable_status=Protectable&sort_by=name&sort_order=asc
VERBOSE: URI string: https://10.38.74.9/api/v1/mssql/hierarchy/Host%3A%3A%3A2913f3df-906e-4ac4-a7ca-fa52f72bd6cc/children?has_instances=true&is_clustered=false&is_live_mount=false&limit=51&offset=0&primary_cluster_id=local&snappable_status=Protectable&sort_by=name&sort_order=asc
VERBOSE: Body string: 
VERBOSE: Performing the operation "Invoke WebRequest" on target "https://10.38.74.9/api/v1/mssql/hierarchy/Host%3A%3A%3A2913f3df-906e-4ac4-a7ca-fa52f72bd6cc/children?has_instances=true&is_clustered=false&is_live_mount=false&limit=51&offset=0&primary_cluster_id=local&snappable_status=Protec
table&sort_by=name&sort_order=asc".
VERBOSE: Submitting the request
VERBOSE: Invoking request with a custom timeout of 100 seconds
VERBOSE: GET https://10.38.74.9/api/v1/mssql/hierarchy/Host:::2913f3df-906e-4ac4-a7ca-fa52f72bd6cc/children?has_instances=true&is_clustered=false&is_live_mount=false&limit=51&offset=0&primary_cluster_id=local&snappable_status=Protectable&sort_by=name&sort_order=asc with 0-byte payload
VERBOSE: received 1039-byte response of content type application/json
VERBOSE: Received HTTP Status 200

PS to get MSSQL Instances (Mismatch with WebUI, which shows No SLA)

This looks to be because the filter is only grabbing configuredSlaDomainName which is the name of the Retention SLA Domain.

Get-RubrikSQLInstance
Name        Version     Parent Hostname SLA Domain ID                                                  
----        -------     --------------- ---------- --                                                  
MSSQLSERVER 13.0.4001.0 william-sqlag-1 Silver     MssqlInstance:::119d361d-ed52-4bc8-adc4-ac5c84eeca17
MSSQLSERVER 13.0.4001.0 william-sqlag-2 Silver     MssqlInstance:::80c15551-dba1-4835-9b14-92c805932275

Raw REST call to get MSSQL Instances

We can see that configuredSlaDomainName matches up to the output above, but the important bit here is that the configuredSlaDomainType is RetentionSla

$ApiData = Invoke-RubrikRESTCall -Endpoint 'mssql/instance' -Method GET
Write-Output $ApiData.data | Select-Object id,name,configuredSlaDomainName,configuredSlaDomainType

id                      : MssqlInstance:::119d361d-ed52-4bc8-adc4-ac5c84eeca17
name                    : MSSQLSERVER
configuredSlaDomainName : Silver
configuredSlaDomainType : RetentionSla


id                      : MssqlInstance:::80c15551-dba1-4835-9b14-92c805932275
name                    : MSSQLSERVER
configuredSlaDomainName : Silver
configuredSlaDomainType : RetentionSla

Raw REST calls to get child MSSQL Instances of the Hosts. Please keep in mind the below calls contain unique Host IDs for my Hosts in the Lab

We can see that effectiveSlaDomainId != configuredSlaDomainId
The effectiveSlaDomainId value is the SLA Domain that is shown in the WebUI.

$ApiData = Invoke-RubrikRESTCall -Endpoint 'mssql/hierarchy/Host%3A%3A%3A4e5b29c4-f9c9-4616-b452-6775b7863b32/children?has_instances=true&is_clustered=false&is_live_mount=false&limit=51&offset=0&primary_cluster_id=local&snappable_status=Protectable&sort_by=name&sort_order=asc' -Method GET
Write-Output $ApiData.data | Select-Object id,name,configuredSlaDomainName,effectiveSlaDomainName

id                      : MssqlInstance:::119d361d-ed52-4bc8-adc4-ac5c84eeca17
name                    : MSSQLSERVER
configuredSlaDomainName : Silver
effectiveSlaDomainName  : Unprotected
$ApiData = Invoke-RubrikRESTCall -Endpoint 'mssql/hierarchy/Host%3A%3A%3A2913f3df-906e-4ac4-a7ca-fa52f72bd6cc/children?has_instances=true&is_clustered=false&is_live_mount=false&limit=51&offset=0&primary_cluster_id=local&snappable_status=Protectable&sort_by=name&sort_order=asc' -Method GET
Write-Output $ApiData.data | Select-Object id,name,configuredSlaDomainName,effectiveSlaDomainName

id                      : MssqlInstance:::80c15551-dba1-4835-9b14-92c805932275
name                    : MSSQLSERVER
configuredSlaDomainName : Silver
effectiveSlaDomainName  : Unprotected

Expected Behavior:
Get-RubrikSQLInstance should return the SLA Domain Type and possibly prefer effectiveSlaDomainName over configuredSlaDomainName since this would reflect the current Protection state more accurately.

Steps to Reproduce:

Please provide detailed steps for reproducing the issue.

  1. Apply Protection SLA Domain at Host/Instance level, ensuring child Objects are inheriting.
  2. Apply 'Do Not Protectat Host/Instance level, selectingExisting Snapshot RetentionoptionPreserve retention from previous SLA`.
  3. In the CDM WebUI, the parent and child Objects will show as Unprotected. Use the steps above to show the discrepancy.

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.3.0
  • PowerShell Version: 5.1.14393.3866
  • Operating System: Windows Server 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
2 participants