13 Replies Latest reply: Jul 11, 2012 9:49 AM by Jim Wilson RSS

Exporting Jobs from Test and importing to Production

David Newhook

Hi All,

 

I'm using Bladelogic to automate the deployment of Oracle Fusion Middleware.  Each component is a sequence of BLPackages and NSH Scripts stored in Depot Folders (e.g. Oracle Identity Management 11g).

 

I then create a Job Folder per environment with many jobs of type DeployJob and NSHScriptJob parameterised for the environment (e.g. OID11g_South & OID11g_North).

 

I'm having a problem exporting the Jobs from our Bladelogic Test environment to Production.  Both environments are running 8.0.10.1014.  I am exporting and importing each job one by one using the GUI.

 

The first export/import of a job from OID11g_South went fine on the target system.  The next export/import of a job from OID11g_North failed:

"An object named [Depot BLPackage] already exists in the folder [Oracle Identity Management 11g].  Please choose a different destination Group".

 

I tried exporting the same OID11g_South job excluding the Depot Objects (BLPackages or NSH Scripts).

 

I cannot import this Job into Production.  I'm faced with 2 issues during import:

  1. On importing the Job, I’m informed that ‘The following [Depot Objects] are needed by the imported objects but do not exist on this system.’  This message is the opposite of the problem I had exporting the job with Depot Objects!  I can see that the Depot objects do exist on the target system but I am forced to manually map each BLPackage and NSH Script to the matching Depot Object on the target system.  This message appears for jobs of type DeployJob and NSHScriptJob.
  2. Following the manual mapping, I get the error 'Failed to save Object' as shown below.

 

 

Clipboard01.jpg

 

Can anyone help please?

 

Regards,

 

David

  • 1. Exporting Jobs from Test and importing to Production
    Brad Akers

    David,

    1. Have you exported and imported all the depot objects as well?

    2. Are you able to verify that the packages don't exist with a permissions level, (i.e. been added with BLAdmins but you are logged on as OSEngr role)?

     

    Thanks

    Brad

  • 2. Exporting Jobs from Test and importing to Production
    Joe Piotrowski

    It's been a while since I've imported and exported jobs. But I remember running into a similar issue. It was resolved by exporting the job without dependencies. I could get the original job (with dependencies) to export/import OK. But any additional jobs exported/imported that referenced the same dependencies failed.

  • 3. Exporting Jobs from Test and importing to Production
    David Newhook

    Hi Brad,

     

    Thanks for your response.

     

    1. I have verified that the depot objects have been exported and imported to the target already.
    2. The packages are all exported/imported with a single role (permissions are the same on both test and production).

     

    I've tried importing the job using the command line and examining the mapping file produced from the export - no luck so far.  I haven't found anything that needs to be modified in the mapping file.

     

     

    I've got this deploy job which has a dependancy on a BLPackage named "0060 Create Domain".

     

    The BLPackage is freshly imported from the test environment.  If I rename the BLPackage, I get the following error on import of the Deploy Job:

    • Command execution failed.  Depot Object "0060 Create Domain" of type "BLPACKAGE" does not exist in "/blpackagefolder"

     

    If I rename the BLPackage to it's original name I get the following error on import of the Deploy Job:

    • Command execution failed.  Failed to save object. SPropertySetClass; Node Id = 1553910;modifiedByUserId=2006008 abstract=false deprecated=false dateModified=2012/05/03 18:01:15+0200 instanceTableName= blAclId=2015519 visible=true modifiedByRoleId=2005011 deleted=false modelObject=true createdByRoleId=2005011 createdByUserId=2006008 description= name=0060 Create Domain superTypeId=1025 builtIn=false dataTypeId=2024059 dateCreated=2012/05/03 18:01:15+0200 synchronize=true custom=false

     

    The only BLPackage mapping in the deploy job export is as follows:

     

        <blpackage_mapping>

            <source_blpackage_location>imported/1328266367365/blpackages/0060-Create-Domain-2000957.1</source_blpackage_location>

            <target_blpackage>

                <!--This is the name of the BlPackage on the importing system to use-->

                <blpackage_name>0060 Create Domain</blpackage_name>

                <!--This is the path to the group containing the BlPackage on the importing system to use-->

                <blpackage_group>/GA/GA-weloadm/Picasso UCM Install</blpackage_group>

            </target_blpackage>

        </blpackage_mapping>

     

    Looking at the appserver.log file reveals a contraint violation:

     

    Caused by: com.bladelogic.shared.db.PrimaryKeyConstraintViolationException: ORA-00001: unique constraint (BLADELOGIC.XPKPROPERTY_SET_CLASS) violated

     

    This constraint is on the PROPERTY_SET_CLASS table on the DATA_TYPE_ID column.

     

    I found the row corresponding to the DATA_TYPE_ID in the error message:

    Property Set Class Table
    DATA_TYPE_IDSUPER_TYPE_IDCREATED_BY_ROLE_IDCREATED_BY_USER_IDMODIFIED_BY_ROLE_IDMODIFIED_BY_USER_IDBL_ACL_IDNAMEDESCRIPTIONIS_ABSTRACTIS_BUILT_INIS_VISIBLEIS_DEPRECATEDDATE_CREATEDDATE_MODIFIEDINSTANCE_TABLE_NAMEIS_DELETEDIS_SYNCHRONIZEIS_MODEL_OBJECTIS_CUSTOM
    20240591025200501120060082005011200600820155190060 Create Domain 001030-Apr-1203-May-12 0110

     

    Trouble is, I'm not sure what this table is for!  The name of the row seems relevant as it's the same as my BLPackage.  Why is the import is trying to add a second row with the same data_type_id.  Do I need to export the deploy job without the properties?  I don't think that's possible or useful!  The property configuration of the deploy job is exactly what I'm looking to move from test to production.

     

    Thanks for any insight,

     

    David

  • 4. Exporting Jobs from Test and importing to Production
    Brad Akers

    David,

    Like Joe said sometimes if you export with dependinces it can cause this error. Try to export with no dependiences and reimport. If this doesn't work can you send the appserver.log file from both servers.

     

    Thanks

    Brad

  • 5. Exporting Jobs from Test and importing to Production
    Joe Piotrowski

    I've also had issues where jobs referencing custom properties or instances failed to export/import as well. I had to strip those and recreate them in the new environment to get it to work.

  • 6. Exporting Jobs from Test and importing to Production
    Brad Akers

    Also if you are refrenceing any custom extended objects this could cause a problem.

  • 7. Exporting Jobs from Test and importing to Production
    David Newhook

    I've tried the export using 3 methods to remove the dependencies:

     

    1. Via the gui and checking the boxes.
    2. Via the command line: blcli ImportExport exportObjectWithoutBlPackages 30 $JOB_OBJECT_KEY "//${TARGET_HOST}$OUTPUT_DIR/${COMPONENT}/${JOB_OBJECT}"
    3. Via the command line: blcli ImportExport exportObject 40 $JOB_OBJECT_KEY "//${TARGET_HOST}$OUTPUT_DIR/${COMPONENT}/${JOB_OBJECT}" false false false true true false false false false true false

     

     

    I got the boolean values from the Documentation - I think I've captured all that is suitable to export a DeployJob.

     

    DeployJob
    excludeDiscoveryJobsbooleanTrue to exclude Component Discovery Jobs from the exported object, false to include them.false
    excludeComplianceJobsbooleanTrue to exclude Compliance Jobs from the exported object, false to include them.false
    excludeSoftwareDeployJobsbooleanTrue to exclude Software Deploy Jobs from the exported object, false to include them.false
    excludeDepotSoftwarebooleanTrue to exclude depot software objects from the exported object, false to include them.true
    excludeBlPackagesbooleanTrue to exclude BLPackages from the exported object, false to include them.true
    convertSoftlinksbooleanTrue to convert BLPackage soft links to hard links, false to preserve the soft links.false
    includeGrammarsbooleanTrue to include referenced grammar files, false to exclude them. Note that setting this argument to false requires grammar file mapping on the importing system.false
    excludeTemplatesbooleanTrue to exclude component templates, false to include them.false
    excludeNSHScriptsbooleanTrue to exclude NSH scripts, false to include them.false
    excludeDepotFilesbooleanTrue to exclude depot files, false to include them.true
    excludeNSHScriptJobsbooleanTrue to exclude NSH Script Jobs, false to include them.false

     

    Unfortunately, the dependency seems to be on the property set.  My Jobs reference different property class instances.

     

    I'll try a different approach tomorrow - adding all Jobs from the 2 Groups (OID11g_South & OID11g_North) to a batch job and exporting that.  I've got a feeling that will work fine somehow.

     

    Thanks for your support.

     

    David

  • 8. Exporting Jobs from Test and importing to Production
    Joe Piotrowski

    "My Jobs reference different property class instances." I am willing to bet that is your root issue. When you can verify that please mark the thread as Answered to help users that may run across this error in the future.

  • 9. Exporting Jobs from Test and importing to Production
    David Newhook

    Hi there,

     

    I managed to recreate the problem with a much simpler use-case.  I first created a simple BLPackage which includes only an external command (echo "hello world).  The BLPackage has a local property of type 'Property Class' that references a custom property class.  Default value is a property instance that is syncronised between Production and Test Bladelogic Environments.  The property is set to 'Editable'.  The BLPackage is exported from the source system and imported to the target system without issue.

     

    On Source System:

    1. Export DeployJob 1 (exluding BLPackages) based on BLPackage with no Overridden Parameter Value for the local property.
    2. Export DeployJob 2 (excluding BLPackages) based on BLPackage where the local property has an Overridden Parameter Value of a different instance than DeployJob 1 (but also syncronised).

     

    On Target System

    1. Import DeployJob 1 - no issue
    2. Import DeployJob 2 - 'Failed to save object'

     

     

    I also tried deleting DeployJob 1 on the target and trying to import DeployJob 2 first.  It doesn't make a difference.  If the DeployJob references a property instance other than the default referenced in the BLPackage, I can't import it.

     

    Joe, I'm not sure what you mean when you say this is the root issue.  Is this not supported?

  • 10. Exporting Jobs from Test and importing to Production
    Rohit Nayyar

    Seems like you have hit a *bug* within the product.

    As there is no way to exclude Property Set Instance and Properties while exporting

    The second import in your case is trying to re-create PSI/Custom Property which is already in the system (created by 1st successful import), this is also throwing up a Primary Key violation from the DB, and the object fails to save!

    Clearly a bug

    *No matter what you do, you should not get this DB exception"

    And I dont think the answer to this is that "this is not supported".

    Raise a support call with BMC support.

  • 11. Exporting Jobs from Test and importing to Production
    David Newhook

    Thanks for your advice.  I will get this raised with BMC Support.

  • 12. Exporting Jobs from Test and importing to Production
    Joe Piotrowski

    When I ran into the issue, I remember thinking that the property class instantiation existed in the old environment, against a specific server(s) and not the new, so I assumed that it just wasn't possible to export/import that type of value. But perhaps it is a bug as Rohit is stating. Once you clarify with BMC Support, would you mind updating this thread accordingly?

  • 13. Exporting Jobs from Test and importing to Production
    Jim Wilson

    Hi David,

     

    Please update the community with the results of your contact with Support.

     

    Thanks & Regards,

    Jim