Setting source.configTemplate in the CLI or API Fails With "The provided string is not a valid object reference" (KBA4511)
KBA
KBA# 4511Issue
When attempting to add or change VDB Configuration Template via CLI, the following error is encountered:
source.configTemplate The provided string "VDB_TEMPLATE" is not a valid object reference.
This behavior occurs due to an issue introduced in 5.2.0.0, and API 1.9.0, where the source.ConfigTemplate requires the template reference identifier rather than the config template name.
The behavior is tracked by DLPX-58105, and will be fixed in a future release of Delphix. The Release Notes will be updated to reflect when this issue is fixed.
Applicable Delphix Versions
- Click here to view the versions of the Delphix engine to which this article applies
-
Major Release All Sub Releases 6.0 6.0.0.0, 6.0.1.0, 6.0.1.1, 6.0.2.0 5.3
5.3.0.0, 5.3.0.1, 5.3.0.2, 5.3.0.3, 5.3.1.0, 5.3.1.1, 5.3.1.2, 5.3.2.0, 5.3.3.0, 5.3.3.1, 5.3.4.0, 5.3.5.0 5.3.6.0, 5.3.7.0, 5.3.7.1, 5.3.8.0, 5.3.8.1, 5.3.9.0 5.2
5.2.2.0, 5.2.2.1, 5.2.3.0, 5.2.4.0, 5.2.5.0, 5.2.5.1, 5.2.6.0, 5.2.6.1
Resolution: Find Reference Via CLI
In the example below, the template "oracle" is selected to locate the reference "DATABASE_TEMPLATE-2"
sean6010.dcol1> /database template sean6010.dcol1 database template> select oracle sean6010.dcol1 database template 'oracle'> ls Properties type: DatabaseTemplate name: oracle description: (unset) parameters: MEMORY_TARGET: 100M PGA_TARGET: 100M reference: DATABASE_TEMPLATE-2 sourceType: OracleVirtualSource
Once the reference is located, it can be used in VDB configuration. The following example updates the template for an existing VDB; the same configTemplate parameter can also be used in VDB provision workflow:
sean6010.dcol1 source> select VDBOMSRAF5830_950 sean6010.dcol1 source 'VDBOMSRAF5830_950'> update sean6010.dcol1 source 'VDBOMSRAF5830_950' update *> set configTemplate=DATABASE_TEMPLATE-2 sean6010.dcol1 source 'VDBOMSRAF5830_950' update *> commit
Resolution: Find Reference Via GUI
The GUI can be used to locate the VDB template reference by navigating to the VDB Configuration Template (Manage - VDB Config Templates). When the Template is selected in the left-hand navigation pane, the reference is indicated in the browser address bar:
The same CLI configuration method can then be used to set the configTemplate parameter.
Resolution: Set API Version for API or CLI Session
As the behavior was changed in API version 1.9.0, setting the CLI or API session version to 1.8.2 or lower will restore the previous behavior, and using the VDB Template name will work as expected.
In the following example, the same VDB and Config Template are used, but setting the template name is now successful:
sean6010.dcol1> version 1.8.2 sean6010.dcol1> /source sean6010.dcol1 source> select VDBOMSRAF5830_950 sean6010.dcol1 source 'VDBOMSRAF5830_950'> update sean6010.dcol1 source 'VDBOMSRAF5830_950' update *> set configTemplate=oracle sean6010.dcol1 source 'VDBOMSRAF5830_950' update *> commit sean6010.dcol1 source 'VDBOMSRAF5830_950'>
Delphix API instructions guide users to explicitly set the API version when establishing the session; the example below explicitly sets the version to 1.8.2
curl -s -X POST -k --data @- http://<engine name>/resources/json/delphix/session \ -c cookies$$.txt -H "Content-Type: application/json" <<EOF { "type": "APISession", "version": { "type": "APIVersion", "major": 1, "minor": 8, "micro": 2 } } EOF