3 Replies Latest reply: Dec 16, 2016 9:31 AM by Vanessa Romero RSS

    Nimble API - Protection schedule - unable to create an external_trigger protection schedule

    Vanessa Romero Newbie
    Visibility: Open to anyone

      I am trying to create a protection schedule for volume collections using the Nimble storage APIs. I can create tokens, and using the example in the documentation I can create a test schedule. However, when I try to use "external_trigger" for "schedule_type" I get the following error message:

      {'messages': [{'text': 'The request could not be understood by the server.', 'code': 'SM_http_bad_request'}, {'text': 'Invalid attributes specified for externally triggered schedule.', 'code': 'SM_ext_trig_sched_attrib'}]}

       

      Does anyone have a sample json data payload for implementing a protection schedule with "external trigger" selected?

       

      Thank you!

        • Re: Nimble API - Protection schedule - unable to create an external_trigger protection schedule
          Adaikkappan Arumugam Wayfarer

          Hi Vanessa,

                    Below is an example of a protection schedule with external_trigger.

          1. {"data":{"schedule_type":"external_trigger","downstream_partner_id":"","name":"ondemand","description":"","volcoll_or_prottmpl_type":"volume_collection","volcoll_or_prottmpl_id":"07286a1c46ce65d11b00000000000000000000002c","num_retain":0,"replicate_every":0,"num_retain_replica":0,"repl_alert_thres":86400,"snap_verify":false,"skip_db_consistency_check":false,"disable_appsync":true}}

          2. BTW, may understand, why  you would like to create an external_trigger schedule ?
          3. Currently this is only used for nimble integration with commvault simpana, where the primary snapshot schedule is managed by commvault and retention on the replica/downstream needs to be managed by nimble array.

          4. Regards
          5. Adai
            • Re: Nimble API - Protection schedule - unable to create an external_trigger protection schedule
              Vanessa Romero Newbie

              Hello!

               

              I am including below my test script. I am still getting the same error message.

              And yes, we are setting up Commvault integration.

               

               

              #!/usr/bin/python3

               

              import requests

              import json

              import logging

              import sys

               

              logging.basicConfig(format='%(asctime)s -- %(message)s', datefmt='%m/%d/%Y %I:%M:%S %p', level=logging.DEBUG)

               

               

              class nimbleCommvaultSetup(object):

                  def __init__(self, hostname = 'hostname', username = 'userid_name', password = 'badpwd', port = 5392, version = 'v1'):

                    

              1. INIT VARIABLES / SET DEFAULTS

                      self.hostname = hostname

                      self.port = port

                      self.version = version

                      self.username = username

                      self.password = password

               

                      logging.debug('setting up connection to: %s, with username: %s', self.hostname, self.username)

               

               

                    

                1. Connect to Nimble

                      self.tokenurl="https://%s:5392/v1/tokens" % self.hostname

                      self.payload={'data':{ 'username': self.username,  'password': self.password}}

               

                      logging.debug('>>> ' + str(self.payload))

                      logging.debug(json.dumps(self.payload))

               

                    

                1. Get a Token

                      r = requests.post(self.tokenurl, json.dumps(self.payload),  verify=False)

                      self.session = r.json()['data']['session_token']

               

               

                      if r.status_code != 201:

                          logging.debug('connection failed, Error: %s', self.r.json())

                      else:

                          logging.debug('connection successful, session_token: %s', self.session)

               

               

                  

                1. The following POST also worked

              1.       self.accesscontrourl="https://%s:5392/v1/access_control_records" % self.hostname

              2.       self.payload={'data': {'initiator_group_id': '020c9d48015908dfdb00000000000000000000001d',

              3.       'vol_id': '064b39d478d1c595a400000000000000000000005b'}}

               

               

               

                      self.scheduleurl="https://%s:5392/v1/protection_schedules" % self.hostname

                      self.payload={"data":{"schedule_type":"external_trigger",

              "downstream_partner_id":"",

              "name":"Commvault",

              "description":"",

              "volcoll_or_prottmpl_type":"volume_collection",

              "volcoll_or_prottmpl_id":"070c9d48015908dfdb000000000000000000000076",

              "num_retain":0,

              "replicate_every":0,

              "num_retain_replica":0,

              "repl_alert_thres":86400,

              "snap_verify":False,

              "skip_db_consistency_check":False,

              "disable_appsync":True}}

               

               

                      logging.debug('>>> ' + json.dumps(self.payload))

               

                      

                1. Try test

                      try:

                          r = requests.post(self.scheduleurl, json.dumps(self.payload), headers = {'X-Auth-Token': self.session},  verify=False)

                      except: # catch all exceptions

                          e = sys.exc_info()[0]

                          logging.debug( "

              Error: %s

              " % e )

               

               

              1.       self.out = r.json()['data']['vol_name']

                      self.out = r.json()

               

               

                      if r.status_code != 201:

                          logging.debug('Try it - failed, Error: %s', self.out)

                      else:

                          logging.debug('Try it - successful, out: %s', self.out)

               

                      logging.debug('End of SCRIPT')

               

               

                1. Shouldn't get here - as this should just be a module

              def main():

                  print ("This is the main() def")

               

                  nimbleCommvaultSetup( hostname = ‘yourhostname’, username=’Admin_user’,password='YOUR PASSWORD')

               

                  1. Start Here ###

              if __name__ == "__main__":

                  main()

            • Re: Nimble API - Protection schedule - unable to create an external_trigger protection schedule
              Vanessa Romero Newbie

              Here is an update from the Nimble support team:

               

              "I have tested this against our latest release (3.6) and confirmed that this problem exists there as well.

               

              I have also confirmed that a fix was planned and added to our current build for Nimble OS 4.X versions. The bug number for this fix is AS-63936.

               

              Unfortunately, the only workarounds available would be to create the desired schedule using the GUI or CLI through SSH."