Veritas NetBackup™ DataStore SDK Programmer's Guide for XBSA 1.1.0

Last Published:
Product(s): NetBackup (8.2, 8.1.2)
  1. Introduction to NetBackup XBSA
    1.  
      About Introduction to NetBackup XBSA
    2.  
      What is NetBackup XBSA?
    3.  
      What does NetBackup XBSA do?
    4.  
      Terminology
    5.  
      Important concepts
    6.  
      Resources
  2. How to set up the SDK
    1.  
      System requirements
    2. Installing the SDK
      1.  
        Installation requirements
      2.  
        Installation instructions for UNIX platforms
      3.  
        Installation instructions for Windows platforms
    3.  
      Uninstalling the SDK
    4.  
      Configuration
    5.  
      Description of the XBSA SDK package
    6.  
      Library files
    7.  
      Header files
  3. Using the NetBackup XBSA interface
    1.  
      Getting help with the API
    2. NetBackup XBSA data structures
      1.  
        Object data
      2.  
        Object descriptors
      3.  
        Query descriptors
      4. Buffers
        1.  
          Buffer size
        2.  
          Private buffer space
        3.  
          Use of BSA_DataBlock32 in BSASendData()
        4.  
          Use of BSA_DataBlock32 in BSAGetData()
        5.  
          Shared memory
    3. NetBackup XBSA environment
      1.  
        Environment variable definitions
      2.  
        Extended environment variable definitions
    4. XBSA sessions and transactions
      1. Sessions
        1.  
          Initialization and termination
        2.  
          Authentication
      2. Transactions
        1.  
          Backup transaction
        2.  
          Restore transaction
        3.  
          Delete transaction
        4.  
          Query transaction
        5.  
          Media IDs transaction
    5. Creating a NetBackup XBSA application
      1. Initiating a session
        1.  
          Modifying the XBSA environment within a session
        2.  
          Session example
      2. Backup - creating an object
        1.  
          Creating an object
        2.  
          NetBackup object ownership
        3.  
          Creating an empty object
        4.  
          Backup example
      3. Query - finding an object descriptor
        1.  
          Querying for an object
        2.  
          Query example
      4. Restore - retrieving an object's data
        1.  
          Restoring an object
        2.  
          Redirected restore to a different client
        3.  
          Restore example
        4.  
          Multiple object restore
        5.  
          Multiple object restore example
      5. Delete - deleting an object or image
        1.  
          Delete example
      6. Media IDs - obtaining media IDs
        1.  
          Media ID example
      7.  
        Logging and NetBackup
      8.  
        Client in a cluster
      9.  
        Performance considerations
  4. How to build an XBSA application
    1.  
      Getting help
    2.  
      Flags and defines
    3.  
      How to build in debug mode
    4.  
      How to debug the application
    5.  
      Static libraries
    6.  
      Dynamic libraries
    7.  
      End-user configuration
  5. How to run a NetBackup XBSA application
    1. About How to run a NetBackup XBSA application
      1. Creating a NetBackup policy
        1.  
          Selecting a storage unit
        2.  
          Adding new schedules
        3.  
          Adding script files to the files list
        4.  
          Adding new clients
      2.  
        Running a NetBackup XBSA application
      3.  
        Backups and restores initiated by NetBackup (through a script)
      4.  
        Backups and restores from the command line
  6. API reference
    1.  
      Error messages
    2. Function calls
      1.  
        Conventions
    3. Function specifications
      1.  
        BSABeginTxn
      2.  
        BSACreateObject
      3.  
        BSADeleteObject
      4.  
        BSAEndData
      5.  
        BSAEndTxn
      6.  
        BSAGetData
      7.  
        BSAGetEnvironment
      8.  
        BSAGetLastError
      9.  
        BSAGetNextQueryObject
      10.  
        BSAGetObject
      11.  
        BSAInit
      12.  
        BSAQueryApiVersion
      13.  
        BSAQueryObject
      14.  
        BSAQueryServiceProvider
      15.  
        BSASendData
      16.  
        BSATerminate
      17.  
        NBBSAAddToMultiObjectRestoreList
      18.  
        NBBSADeleteImage
      19.  
        NBBSAEndGetMultipleObjects
      20.  
        NBBSAFreeJobInfo
      21.  
        NBBSAGetEnv
      22.  
        NBBSAGetErrorString
      23.  
        NBBSAGetJobId
      24.  
        NBBSAGetJobInfo
      25.  
        NBBSAGetMediaIds
      26.  
        NBBSAGetMultipleObjects
      27.  
        NBBSAGetServerError
      28.  
        NBBSALogMsg
      29.  
        NBBSASetEnv
      30.  
        NBBSAUpdateEnv
      31.  
        NBBSAValidateFeatureId
    4. Type definitions
      1. Enumerated types
        1.  
          BSA_CopyType
        2.  
          BSA_ObjectStatus
        3.  
          BSA_ObjectType
        4.  
          BSA_Vote
        5.  
          Constant values
      2. Data structures
        1.  
          BSA_ApiVersion
        2.  
          BSA_DataBlock32
        3.  
          BSA_ObjectDescriptor
        4.  
          BSA_ObjectName
        5.  
          BSA_ObjectOwner
        6.  
          BSA_QueryDescriptor
        7.  
          BSA_SecurityToken
  7. Process flow and troubleshooting
    1.  
      About Process flow and troubleshooting
    2. Backup
      1. Stream backup process flow description
        1.  
          Stream backup procedure
    3. Restore
      1. Stream restore process flow description
        1.  
          Stream restore procedure
  8. How to use the sample files
    1. What the sample files do
      1. Sample programs
        1.  
          Backup
        2.  
          Restore
        3.  
          Query
        4.  
          Delete
      2.  
        Sample scripts
    2.  
      Description of sample files
    3.  
      How to build the sample programs
  9. Support and updates
    1.  
      About Support and updates
  10. Appendix A. Register authorized locations
    1.  
      Registering authorized locations used by a NetBackup database script-based policy

Multiple object restore

If multiple objects are going to be restored in one session or transaction, the XBSA agent should consider using the NBBSAGetMultipleObjects function call. This is a NetBackup extension to the XBSA interface to optimize the retrieval of objects in a NetBackup environment. This is especially useful when retrieving many small objects.

The reason this provides a performance improvement is that each NetBackup restore operation creates a NetBackup job, which acquires resources and then frees them up when the job is complete. Each BSAGetObject call translates into one NetBackup job. The initial time required to start a NetBackup job and establish communication are minimal, especially when compared to the time to transfer large amounts of data. But if the objects are small and numerous, this overhead per object is noticeable. It is also possible on heavily loaded NetBackup systems that successive BSAGetObject calls may get queued up behind other NetBackup jobs and resource requests. Any of these could cause performance issues if the separate objects are all part of one restore.

To address this behavior of NetBackup, we have added a multiple object restore interface to the XBSA interface. This is an extension of the XBSA specification to enhance performance for the NetBackup XBSA applications. The use of this interface is not required and does not provide functionality on objects that are not available through the interfaces defined by XBSA.

Requirements

  • To do a multiple object restore, the XBSA application needs to have created the objects in ways that allow this and there are restrictions on how the objects can be retrieved.

  • All of the objects that are to be restored within a multiple object restore must be part of the same NetBackup image, which means that the objects were created in one transaction. This can be verified by checking that each object being restored has the same copyId.left.

  • The objects must be retrieved in the same order that they were created. Some objects in the image can be skipped, but the objects being retrieved must be ordered in a way that do not cause the media to have to position backwards. The ordering of objects can be determined by verifying that the copyId.right for each object is in ascending order.

  • While not all objects in an image need to be retrieved, all objects in the list created by NBBSAAddToMultiObjectRestoreList must be retrieved in the order in which they are listed. Objects cannot be skipped or added.

  • Each object in the list is retrieved with BSAGetObject followed by successive BSAGetData calls to retrieve all of the data. All of the data for an object must be retrieved before moving on to the next object.

Functions and use

There are three new functions provided as part of the XBSA interface that can be used to do multiple object restores.

  • NBBSAAddToMultiObjectRestoreList takes an object descriptor and it to a descriptor list. This function is called for each object that is to be retrieved as part of one restore job. It is highly recommended to use this function to create the list because it allows the XBSA interface to be in charge of memory allocation and deletion.

  • NBBSAGetMultipleObjects starts the multiple object restore job. It takes the list of descriptors built by NBBSAAddToMultiObjectRestoreList and submits a request to restore all objects.

  • NBBSAEndGetMultipleObjects ends the multiple object restore job. This function cleans up the memory from the object list and allows the application to COMMIT or ABORT the restore, which has no real effect on the data.

The process is very similar to the single object restores. First, all objectDescriptors to be retrieved are added to a list using the NBBSAAddToMultiObjectRestoreList. The objectDescriptors can be generated from BSAQueryObject or populated by the application. Once the list is ready, a call to NBBSAGetMultipleObjects initiates the restore process. Then, each object is retrieved using the standard BSAGetObject, BSAGetData, and BSAEndData function calls. The difference is that BSAGetObject knows it is part of a larger restore job. After all objects have been retrieved, NBBSAEndGetMultipleObjects is called to end the restore process. The transaction can then be ended. If an object is skipped or not all data is retrieved, the entire job fails.