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

Set-RubrikSLA Incorrectly modifies archive settings even when no archival changes are requested. #775

Open
marcus9467 opened this issue Jul 14, 2021 · 1 comment
Labels

Comments

@marcus9467
Copy link

Current Behavior:

Set-RubrikSLA incorrectly updates the archivalSpecs, during a PATCH call even when no archive related aspects are being updated. This can cause the archive tiering policy to be lost upon update.

Pre-PATCH call:
(Get-RubrikSLA -id "318a5b63-6c26-4846-86d0-8cb5d3490a90").archivalSpecs
locationId             : c518ee19-6a09-495b-9684-d9d32ed9683b
locationName           : Azure:cas
archivalThreshold      : 49680000
archivalTieringSpec    : @{isInstantTieringEnabled=True}
isPassthroughSupported : True

PATCH call:
$options = @{
    DailyRetentionType      =   "Weekly"
    MonthlyRetentionType    =   "Monthly"
    AdvancedConfig          =   $true
}
Get-RubrikSLA -id "318a5b63-6c26-4846-86d0-8cb5d3490a90" | Set-RubrikSLA @options -Verbose
VERBOSE: Validate the Rubrik token exists
VERBOSE: Found a Rubrik token for authentication
VERBOSE: Gather API Data for Set-RubrikSLA
VERBOSE: Selected 5.0 API Data for Set-RubrikSLA
VERBOSE: Load API data for Set-RubrikSLA
VERBOSE: Description: Update an existing SLA Domain on a Rubrik cluster by specifying Domain Rules and policies
VERBOSE: Build the URI                                                                                                                                                  VERBOSE: URI = https://rtplab.rubrik.com/api/v2/sla_domain/318a5b63-6c26-4846-86d0-8cb5d3490a90                                                                        VERBOSE: Build the query parameters for <null>                                                                                                                          VERBOSE: URI = https://rtplab.rubrik.com/api/v2/sla_domain/318a5b63-6c26-4846-86d0-8cb5d3490a90
VERBOSE: Build the body
VERBOSE: Setting ParamValidation flag to $false to check if user set any params
VERBOSE: Checking for the $ParamValidation flag
VERBOSE: Header = {"Authorization":","User-Agent":"RubrikPowerShellSDK-5.3.0--7.1.3--platform--Unix--platform_version--Darwin 19.6.0 Darwin Kernel Version 19.6.0. Thu May  6 00.48.39 "}
VERBOSE: Body = {
  "firstFullAllowedBackupWindows": [],
  "showAdvancedUi": true,
  "frequencies": {
    "daily": {
      "frequency": 1,
      "retention": 4
    },
    "yearly": {
      "yearStartMonth": "January",
      "dayOfYear": "LastDay",
      "retention": 10,
      "frequency": 1
    },
    "monthly": {
      "retention": 7,
      "dayOfMonth": "LastDay",
      "frequency": 1
    }
  },
  "allowedBackupWindows": [],
  "replicationSpecs": [],
  "name": "AdvancedRetentionTest",
  "localRetentionLimit": 49680000,
  "advancedUiConfig": [
    {
      "retentionType": "Weekly",
      "timeUnit": "Daily"
    },
    {
      "retentionType": "Monthly",
      "timeUnit": "Monthly"
    },
    {
      "retentionType": "Yearly",
      "timeUnit": "Yearly"
    }
  ],
  "archivalSpecs": [
    {
      "locationId": "c518ee19-6a09-495b-9684-d9d32ed9683b",
      "archivalThreshold": 49680000
    }
  ]
}
VERBOSE: Submitting the request
VERBOSE: Invoking request with a custom timeout of 1500 seconds
VERBOSE: PATCH https://rtplab.rubrik.com/api/v2/sla_domain/318a5b63-6c26-4846-86d0-8cb5d3490a90 with 893-byte payload
VERBOSE: received 913-byte response of content type application/json
VERBOSE: Received HTTP Status 200                                                                                                                                      VERBOSE: Formatting return value                                                                                                                                       VERBOSE: Filter the results                                                                                                                                             VERBOSE: Getting SLA Domain frequency summary
VERBOSE: Advanced config found, using this
VERBOSE: Applying Rubrik.SLADomain TypeName to results

Post-PATCH Call:
(Get-RubrikSLA -id "318a5b63-6c26-4846-86d0-8cb5d3490a90").archivalSpecs

locationId             : c518ee19-6a09-495b-9684-d9d32ed9683b
locationName           : Azure:cas
archivalThreshold      : 49680000
isPassthroughSupported : True

Expected Behavior:
We should only modify the options supplied as part of the PATCH request. It looks like we have a few default things that are built into the PATCH call that get called regardless.

Steps to Reproduce:

Please provide detailed steps for reproducing the issue.

  1. Create an SLA with an archive and instant tiering policy in place
  2. Attempt to modify the SLA using Set-RubrikSLA, but do not make any changes to the archive in the PATCH call
  3. Review the archivalSpecs after the PATCH call.

Context:
This is a relatively important thing to fix in the near term as at best it breaks all UPLOAD jobs for objects assigned to this SLA because the incremental upload is looking for references that currently only exist in the archive tier. At best it will result in a new chain being started in the access tier (often a good deal more expensive than the expected pricing for the archive tier)

  • Rubrik PowerShell Module Version: 5.3.0
  • PowerShell Version: 7.1.3
  • Operating System: Darwin 19.6.0 Darwin Kernel Version 19.6.0: Thu May 6 00:48:39 PDT 2021; root:xnu-6153.141.33~1/RELEASE_X86_64 (MacOS)

Failure Logs

N/A

@marcus9467
Copy link
Author

It may also be worth noting that this cmdlet uses API v2 PATCH /sla_domain, and as of 5.2.X this API is deprecated in favor of using v3.

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

No branches or pull requests

1 participant