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

Unprotect the VM and update retention for existing SLA is not working #689

Closed
suren-rubr opened this issue Sep 10, 2020 · 5 comments · Fixed by #714
Closed

Unprotect the VM and update retention for existing SLA is not working #689

suren-rubr opened this issue Sep 10, 2020 · 5 comments · Fixed by #714

Comments

@suren-rubr
Copy link

Current Behavior:

Provide information about the failure by issuing the command using the -Verbose command. Ensure that any identifiable information (server names, tokens, passwords) is removed from your logs before sharing this on GitHub.

Paste the verbose output from the command here

Protect-RubrikVM -id VirtualMachine:::dc91d5d5-c1d1-4ea7-8eb7-f5ee60e805c3-vm-218331 -DoNotProtect -ExistingSnapshotRetention RetainSnapshots -verbose
VERBOSE: Validate the Rubrik token exists
VERBOSE: Found a Rubrik token for authentication
VERBOSE: Gather API Data for Protect-RubrikVM
VERBOSE: Selected 1.0 API Data for Protect-RubrikVM
VERBOSE: Load API data for Protect-RubrikVM
VERBOSE: Description: Update a VM with the specified SLA Domain.
VERBOSE: Build the URI
VERBOSE: URI = https://<cluster_ip>/api/v1/vmware/vm/VirtualMachine:::dc91d5d5-c1d1-4ea7-8eb7-f5ee60e805c3-vm-218331
VERBOSE: Build the query parameters for
VERBOSE: URI = https://<cluster_IP>/api/v1/vmware/vm/VirtualMachine:::dc91d5d5-c1d1-4ea7-8eb7-f5ee60e805c3-vm-218331
VERBOSE: List of set parameters: [id, VirtualMachine:::dc91d5d5-c1d1-4ea7-8eb7-f5ee60e805c3-vm-218331] [DoNotProtect, True] [ExistingSnapshotRetention, RetainSnapshots] [Verbose, True] [SLAID, UNPROTECTED]
VERBOSE: Build the body parameters
VERBOSE: Adding configuredSlaDomainId...
VERBOSE: Adding existingSnapshotRetention...
VERBOSE: Body = {
"configuredSlaDomainId": "UNPROTECTED",
"existingSnapshotRetention": "RetainSnapshots"
}
VERBOSE: Submitting the request
VERBOSE: Invoking request with a custom timeout of 100 seconds
VERBOSE: PATCH https://<cluster_IP>/api/v1/vmware/vm/VirtualMachine:::dc91d5d5-c1d1-4ea7-8eb7-f5ee60e805c3-vm-218331 with 94-byte payload
VERBOSE: received 4648-byte response of content type application/json
VERBOSE: Received HTTP Status 200 VERBOSE: Formatting return value VERBOSE: Applying Rubrik.VMwareVM TypeName to results
Name Operating System SLA Domain RBS Status Id


AdilUbuntu1 Ubuntu Linux (64-bit) Unprotected Unregistered VirtualMachine:::dc91d5d5-c1d1-4ea7-8eb7-f5ee60e805c3-vm-218331

Expected Behavior: To update the retention SLA as Existing SLA while unprotecting the VM.

Steps to Reproduce:

Please provide detailed steps for reproducing the issue.

  1. Step 1 : Take a VM Which is protected by SLA and note the VM ID
  2. Step 2: Use the command to unprotect the VM : Protect-RubrikVM -id <VM_ID> -DoNotProtect -ExistingSnapshotRetention RetainSnapshots -verbose

Issue: Seems like its broken on both 5.1 and 5.2. I used API code capture and we seem to be calling a different endpoint when unprotecting the VM. The endpoint we hit is POST /v2/sla_domain/UNPROTECTED/assign.
Also, /v1/vmware/vm/{id} does not have

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: Use Get-Module -ListAvailable Rubrik

ModuleType Version Name PSEdition ExportedCommands


Script 5.0.3 Rubrik Desk {Connect-Rubrik, Disconnect-Rubrik, Export-RubrikDatabase, Export-RubrikReport…}

  • PowerShell Version: Use $PSVersiontable.PSVersion

$PSVersiontable.PSVersion

Major Minor Patch PreReleaseLabel BuildLabel


6 2 3

  • Operating System: Use $PSVersiontable.PSVersion on PowerShell 6 and later, use (Get-WMIObject win32_operatingsystem).Name for Windows PowerShell

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.

@jaapbrasser jaapbrasser self-assigned this Sep 11, 2020
@jaapbrasser
Copy link
Contributor

Thanks for reporting this @suren-rubr, I'll take a look at how we can improve this behavior in the module. I have tested this in our environment and confirmed that this is indeed a bug.

I'll update you here once I have some code ready.

@jaapbrasser
Copy link
Contributor

Hi @suren-rubr,

I've posted the initial code to resolve this issue in the following PR #690

Let me know if this helps resolve your issue

@suren-rubr
Copy link
Author

suren-rubr commented Sep 19, 2020

Hi @jaapbrasser ,

Thanks for looking into this;

I tried the changes but still the retention is set forever rather than previous SLA;


Protect-RubrikVM -id VirtualMachine:::dc91d5d5-c1d1-4ea7-8eb7-f5ee60e805c3-vm-219769 -DoNotProtect -ExistingSnapshotRetention RetainSnapshots -verbose
VERBOSE: Validate the Rubrik token exists
VERBOSE: Found a Rubrik token for authentication
VERBOSE: Gather API Data for Protect-RubrikVM
VERBOSE: Selected 5.2 API Data for Protect-RubrikVM
VERBOSE: Load API data for Protect-RubrikVM
VERBOSE: Description: Update a VM with the specified SLA Domain.
VERBOSE: Build the URI
VERBOSE: URI = https://<cluster_ip>/api/v2/sla_domain/VirtualMachine:::dc91d5d5-c1d1-4ea7-8eb7-f5ee60e805c3-vm-219769/assign
VERBOSE: Build the query parameters for <null>
VERBOSE: URI = https://<cluster_IP>/api/v2/sla_domain/VirtualMachine:::dc91d5d5-c1d1-4ea7-8eb7-f5ee60e805c3-vm-219769/assign
VERBOSE: List of set parameters: [id, VirtualMachine:::dc91d5d5-c1d1-4ea7-8eb7-f5ee60e805c3-vm-219769] [DoNotProtect, True] [ExistingSnapshotRetention, RetainSnapshots] [Verbose, True] [SLAID, UNPROTECTED]
VERBOSE: Build the body parameters
VERBOSE: Adding managedIds...
VERBOSE: Adding existingSnapshotRetention...
VERBOSE: Adding configuredSlaDomainId...
VERBOSE: Body = {
  "existingSnapshotRetention": "RetainSnapshots",
  "configuredSlaDomainId": "UNPROTECTED"
}
VERBOSE: Build the URI
VERBOSE: URI = https://<cluster_IP>/api/v2/sla_domain/UNPROTECTED/assign
VERBOSE: Body = {
  "managedIds": [
    "VirtualMachine:::dc91d5d5-c1d1-4ea7-8eb7-f5ee60e805c3-vm-219769"
  ]
}
VERBOSE: Submitting the request
VERBOSE: Invoking request with a custom timeout of 100 seconds
VERBOSE: POST https://<Cluster_IP>/api/v2/sla_domain/UNPROTECTED/assign with 95-byte payload
VERBOSE: received 194-byte response of content type application/json
VERBOSE: Received HTTP Status 200                                                                                                                                                               VERBOSE: Formatting return value                                                                                                                                                                                                                                                                                                                                                                objectId                                                        pendingSlaDomainId pendingSlaDomainName isPendingSlaDomainRetentionLocked                                                       
--------                                                        ------------------ -------------------- ---------------------------------
VirtualMachine:::dc91d5d5-c1d1-4ea7-8eb7-f5ee60e805c3-vm-219769 UNPROTECTED        Unprotected                                      False


@suren-rubr
Copy link
Author

Screenshot 2020-09-19 at 4 28 42 PM

Screenshot 2020-09-19 at 4 29 41 PM

@jaapbrasser
Copy link
Contributor

Hello @suren-rubr,

I have staged the changes in this PR: #714

Regards,

Jaap Brasser

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