Catalyst SDK Implementation Guide 9.0
User Manual:
Open the PDF directly: View PDF
.
Page Count: 125
HPE StoreOnce Catalyst
Developers Implementation Guide v9.0
This document is provided under a HPE Confidential Disclosure Agreement
Contents
Section 1: StoreOnce Catalyst Concepts ...................................................................................6
1.1 Introduction to StoreOnce Catalyst ............................................................................ 7
1.1.1
Overview of ISV Integration with HPE StoreOnce Catalyst ................................. 7
1.2 StoreOnce Catalyst Terminology................................................................................ 9
1.2.1
Catalyst Client ...................................................................................................... 9
1.2.2
Catalyst Server .................................................................................................... 9
1.2.3
Catalyst Store ....................................................................................................10
1.2.4
Catalyst Item......................................................................................................10
1.2.5
Command Sessions............................................................................................12
1.2.6
Data Sessions ....................................................................................................13
1.2.7
Data Job Records ...............................................................................................13
1.2.8
Copy Job Records ...............................................................................................13
1.2.9
Federated Catalyst ............................................................................................14
1.2.10
Federated Catalyst Store...................................................................................15
1.2.11
Federated Catalyst Item ....................................................................................16
1.2.12
Catalyst Over Fibre Channel ..............................................................................16
1.2.13
StoreOnce Catalyst Customer and API Reference ............................................16
Section 2: StoreOnce Catalyst Command Sessions ................................................................18
2.1 Command Sessions ...................................................................................................19
2.1.1
Opening a Command Session ............................................................................22
2.1.2
Command Session Retries .................................................................................24
2.1.3
Closing a Command Session ..............................................................................24
2.1.4
Federated Command Sessions ..........................................................................25
2.2 Section Summary and recommendated best practises ...........................................28
Section 3: StoreOnce Catalyst Item Data Sessions .................................................................29
3.1 Data Sessions ............................................................................................................30
3.1.1
Opening a Catalyst Item Data Session ..............................................................32
3.1.2
Catalyst Item Data Session Retries ...................................................................34
3.1.3
Closing a Catalyst Item Data Session ................................................................35
3.1.4
Federated Catalyst Item Data Sessions ............................................................36
3.2 Section Summary and recommendated best practises ...........................................38
Section 4: StoreOnce Catalyst Transfer Policies .....................................................................39
4.1 Bandwidth Optimized Data Transfer ........................................................................40
4.1.1
Target Deduplication .........................................................................................41
4.1.2
Backup Server Deduplication ............................................................................42
4.1.3
Application Source Deduplication .....................................................................42
Page 2 of 125
This document is provided under a HPE Confidential Disclosure Agreement
4.2 Catalyst Network Compression and Checksums ......................................................42
4.3 Section Summary and recommendated best practises ...........................................43
Section 5: StoreOnce Catalyst Error Reporting .......................................................................44
5.1 Error Logs ..................................................................................................................45
5.1.1
Catalyst Client Log Files ....................................................................................45
5.1.2
Catalyst over Fibre Channel Log File .................................................................46
5.1.3
Complete Code Example – Error Logging..........................................................46
5.1.4
Backup application Error Reporting ..................................................................47
5.2 Section Summary and recommendated best practises ...........................................49
Section 6: StoreOnce Catalyst Client and Server ....................................................................50
6.1 Catalyst Clients .........................................................................................................51
6.1.1
Getting Client Properties ...................................................................................51
6.2 Catalyst Servers ........................................................................................................54
6.2.1
Getting Server Properties ..................................................................................54
6.2.2
Setting Server Properties ..................................................................................59
6.3 ObjectStores..............................................................................................................60
6.3.1
Getting ObjectStore Capabilities .......................................................................60
6.4 Merging Client, Server and ObjectStore Capabilities ...............................................62
6.4.1
Merging Client and Server Capabilities .............................................................62
6.4.2
Code Example – Merging Client and Server Capabilities (for versions older
than v7) 62
6.4.3
Other Supported Capabilities ............................................................................63
6.5 Section Summary and recommendated best practises ...........................................63
Section 7: StoreOnce Catalyst Stores .....................................................................................64
7.1 Catalyst Stores ..........................................................................................................65
7.1.1
Properties ..........................................................................................................65
7.1.2
Listing Catalyst Stores.......................................................................................65
7.1.3
Creating a Catalyst Store ...................................................................................68
7.1.4
Modifying a Catalyst Store ................................................................................69
7.1.5
Deleting a Catalyst Store ...................................................................................71
7.1.6
Wait for a Catalyst Store ...................................................................................73
7.2 Section Summary and recommendated best practises ...........................................74
Section 8: StoreOnce Catalyst Items .......................................................................................75
8.1 Catalyst Items ...........................................................................................................76
8.1.1
Properties ..........................................................................................................76
8.1.2
Metadata ............................................................................................................78
8.1.3
Data ....................................................................................................................80
8.1.4
Creating a Catalyst Item ....................................................................................80
8.1.5
Listing Catalyst Items ........................................................................................82
Page 3 of 125
This document is provided under a HPE Confidential Disclosure Agreement
8.2 Section Summary and recommendated best practises ...........................................84
8.2.2
Modifying Catalyst Item Meta Data ...................................................................86
8.2.3
Deleting a Catalyst Item ....................................................................................87
8.2.4
Federated Catalyst Items ..................................................................................88
8.3 Writing to Catalyst Items ..........................................................................................88
8.3.1
Writing to a Catalyst Item ..................................................................................88
8.3 Reading from Catalyst Items .........................................................................................91
8.3.2
Reading from a Catalyst Item ............................................................................91
8.4 Cloning Data from a Catalyst Object.........................................................................94
8.5 Getting Data Transfer Information ...........................................................................95
8.6 Copying a Catalyst Item ............................................................................................98
8.6.1
Queuing a Catalyst Item Copy Job .....................................................................99
8.6.2
Catalyst Item Copy Job Records ..................................................................... 100
8.6.3
Cancelling Catalyst Item Copy Jobs................................................................ 102
8.6.4
Catalyst Item Copy Job Process ..................................................................... 103
8.6.5
Copy Job Records ............................................................................................ 104
Section 9: StoreOnce Catalyst Authentication ..................................................................... 108
9.1 Client Authentication ............................................................................................. 109
9.1.1
Client Access Permissions .............................................................................. 109
9.1.2
Managing Access Permission ......................................................................... 110
Section 10: StoreOnce Autonomic Failover ......................................................................... 119
10.1
Multi-Node StoreOnce Appliance Failover ......................................................... 120
Section 11: Compiling with StoreOnce Catalyst ................................................................... 121
11.1
Catalyst Client Library ........................................................................................ 122
11.1.1 Supported Platforms ...................................................................................... 122
Section 12: StoreOnce Catalyst Server and Client Version Release Notes ......................... 123
12.1
StoreOnce Release ............................................................................................. 124
12.1.1 StoreOnce 3.15 ............................................................................................... 124
12.1.2
StoreOnce 3.16 ............................................................................................... 124
Page 4 of 125
This document is provided under a HPE Confidential Disclosure Agreement
Implementation Guide Introduction
This Implementation Guide contains information for Independent Software Vendors (ISVs)
wishing to integrate HPE StoreOnce Catalyst into their backup application software using
the HPE StoreOnce Catalyst Software Development Kit (SDK).
It provides information on the StoreOnce Catalyst concepts and technology and has
example code snippets as well as integration requirements.
Example code is syntactically highlighted for readability and is displayed in a blue box as
below.
int main(int argc, char *argv[])
{
printf("Hello Catalyst Application!")
}
To ensure readability some code examples will require other sections in the guide to fully
implement.
The
SDK
includes
OSCLT_Interface.h,
OSCMN_Types.h
and
OSCLI_ErrorCodes.h with ExampleCode.c for a working demonstration of the SDK.
Page 5 of 125
This document is provided under a HPE Confidential Disclosure Agreement
Section 1: StoreOnce Catalyst Concepts
Page 6 of 125
This document is provided under a HPE Confidential Disclosure Agreement
1.1 Introduction to StoreOnce Catalyst
The StoreOnce Catalyst API provides an advanced RPC based interface through which
applications can have a rich interaction with StoreOnce appliances. The benefits of using
an RPC based interface instead of SCSI, CIFS or NFS is that the calling application can have a
much richer interaction with the storage device.
Backup Application Disk Agent
Backup Application Media Agent
StoreOnce Backup System
Data Sessions
StoreOnce Catalyst Client Library
Command Sessions
Backup Servers
Clients
Capabilities that were previously beyond view of the backup application, such as data
deduplication and replication are now presented in a manner which allows the backup
applications to present their users with more information and also to make decisions based
on the information returned.
StoreOnce Catalyst Server
Catalyst Store
Catalyst Store
Catalyst
Catalyst
Catalyst
Item
Item
Item
Catalyst
Catalyst
Catalyst
Item
Item
Item
Figure 1 - HPE StoreOnce Catalyst Client Deployment
The Catalyst Client Library should be distributed as part of the backup application and will
typically be included in any backup application components that would interact directly
with a target storage device. Figure 1 shows, for example, how the client library is
embedded within the backup application media agent, allowing the media agent to
communicate directly with the Catalyst Stores on the StoreOnce Backup System.
1.1.1 Overview of ISV Integration with HPE StoreOnce Catalyst
StoreOnce Catalyst targets should be thought of as a new device type that has been
optimized for the purposes of data protection. StoreOnce Catalyst should not be used as
Page 7 of 125
This document is provided under a HPE Confidential Disclosure Agreement
general purpose storage as the data deduplication data paths will most commonly have
sub-optimal throughput performance for more random access workloads.
For data protection there are four basic use cases:
• Backup
o Create objects on the storage target and populate them with data.
o Perform bandwidth efficient backups over LAN, WAN and Fibre Channel.
• Clone
o Clone data from a previous object into a new backup object
• Restore
o Recover data from objects on the storage target.
• Copy
o Create independent redundant copies of data on multiple storage targets.
o Perform bandwidth efficient copies over both LAN and WAN.
o Copies are managed by 3rd party software but data transfer is directly
between the storage targets.
Despite StoreOnce Catalyst targets being a disk based solution, when designing and
integrating with 3rd party software it is often useful to think of the Catalyst Item as an
advanced tape drive. This means that you should aim to write to the Catalyst Item in a
sequential manner with a single data stream per Catalyst Item. Unlike tape however,
Catalyst Items have additional properties such as metadata, descriptive tags, data
deduplication and the ability to perform bandwidth efficient copies between storage
targets.
Copying Catalyst Items between storage targets is controlled by the 3rd party software, this
allows the software to control when copies are made and how many copies are made. The
key benefit being that the 3rd party software is aware of all the copies of the data that exist
and can therefore control their lifecycles.
Additionally the 3rd party software may specify the copy to be a region within a Catalyst
Item rather than the whole Catalyst Item. This allows the 3rd party software, for example,
to create copies that have unique header information. An example flow chart showing the
copy process can be found in page 104.
StoreOnce Catalyst integration is commonly achieved in one of two ways:
1) By creating a specific new type of storage target within the 3rd party software that
presents the full range of StoreOnce Catalyst functionality to the user. The benefit
of this approach is that a much richer user experience where data management is
viewed in a consistent way through both the 3rd party software and the storage
target.
2) By creating a generic storage target type within the 3rd party software and
integrating with StoreOnce Catalyst through a plug-in architecture. This caters for
frameworks where the 3rd party software integrates with multiple storage target
vendors, such as Symantec OpenStorage.
Page 8 of 125
This document is provided under a HPE Confidential Disclosure Agreement
Backup Application Media Agent
StoreOnce Backup System
Data Sessions
StoreOnce Catalyst Client Library
Command Sessions
Backup Servers
1.2 StoreOnce Catalyst Terminology
StoreOnce Catalyst Server
Catalyst Store
Catalyst Store
Catalyst
Catalyst
Catalyst
Item
Item
Items
Catalyst
Catalyst
Catalyst
Item
Item
Items
Figure 2 - StoreOnce Catalyst
1.2.1 Catalyst Client
A Catalyst Client is the name used to describe any application used to connect to the
Catalyst Server using the Catalyst Client API. A typical Catalyst Client would be a data
backup application that is using the Catalyst Server as a target for the backup data.
Catalyst Clients are described in more detail in the Catalyst Clients section on page 51.
1.2.2 Catalyst Server
A Catalyst Server is the name used to describe any target appliance that has StoreOnce
Catalyst capabilities, for example the HPE StoreOnce 6500. The Catalyst Server is
responsible for the management of Catalyst Client connections to Catalyst Stores and
Catalyst Items, as well as the control of asynchronous copy operations between Catalyst
Stores.
A Catalyst Server provides access to state information that a backup application may
request. This includes the number of Catalyst Client sessions that can be opened to the
Catalyst Server, the number of Catalyst Stores configured and capacity utilisation. Each
Catalyst Server may host one or more Catalyst Stores.
Catalyst Servers are described in more detail in the Catalyst Servers section on page 54.
Page 9 of 125
This document is provided under a HPE Confidential Disclosure Agreement
Catalyst Server
Properties:
•
Serial Number
•
Free Command Sessions
•
Free Data Sessions
•
Number of Catalyst Stores
•
System Time
•
Storage Capacity
•
Storage Free Capacity
•
Licensed
•
Copy Job Blackout Window Policy
•
Copy Job Bandwidth Limitation Window Policy
Store
Store
Store
Figure 3 - Catalyst Server overview
1.2.3 Catalyst Store
A Catalyst Store is a container in which multiple Objects may be stored. If the Catalyst
Store supports deduplication, then all Objects written to this Catalyst Store will have their
data content deduplicated to reduce the amount of storage capacity required for the
Catalyst Item. Deduplication only occurs across Objects within the same Catalyst Store.
Each Catalyst Store has a unique identifier known as a Key. The Key must be unique within
the scope of the Catalyst Server and cannot be altered after creation. An optional
description may also be provided.
Information such as the number of Objects within the Catalyst Store, the deduplication
efficiency within the Catalyst Store and the number of running data and copy jobs are all
reported when the Catalyst Store is queried.
Catalyst Stores are described in more detail in the Catalyst Stores section on page 65.
Catalyst Store
Properties:
•
Key
•
Description
•
Version
•
Created Date
•
User Data Stored
•
Dedupe Ratio
•
Number of Items
•
Number of Data Jobs
•
Number of Copy Jobs
•
Health Status
Catalyst
Catalyst
Item
Item
Item
Catalyst
Catalyst
Item
Item
Item
Catalyst
Catalyst
Item
Item
Item
Catalyst
Catalyst
Item
Item
Item
Catalyst
Catalyst
Item
Item
Item
Catalyst
Catalyst
Item
Item
Item
Catalyst
Catalyst
Item
Item
Item
Catalyst
Catalyst
Item
Item
Item
Figure 4 - Catalyst Store overview
1.2.4 Catalyst Item
Items (also referred to as Objects in the SDK) consist of three elements:
• Catalyst Item Properties
• Meta Data
• Catalyst Item Data
Page 10 of 125
This document is provided under a HPE Confidential Disclosure Agreement
Each Catalyst Item within a Catalyst Store must have a unique identifier, known as a Key,
which shall be supplied when the Catalyst Item is created. Once a Catalyst Item is created,
the Key may not be modified. The Catalyst Item Key must be specified whenever a data
connection is opened.
Information such as the Created Date and the Last Modified Date are set by the Catalyst
Server and are stored as UTC timestamps. These timestamps may not be manually
modified by the Catalyst Client.
A Tag List property allows series of text identifiers to be associated with a Catalyst Item.
Tags may be specified at Catalyst Item creation time and modified at any time using the
osCltCmd_ModifyObjectMeta operation. For more details see Tag Lists on page 77.
The State property indicates the current state of a Catalyst Item and under normal
operation shall always have a state of OSCMN_CONFIG_STATE_CONFIGURED. When
creating
or
deleting
a
Catalyst
Item
the
state
will
be
OSCMN_CONFIG_STATE_CREATING
or
OSCMN_CONFIG_STATE_DELETING
respectively.
States
when
the
Catalyst
Item
is
non-operational
are
OSCMN_CONFIG_STATE_UNCONFIGURED,
OSCMN_CONFIG_STATE_FAILED_TO_CREATE
and
OSCMN_CONFIG_STATE_FAILED_TO_DELETE. The State property is fixed by the
Catalyst Server and may not be modified by the Catalyst Client.
The Storage Mode provides information about whether the Catalyst Item was stored using
variable block deduplication or fixed block deduplication. When creating a Catalyst Item
the storage mode selected must match a storage mode supported by the Catalyst Store.
This Storage Mode information is important when copying data between Objects as the
Objects must have the same Storage Mode. For more details see Storage Mode on page 77.
Meta Data may be stored in a Catalyst Item by a client caller. For more information about
Meta data see Metadata on page 78.
The Catalyst Item data part of a Catalyst Item is where the user data is located and can only
be accessed using a data session. There is no limited to the amount of data that can be
stored in a Catalyst Item but a Catalyst Store may have a storage quota applied.
When listing Items in a Catalyst Store, all of the properties will be returned in an array. The
caller may also optionally request metadata be included in the response but Catalyst Item
data is not returned during a list operation.
Catalyst Items are described in more detail in the
Page 11 of 125
This document is provided under a HPE Confidential Disclosure Agreement
Catalyst Items section on page 76.
Catalyst Item
Properties:
•
Key
•
Version
•
Created Date
•
Last Modified Date
•
Item Data Size
•
Tag List
•
State
•
Storage Mode
Meta Data
Item Data
Figure 5 - Catalyst Item overview
1.2.5 Command Sessions
A command session is a socket connection established between a Catalyst Client and a
Catalyst Server for the purposes of managing Catalyst Servers, Catalyst Stores and
Catalyst Items.
Command Sessions are described in more detail in the
Page 12 of 125
This document is provided under a HPE Confidential Disclosure Agreement
Command Sessions section on page 19.
1.2.6 Data Sessions
A data session is a socket connection established between a Catalyst Client and a Catalyst
Item for the purposes of data transfer, such as writing and/or reading data.
Data Sessions are described in more detail in the Data Sessions section on page 30.
1.2.7 Data Job Records
For every data session opened, a new data job record will be created. A data job record
details the meaningful events that were performed during a data session. Their purpose is
to allow Catalyst users the ability to review information about their data session. An
example use would be for a Catalyst object which is created and then written to via a data
session. A data job record will be created listing the object name, client IP address from
which the session was written, the amount of data written, dedupe ratio; among others.
Data job records are also created for read data operations.
Data jobs records have an expiration period. This expiration period is defined at a per
Catalyst store level. The client should can set the retention period via
OSCMN_sJobRetentionPolicyType. It should be set to the default
OSCMN_JOB_RETENTION_POLICY_DEFAULT_DAYS (90 days) unless the user selects
otherwise.
The
Retention
periods
must
be
between
1
and
MaximumJobRetentionPeriod in Server Capabilities.
Data Jobs are described in more detail on page 94.
1.2.8 Copy Job Records
Similar to data job records, every Catalyst Copy operation will create a copy job record. A
copy job record details the meaningful information about a Catalyst copy session. Their
purpose is to allow Catalyst users the ability to review information about their Catalyst
copy session. An example use would be for a Catalyst Item which is copied from source to
target. Both the source and target Catalyst Items will have copy job records created. The
source will create an “Outbound Copy Job” record and the target an “Inbound Copy Job”
record. The information recorded is similar to the above Data Job Records, including: name,
client IP address from which the session was written, the amount of data written, dedupe
ratio; among others.
Copy jobs records have an expiration period. This expiration period is defined at a per
Catalyst store level. The client can set the retention period via
OSCMN_sJobRetentionPolicyType. It should be set to the default
OSCMN_JOB_RETENTION_POLICY_DEFAULT_DAYS (90 days) unless the user selects
otherwise.
The
Retention
periods
must
be
between
1
and
MaximumJobRetentionPeriod in Server Capabilities.
Page 13 of 125
This document is provided under a HPE Confidential Disclosure Agreement
Copy Jobs are described in more detail on page 98.
1.2.9 Federated Catalyst
Within a multi-node StoreOnce appliance, such as the HPE StoreOnce 6500, the maximum
size of a Catalyst Store will be limited by the capacity available behind each couplet of the
cluster. This means that users must configure multiple Catalyst Stores across the cluster
and define within their backup software which backups will be directed to which Catalyst
Stores, in order to address all available storage.
Figure 6 - Individual Pools of Storage in a Cluster
Federated Catalyst introduces a new capability to the StoreOnce Catalyst API whereby a
logical Catalyst Store may now be created across multiple nodes within a cluster. This
removes the need for customer to configure multiple Catalyst Stores across the cluster and
complex policies within their backup software.
Page 14 of 125
This document is provided under a HPE Confidential Disclosure Agreement
Figure 7 - Federated Pools of Storage in a Cluster
Backup applications integrating with StoreOnce Catalyst are able to support Federated
Catalyst Stores with only a few minor changes, described in more detail later in this
document.
1.2.10 Federated Catalyst Store
A Federated Catalyst Store comprises of individual Catalyst Stores configured across
multiple nodes. Each of the individual Catalyst Stores that make up the federation will
store a portion of the data written to the Federated Catalyst Store. Storage utilisation
across the nodes is then managed by the Catalyst Client.
The Catalyst Client interacts with the Federated Catalyst Store by establishing connections
to each individual Catalyst Stores and routing requests to the appropriate nodes on behalf
of the backup application. This means that a backup application does not need to manage
the complexities of device management but instead can continue to address a single target
device.
Page 15 of 125
Backup Application Media Agent
StoreOnce Backup System
StoreOnce
Catalyst Server
Catalyst
Catalyst
Catalyst
Item
Item
Items
Data Sessions
StoreOnce Catalyst Client Library
Command Sessions
Backup Servers
This document is provided under a HPE Confidential Disclosure Agreement
StoreOnce
Catalyst Server
Catalyst
Catalyst
Catalyst
Item
Item
Items
StoreOnce
Catalyst Server
Federated Catalyst Store
Catalyst
Catalyst
Catalyst
Catalyst
Catalyst
Catalyst
Catalyst
Catalyst
Catalyst
Item
Item
Item
Item
Item
Item
Items
Items
Items
StoreOnce
Catalyst Server
Catalyst
Catalyst
Catalyst
Item
Item
Items
Catalyst
Catalyst
Catalyst
Item
Item
Items
Figure 8 - Federated Catalyst
More detail on how to integrate with Federated Catalyst Stores can be found in the Catalyst
Stores on page 65.
1.2.11 Federated Catalyst Item
Federated Catalyst Items (also referred to as Objects in the SDK) are the same as regular
Catalyst Items with the exception that they exist in Federated Catalyst Stores. In most
cases, when a Catalyst Item is created in a Federated Catalyst Store it will be created on
each individual federation member. Each of these Catalyst Items will then hold a portion of
the data written to the Federated Catalyst Item.
Federated Catalyst Items are described in more detail in Federated Catalyst Items on page
88.
1.2.12 Catalyst Over Fibre Channel
Catalyst Over Fibre Channel allows a backup application to use the Catalyst software over a
fibre channel connection by opening a command or data session using a Catalyst Over Fibre
Channel identifier (prepended with “COFC-“) rather than an IP address. The Catalyst Client
from protocol v6 automatically handles the fibre channel protocol internally and so the
same client functions can be used as Catalyst over Ethernet except for Copyjobs that are
allowed over FC from protocol v9 onwards.
1.2.13 StoreOnce Catalyst Customer and API Reference
Table 1 provides a cross reference between the StoreOnce Catalyst terminology used in the
customer viewable interface such as the appliance management interface and the internal
ObjectStore API that is used by integrators in the SDK.
Page 16 of 125
This document is provided under a HPE Confidential Disclosure Agreement
Table 1 – Terminology references
Customer Terminology
HPE StoreOnce Catalyst Server
HPE StoreOnce Catalyst Store
HPE StoreOnce Catalyst Item
HPE StoreOnce Federated Catalyst Store
HPE StoreOnce Federated Catalyst Item
SDK Terminology
ObjectStore Server
ObjectStore
Object
Teamed ObjectStore
Teamed Object
Page 17 of 125
This document is provided under a HPE Confidential Disclosure Agreement
Section 2: StoreOnce Catalyst Command
Sessions
Page 18 of 125
This document is provided under a HPE Confidential Disclosure Agreement
2.1 Command Sessions
A command session is established between the Catalyst Client and the Catalyst Server
using the osCltCmd_OpenCommandSession operation. This will return a session
handle that should then be passed with subsequent command operations. The session is
closed by calling the osCltCmd_CloseCommandSession operation.
The number of concurrent command sessions that a Catalyst Server can support is not
without limit and therefore a Catalyst Client should take care to minimize the number of
open command sessions open to a given Catalyst Server. This is best achieved by only
maintaining a command session for the duration of a single command operation.
A typical command session would be as follows:
• osCltCmd_OpenCommandSession
• osCltCmd_GetServerProperties
• osCltCmd_CloseCommandSession
It should also be noted that inactive command sessions will timeout after five minutes.
A command session handle must not be shared between overlapping command session
operations.
Page 19 of 125
The command operations available are:
Table 2 - Command session supported protocols
Command
Protocol
v4
Protocol
v5
Protocol
v6
Protocol
v7
Protocol
v8
Protocol
v9
osCltCmd_OpenCommandSession
osCltCmd_CloseCommandSession
osCltCmd_GetServerProperties
osCltCmd_ListObjectStores
osCltCmd_CreateObjectStore
osCltCmd_ModifyObjectStore
osCltCmd_DeleteObjectStore
osCltCmd_ListObjects
osCltCmd_ListObjectsCount
osCltCmd_CreateObject
osCltCmd_ModifyObjectMeta
osCltCmd_DeleteObject
osCltCmd_ListObjectDataJobs
osCltCmd_ListObjectDataJobsCount
osCltCmd_QueueObjectCopyJob
osCltCmd_ListOriginObjectCopyJobs
osCltCmd_ListOriginObjectCopyJobsCount
osCltCmd_ListDestinationObjectCopyJobs
osCltCmd_ListDestinationObjectCopyJobsCount
osCltCmd_CancelOriginObjectCopyJob
osCltCmd_CancelDestinationObjectCopyJob
osCltCmd_SetServerProperties
osCltCmd_SetClientPermissionsChecking
osCltCmd_ListClientPermissions
osCltCmd_CreateClientPermissions
osCltCmd_ModifyClientPermissions
osCltCmd_ModifyClientPassword
This document is provided under a HPE Confidential Disclosure Agreement
osCltCmd_DeleteClientPermissions
osCltCmd_ListObjectStoreClientPermissions
osCltCmd_AddObjectStoreClientPermission
osCltCmd_RemoveObjectStoreClientPermission
osCltCmd_SetServerProperties
osCltCmd_SetClientPermissionsChecking
osCltCmd_ListClientPermissions
osCltCmd_CreateClientPermissions
osCltCmd_OpenTeamedCommandSession
osCltCmd_TeamedExpandObjectStore
osCltCmd_TeamedContractObjectStore
osCltCmd_TeamedExpandObject
osCltCmd_TeamedContractObject
* Protocol v5 returns Federated (Teaming) values in structures but they will always be false.
Full details of the command session operations can be found in OSCLT_Interface.h.
Page 21 of 125
2.1.1 Opening a Command Session
Command Sessions should be opened on demand, to issue a command or short burst of
commands, and then closed again. In many cases it will be preferential to create a wrapper
function
around
the
osCltCmd_OpenCommandSession
and
osCltCmd_OpenTeamedCommandSession operations which are able to manage the
resource allocation and retry logic.
When opening a command session via osCltCmd_OpenCommandSession the client
should specify logging information. The client should specify the log session ID
(OSCLT_sSessionLogIdType), log path (OSCLT_sPathnameType), log level
(osClt_SessionLogLevel) and maximum log file size. Error Logging is described in
more detail in the Error Logs section on page 45.
2.1.1.1 Code Example – Open a Command Session
#define OBJSDK_CMD_SESSION_ID "OBJSDK_CMD"
int objSDKPrv_OpenCmdSession(const char *pServerAddress,
OSCLT_sSessionHandleType *pCmdSessionHandle)
{
int returnStatus = OSCLT_ERR_SUCCESS;
int callStatus = OSCLT_ERR_SUCCESS;
int retryCount = 0;
int sleepSeconds = 2;
OSCLT_sSessionLogIdType sessionLogID;
OSCMN_sAddressPortType serverAddr;
OSCLT_sPathnameType logPath;
OSCMN_sCredentialsType cred;
OSCLT_sSessionLogDescriptorType sessionLogDescriptor;
OSCLT_sSessionOptionsType sessionOptions;
// << Memset all structures>>
strncpy(sessionLogID.String,
OBJSDK_CMD_SESSION_ID,
sizeof(sessionLogID.String));
if (sessionLogID.String[sizeof(sessionLogID.String) - 1])
{
returnStatus = OSCLT_ERR_INTERNAL_ERROR;
return returnStatus;
}
sessionLogID.StringSize = strlen(sessionLogID.String);
strncpy(serverAddr.Address.String,
pServerAddress,
sizeof(serverAddr.Address.String));
if (serverAddr.Address.String[sizeof(serverAddr.Address.String) - 1])
{
returnStatus = OSCLT_ERR_INTERNAL_ERROR;
return returnStatus;
}
serverAddr.Address.StringSize = strlen(serverAddr.Address.String);
serverAddr.PortNumber = OSCLT_DEFAULT_COMMAND_PORT;
// <>
// <>
while (retryCount < 33)
{
callStatus = osCltCmd_OpenCommandSession(&sessionLogDescriptor,
&sessionOptions,
&serverAddr,
&cred,
pCmdSessionHandle);
// <>
if (callStatus == OSCLT_ERR_MAXIMUM_SESSIONS)
{
sleep(sleepSeconds);
if (sleepSeconds < 30)
{
sleepSeconds = sleepSeconds * 2;
sleepSeconds = (sleepSeconds > 30)? 30 : sleepSeconds;
}
}
else
{
break;
}
retryCount++;
}
if (callStatus != OSCLT_ERR_SUCCESS)
{
printf("Error : Unable to open command session, error : %s.\n",
objSDKPrv_ErrorNumToString(callStatus));
returnStatus = callStatus;
return returnStatus;
}
return returnStatus;
}
Within the shipping application, for debug / support purposes the backup application is
recommended to expose a means of increasing the log level and log file size, on a
temporary basis. This may be within a configuration file or within the application interface.
The levels of available logging are:
OSCLT_LOG_LEVEL_EXTENDED_DEBUG
OSCLT_LOG_LEVEL_DEBUG
OSCLT_LOG_LEVEL_TRACE
OSCLT_LOG_LEVEL_INFO
OSCLT_LOG_LEVEL_QUIET
OSCLT_LOG_LEVEL_ERROR
During application development it may be useful for the client to run in
OSCLT_LOG_LEVEL_INFO
mode,
but
the
level
should
be
set
to
OSCLT_LOG_LEVEL_ERROR before shipping to customers. Debug and extended debug
are very verbose and should only be used if instructed by HP.
Page 23
If an Open Session operation does not return OSCLT_ERR_SUCCESS then it will free up
all resources it may have used (sockets, mallocs, etc). Close Session does not need to be
called for such session, and must not be called as the Session Handle (out parameter) will
be invalid (see above). Using the session handle parameter will almost certainly result in a
segv.
2.1.2 Command Session Retries
Catalyst Servers support a limited number of concurrent command sessions. An indicator
to
the
number
of
available
command
sessions
is
returned
by
osCltCmd_GetServerProperties in FreeCommandSessions. This value should
only be treated as a guide however due to the very short life of command sessions and
therefore the backup application should include logic to retry the opening of command
sessions if the open fails with an error of OSCLT_ERR_MAXIMUM_SESSIONS.
It is recommended that a retry mechanism be written such that successive retry would
progressive increase the delay between retry attempts. For example, on the first retry
attempt the delay would be 2 seconds. On the second retry the delay would increase to 4
seconds and one the third retry the delay would increase to 8 seconds. The increasing
delay should be capped at 30 second intervals, as shown in Table 3.
Table 3 - Recommended Command Session Retry Delays
Retry Attempt Retry Delay (Sec)
1
2
2
4
3
8
4
16
5 – 33
30
After all the retries have been attempted (15 minutes), the operation should fail and the
backup application should make a decision about how to proceed. For example, the backup
application could reschedule the backup jobs to run at another time.
2.1.3 Closing a Command Session
Users of the API are expected to be responsible citizens and close sessions when they have
finished with them. This way the Server is able to service many more clients than it has
worker threads available as clients will time slice on a Command Session by Command
Session basis.
For
both
Command
Sessions
and
Federated
Command
osCltCmd_CloseCommandSession should be called to close the session.
Sessions,
If osCltCmd_CloseSession returns an error, it will still free up all resources used by
that session. osCltCmd_CloseSession does not need to be called again for that
session, and must not be called as the Session Handle will have been invalidated by the
initial osCltCmd_CloseSession operation. Using the session handle parameter after a
close will almost certainly result in a segv.
Page 24
Command Sessions which are not explicitly closed by the Catalyst Client will timeout after 5
minutes of inactivity and will be forcibly closed by the Catalyst Server.
2.1.3.1 Code Example – Close a Command Session
int objSDKPrv_CloseCmdSession(OSCLT_sSessionHandleType *pCmdSessionHandle)
{
int returnStatus = OSCLT_ERR_SUCCESS;
int callStatus = OSCLT_ERR_SUCCESS;
if (pCmdSessionHandle)
{
callStatus = osCltCmd_CloseCommandSession(pCmdSessionHandle);
if (callStatus != OSCLT_ERR_SUCCESS)
{
printf("Error : Unable to close command session.\n");
return returnStatus;
}
}
return returnStatus;
}
2.1.4 Federated Command Sessions
A Federated Command Session provides the Catalyst Client with a method of performing
the same command session task or query across a federation of Catalyst Servers. This
ensures consistency across the federation when performing such tasks as creating Catalyst
Items, as well as proving consolidated results when performing lists of Catalyst Items or
Data Jobs.
Backup App. Server
Backup
Application
Plug-In
Catalyst
Client
TCP/IP
Network
Federated Catalyst Store
Catalyst Store #1
(Federated Member)
Catalyst Store #2
(Federated Member)
Catalyst Store #N
(Federated Member)
Catalyst Server #1
Catalyst Server #2
Catalyst Server #N
Figure 9 - Federated Members
Only a subset of commands may be run from a Federated Command Session:
• osCltCmd_GetServerProperties
Page 25
•
•
•
•
•
•
•
•
•
osCltCmd_ListObjectStores (only if key filter is provided with ExactMatchOnly)
osCltCmd_CreateObjectStore
osCltCmd_ModifyObjectStore
osCltCmd_DeleteObjectStore
osCltCmd_ListObjects
osCltCmd_CreateObject
osCltCmd_ModifyObjectMeta
osCltCmd_DeleteObject
osCltCmd_ListObjectDataJobs
When calling any of the commands above, the request will be applied to all Federated
Members and any response will be a merged response from all Federated Members. This
means, for example, when listing data jobs in a Federated Catalyst Store the job details will
show the combined data job records from each of the Federated Members.
Unlike a non-federated command session, a Federated Command Session is bound to the
Federated Store, so the caller must have permission to access the Federated Store to be
able to open the session. Federated command sessions can be opened in two modes:
• Bootstrap Mode
• Normal Mode
2.1.4.1 Bootstrap Mode
'Bootstrap' mode is where a blank store key is provided to the open Federated Command
Session operation. It is used for Federated Store creation, expansion, and contraction
operations (and can be used for store modification).
A Federated policy is provided in the create/expand/contract operation, which contains,
amongst other things, the address for all Federation Members. This is needed because a
backup application typically only allows for a single address to be provided for a backup
target device, which is the server address passed into the open Federated session
operation. The Federation policy can then be consulted by the client API so it can internally
connect to all the other Federation members. Once the create/modify/expand/contract
operation is completed the session becomes a normal command session. If the operation
fails, the bootstrap session is locked down, and should be closed using
osCltCmd_CloseCommandSession.
2.1.4.2 Normal Mode
'Normal' mode is where a non-blank Federated Store key is provided in the open Federated
command session operation. It is used for all Federated command session operations other
than store creation, expansion and contraction.
The client API pulls the Federation policy from the Federated member whose server
address is provided in the open, and then consults this so it can internally connect to all the
other Federated Members.
Page 26
Store modification is usually done in a ‘normal’ Federated Command Session, but can
optionally be done in bootstrap mode if a Federated Member has changed its address (so
opening a normal Federated Command Session won't work as the Federated Member
address details stored in the Federate Policy on the server are wrong).
There is no bootstrap Federated store delete. Instead, each individual single Federate
Member store can be deleted via a normal command session.
2.1.4.3 Code Example – Open a Teamed Command Session
int objSDKPrv_OpenTeamedCmdSession(const char *pServerAddress,
OSCLT_sSessionHandleType *pCmdSessionHandle, const char *pStoreKey)
{
int returnStatus = OSCLT_ERR_SUCCESS;
int callStatus = OSCLT_ERR_SUCCESS;
int retryCount = 0;
int sleepSeconds = OBJSDK_CMD_SESSION_RETRY_SLEEP_SECONDS_MIN;
//<>
OSCMN_sKeyType teamedObjectStoreKey;
OSCLT_sTeamMemberConnectionStatusType teamMemberConnectionStatus;
if (pStoreKey == NULL) // Open connection in bootstrap mode
{
memset(&teamedObjectStoreKey, 0, sizeof(teamedObjectStoreKey));
}
else // Storekey is defined - open connection in non-bootstrap mode
{
memset(&teamedObjectStoreKey,
0,
sizeof(teamedObjectStoreKey));
strncpy(teamedObjectStoreKey.String,
pStoreKey,
sizeof(teamedObjectStoreKey.String));
if (teamedObjectStoreKey.String[sizeof(teamedObjectStoreKey.String)
- 1])
{
printf("Error : Unable to set Teamed Store Key %s\n",
teamedObjectStoreKey.String);
returnStatus = OSCLT_ERR_INTERNAL_ERROR;
return returnStatus;
}
teamedObjectStoreKey.StringSize = strlen
(teamedObjectStoreKey.String);
}
while (retryCount < 33)
{
callStatus = osCltCmd_OpenTeamedCommandSession(
&sessionLogDescriptor,
&sessionOptions,
&serverAddr,
&cred,
&teamedObjectStoreKey,
pCmdSessionHandle,
&teamMemberConnectionStatus);
//<
Source Exif Data:
File Type : PDF
File Type Extension : pdf
MIME Type : application/pdf
PDF Version : 1.5
Linearized : Yes
Author : Andrew Todd
Company : Hewlett-Packard
Content Type Id : 0x01010004616231E28E3D47B4E95EC59B0A1A1A
Create Date : 2017:01:18 11:03:53Z
Modify Date : 2017:01:18 11:04:22Z
Source Modified : D:20170118110331
Tag Doc Home : -139858972
Language : EN-GB
Tagged PDF : Yes
XMP Toolkit : Adobe XMP Core 5.4-c005 78.147326, 2012/08/23-13:03:03
Metadata Date : 2017:01:18 11:04:22Z
Creator Tool : Acrobat PDFMaker 11 for Word
Document ID : uuid:abf0a2c2-b5e1-4e62-9be0-7b46ede0ee52
Instance ID : uuid:e552bb62-a22a-4071-a448-7710aaeea0f3
Subject : 3
Format : application/pdf
Title :
Creator : Andrew Todd
Producer : Adobe PDF Library 11.0
Page Layout : OneColumn
Page Count : 125
EXIF Metadata provided by EXIF.tools