Automating Rubrik with vRO Part 2: Setup Rubrik REST Host

In this 2nd post of the series on automation Rubrik with vRO, I’m going to walk you through setting up your REST Host and REST Operations in vRealize Orchestrator. This step is required for all subsequent workflows to work.

Step 1: Add your Rubrik REST Host

First of all make sure you have the vRealize Orchestrator REST plugin installed. The REST plugin should have been configured automatically when you installed vRealize Orchestrator.

This workflow which comes with vRealize Orchestrator to add your Rubrik Appliance. If like most users, you have more than one Rubrik appliance, go ahead and repeat this process to add all of them.

  • Go to the Library of vRO Workflows
  • Expand Library > HTTP-REST > Configuration
  • Run “Add a REST Host”
  • Fill in the name, for example “Rubrik Chicago 1”. This will help you identify which Rubrik Appliance you are making REST calls to in the future so it helps to think about it now.
  • Fill in the URL. This is in the following format “https://yourrubrikdnsnamehere:443″
  • Connection Timeout – leave this as 30 seconds unless you have a specific reason to change it.
  • Operation timeout – leave this as 60 seconds unless you have a specific reason to change it.
  • Select yes for accepting the certificate silently.

  • Click Next and configure any proxy settings if required.
  • For Authentication Type select “None”

auth

We use none because we will be creating our own authentication token as part of the REST action elements.

  • Select No for SSL unless you need to verify X.509 certificate.

Step 2: Add REST Operations

Now that you have your REST Host added, you need to add the REST Operations we are going to use in the subsequent workflows.

1. REST Operation: Request – Token from Rubrik

  • Go to Library > HTTP-REST > Configuration > Run “Add a Rest Operation”
  • Parent Host: Select the Rubrik REST Host we configured in Step 1
  • Name: Give the Operation a Name. In our case we used “Request-Token from Rubrik”
  • Template URL: type in “/login
  • HTTP Method: Select POST
  • Click Submit when done.

Here is a screenshot of what your configuration should look like.

restlogin

2. REST Operation: Get Rubrik VM

  • Run the “Add a REST Operation” workflow again.
  • Parent Host: Select the Rubrik REST Host we configured in Step 1
  • Name: Give the Operation a Name. In our case we used “GetRubrikVM”
  • Template URL: type in “/vm
  • HTTP Method: Select GET
  • Click Submit when done.

getVM

Now we need to update the GetVM workflow we imported to utilize the REST Operation.

  • Go over to the Rubrik workflows you imported from FlowGrab and Edit the Rubrik_GetVMID workflow.

Screen Shot 2015-08-27 at 9.34.52 AM

  • Go to the General Tab and Update the REST Operation to be the one we just added.

getvmupdate

3. REST Operation: Assign VM to SLA

  • Run the “Add a REST Operation” workflow again.
  • Parent Host: Select the Rubrik REST Host we configured in Step 1
  • Name: Give the Operation a Name. In our case we used “Assign VM to SLA”
  • Template URL: type in “/vm/{id}
  • HTTP Method: Select PATCH
  • Click Submit when done.

assignvmtosla

As before, we need to update the corresponding workflow.

  • Go over to the Rubrik workflows you imported from FlowGrab and Edit the “Rubrik_AssignVMtoSLADomain” workflow.

Screen Shot 2015-08-27 at 9.40.13 AM

  • Go to the General Tab and Update the REST Operation to be the one we just added.

Screen Shot 2015-08-27 at 9.39.53 AM

4. REST Operation: Assign VM to SLA

  • Run the “Add a REST Operation” workflow again.
  • Parent Host: Select the Rubrik REST Host we configured in Step 1
  • Name: Give the Operation a Name. In our case we used “GetSLADomain”
  • Template URL: type in “/slaDomain
  • HTTP Method: Select GET
  • Click Submit when done.

GetSLADomain

As before, we need to update the corresponding workflow.

  • Go over to the Rubrik workflows you imported from FlowGrab and Edit the “Rubrik_AuthenticateAndGetSLADomainIDs” workflow.

Screen Shot 2015-08-27 at 9.41.37 AM

  • Go to the General Tab and Update the REST Operation to be the one we just added.

Screen Shot 2015-08-27 at 9.41.42 AM

Summary:

That’s it, the REST Host and Operations are all configured. We will try to work on a workflow to automate creating these in the future, but for now you are all set for part 3, where we will start utilizing each workflow.

Don’t forget to check out www.theithollow.com by Eric Shanks for details on how we created all of the workflows and actions.

Automating Rubrik with vRealize Orchestrator Part 1: Introduction

Rubrik_Lab2

After seeing Rubrik be unveiled at VFD5 this year, a lot of us were very excited to get our hands on the gear. We were impressed by the simplicity and easy access to REST APIs which meant this was another product which deserves some VMware vRO Workflow attention.

Working with my colleague Eric Shanks, along with Chris Wahl at Rubrik, we decided to build a vRO workflow package to automate some of the key tasks. Thankfully our Backup specialist John Affatati already had an appliance racked in the Ahead lab and we were able to get up and running quickly!

Eric and I split the work up, and as such this is a co-blogger series. For information on where to get the workflows and how to get them up and running, you will find those posts here on Systems Game. For a deeper dive into how the REST calls were created, Eric is posting those on his blog at www.theithollow.com.

So let’s begin!

For starters. Make sure you go over to FlowGrab and download our vRO workflow package we published. This contains all of the workflows/actions/configuration elements which will be discussed in the series. All of the code is provided Open Source and is freely available for you to modify.

The series, and workflows are broken down into the following posts:

  1. Introduction – This post
  2. vRO REST Configuration for Rubrik
  3. vRO Workflow: Authenticate with Rubrik
  4. vRO Workflow: Get Rubrik VM information
  5. vRO Workflow: Get Rubrik SLA Domain IDs
  6. vRO Workflow: Assign SLA Domain to Virtual Machine

Following the conclusion of Part 6, I will then show how you can integrate this into vRealize Automation (or any Cloud catalog), so that you can give your users a backup choice when they are requesting new virtual machines.

rubrikvra

Enjoy, and as always please provide Eric and I as much feedback as possible.