How to import a xml file from the local drive on the Comserv into the workflow from a Q command

Last post 03-14-2019, 10:33 AM by zhoubo09. 11 replies.
Sort Posts: Previous Next
  • How to import a xml file from the local drive on the Comserv into the workflow from a Q command
    Posted: 03-07-2019, 8:23 AM

    This is my Q command for running the backup summary from a saved script as xml. If and when I can get the xml imported into the workflow via TexToResultSet. Then I'll use the XPathMultiQuery to get my xml data. My issue is the workflow isn't seeing the xml data on the local Comserv C drive. I'm running the workflow from the same comserv where the xml resides.

    <?xml version="1.0" encoding="utf-8" standalone="no"?>
    <TMMsg_CreateTaskReq>
    <processinginstructioninfo />
    <taskInfo>
    <task>
    <taskFlags>
    <disabled>false</disabled>
    </taskFlags>
    <taskType>IMMEDIATE</taskType>
    <initiatedFrom>COMMANDLINE</initiatedFrom>
    </task>
    <appGroup />
    <subTasks>
    <subTask>
    <subTaskName></subTaskName>
    <subTaskType>ADMIN</subTaskType>
    <operationType>REPORT</operationType>
    </subTask>
    <options>
    <adminOpts>
    <reportOption>
    <commonOpt>
    <reportType>BACKUP_HISTORY_REPORT</reportType>
    <outputFormat>
    <outputType>XML</outputType>
    </outputFormat>
    <savedTo>
    <location>C:\Program Files\CommVault\Simpana\Reports</location>
    <reportSavedToClient>
    <clientName>Hawk5</clientName>
    <hostName>Hawk5.rjf.com</hostName>
    </reportSavedToClient>
    <ftpDetails />
    </savedTo>
    <locale>
    <localeName>en-us</localeName>
    <language>UnitedStates</language>
    <country>English</country>
    <LCID>1033</LCID>
    <locale>en-us</locale>
    <displayString>English-UnitedStates</displayString>
    </locale>
    <onCS>false</onCS>
    <overrideDateTimeFormat>NONE</overrideDateTimeFormat>
    <dateFormat>mm/dd/yyyy</dateFormat>
    <timeFormat>hh:mm:ss am/pm</timeFormat>
    <reportCustomName>BkUpRpt</reportCustomName>
    </commonOpt>
    <computerSelectionList>
    <includeAll>false</includeAll>
    <clientList>
    <clientName>xpath:{/workflow/variables/VMname}</clientName>
    </clientList>
    </computerSelectionList>
    <agentList>
    <flags>
    <include>true</include>
    </flags>
    </agentList>
    <mediaAgentList>
    <flags>
    <include>true</include>
    </flags>
    </mediaAgentList>
    <storagePolicyCopyList>
    <allCopies>true</allCopies>
    </storagePolicyCopyList>
    <timeRangeOption>
    <type>RELATIVE_HOURS</type>
    <toTimeValue>24</toTimeValue>
    <TimeZoneName>(UTC-05:00) Eastern Time (US &amp; Canada)</TimeZoneName>
    </timeRangeOption>
    <jobSummaryReport>
    <jobOptions>
    <backupTypes>
    <full>true</full>
    </backupTypes>
    <jobStatus>
    <completed>true</completed>
    <failed>true</failed>
    <completedWithError>true</completedWithError>
    <active>false</active>
    <completedWithWarnings>false</completedWithWarnings>
    <committed>false</committed>
    </jobStatus>
    <sizeUnit>NONE</sizeUnit>
    <retentionType>
    <retentionAll>false</retentionAll>
    <basicRetention>true</basicRetention>
    <extendedRetention>false</extendedRetention>
    <manualRetention>false</manualRetention>
    </retentionType>
    <isCommserveTimeZone>true</isCommserveTimeZone>
    </jobOptions>
    <rptSelections>
    <failureReason>false</failureReason>
    <includeProtectedVMs>true</includeProtectedVMs>
    <numberOfHours>0</numberOfHours>
    </rptSelections>
    <groupBy>CLIENT</groupBy>
    </jobSummaryReport>
    <includeClientGroup>false</includeClientGroup>
    </reportOption>
    </adminOpts>
    <commonOpts />
    </options>
    <subTaskOperation>OVERWRITE</subTaskOperation>
    </subTasks>
    </taskInfo>
    </TMMsg_CreateTaskReq>

    Charles Lavender
  • Re: How to import a xml file from the local drive on the Comserv into the workflow from a Q command
    Posted: 03-07-2019, 1:54 PM

    Is the motive here to parse the API output and read it as a resultset.

    In which case the API above should be executed from the workflow using Qcommands->Operation->Execute activity 

    And then parse the output to fetch the resultset 

     

  • Re: How to import a xml file from the local drive on the Comserv into the workflow from a Q command
    Posted: 03-07-2019, 2:16 PM

    You are correct and I used the API Q command to get the file. However I can only save it to the C drive of the Comserv. When I put the location of the XPath to the workflow it doesn't see that location so I can't parse it.

    It doesn't see this path-  xpath:{/workflow/variables/XML_Cache}

    It sees this path - C:\Program Files\CommVault\Simpana\Reports

    The above information I hard coded into the xml file from above which was generated from the save script option in the CommCell from a backup job summary report.


    Charles Lavender
  • Re: How to import a xml file from the local drive on the Comserv into the workflow from a Q command
    Posted: 03-07-2019, 6:26 PM

    Attaching a sample JobSummary Workflow.

    When you execute this workflow, a workflow job is generated, which itself executed the job summary task and the subsequent report is generated for a client selected as input in the workflow. 

    All HTML reports by default are generated at the location 

    C:\Program Files\CommVault\Simpana\Reports

     

    Is there specific reason to execute the API from Workflow. 

    You could also schedule the Job Summary Report from Commcell Console GUI to execute at specific times for selected clients. 

     

    Attachment: JobSummary.zip
  • Re: How to import a xml file from the local drive on the Comserv into the workflow from a Q command
    Posted: 03-07-2019, 6:49 PM

    I'm creating workflows for decommissioning servers which we decommission about 200 servers a month which is a lot of manul tasks. Our company policy is that before a server can be decommissioned it needs to have a good full backup. This report needs to be generated at the time of the decommissioning to determine if the server can be decommissioned. Also, this process is setup to run with no user intervention. I have the process completed with the exception of checking for the backup. I thought about just running a backup before the decomissioning but these are VADP backups which are setup to run as a policy of 200 VMs at a time in sequential order. So I can't run 200 backups to decommission one server. Also with our company policy we can't run backups during production hours. This decommissioning will be a 24 /7 process. With this report I can parse for the job id and a successful completion of the running of the job from the xml output from the job without the report, but I need additional information from the report such as VM is power on, time of the last full backup and if any errors and what was the error. My issue is I can't get the TextToResultSet to parse the data as a string from the reprt that is saved as a XML file. I tried to save it as a text file but report is not readable.


    Charles Lavender
  • Re: How to import a xml file from the local drive on the Comserv into the workflow from a Q command
    Posted: 03-07-2019, 10:50 PM

    I would suggest you to save it as a XML formatted file, and read file content from report location.

    And use  XML DOM parsers to get the required data fields from Script activity.

    OR 

    Select the first XmlNode that matches the XPath expression. For example:

    where requestXML would be the report o/p in XML format

    XML inXML = xpath:{/workflow/variables/requestXML};
    XML reqXml = inXML.selectSingleNode("/requestXML/*");
    String objectOpType = reqXml.selectSingleNode("string(//./././subTask/@operationType)");
    String subTaskType = reqXml.selectSingleNode("string(//./././subTask/@subTaskType)");
  • Re: How to import a xml file from the local drive on the Comserv into the workflow from a Q command
    Posted: 03-07-2019, 10:50 PM

    -

  • Re: How to import a xml file from the local drive on the Comserv into the workflow from a Q command
    Posted: 03-08-2019, 11:05 AM

    I think I have found a better approach to get this job report. I'm using the Q commands Operation report. I setup a Comserv SQL query to get the VMname, Client id, Backupset,and subclient. I was able to populate all the requested data via variables. My only issue is for the iDataAgent it will not accept Q_VIRTUAL_SERVER as the iDataAgent. What can I use to satisfy this requirement?


    Charles Lavender
  • Re: How to import a xml file from the local drive on the Comserv into the workflow from a Q command
    Posted: 03-08-2019, 11:24 AM

    Which activity are you using for selecting iDataAgent and what's the SP version on Commcell?

  • Re: How to import a xml file from the local drive on the Comserv into the workflow from a Q command
    Posted: 03-08-2019, 1:06 PM

    I'm at v11 SP14. I'm using the Q Commands Operation report.


    Charles Lavender
  • Re: How to import a xml file from the local drive on the Comserv into the workflow from a Q command
    Posted: 03-08-2019, 4:28 PM

    Yes as Virtual Server is also not supported to be selected from Job Summary Report or from qoperation report.[Which is executed in backend by workflow activity]

     

    You could always select "Show Virtual MAchines" option in the Commcell GUI Control Panel -> User Preferences section.

    And then execute workflow without the Agent option on the specific VM you are looking to get the job summary report for. 

  • Re: How to import a xml file from the local drive on the Comserv into the workflow from a Q command
    Posted: 03-14-2019, 10:33 AM
The content of the forums, threads and posts reflects the thoughts and opinions of each author, and does not represent the thoughts, opinions, plans or strategies of Commvault Systems, Inc. ("Commvault") and Commvault undertakes no obligation to update, correct or modify any statements made in this forum. Any and all third party links, statements, comments, or feedback posted to, or otherwise provided by this forum, thread or post are not affiliated with, nor endorsed by, Commvault.
Commvault, Commvault and logo, the “CV” logo, Commvault Systems, Solving Forward, SIM, Singular Information Management, Simpana, Commvault Galaxy, Unified Data Management, QiNetix, Quick Recovery, QR, CommNet, GridStor, Vault Tracker, InnerVault, QuickSnap, QSnap, Recovery Director, CommServe, CommCell, SnapProtect, ROMS, and CommValue, are trademarks or registered trademarks of Commvault Systems, Inc. All other third party brands, products, service names, trademarks, or registered service marks are the property of and used to identify the products or services of their respective owners. All specifications are subject to change without notice.
Close
Copyright © 2019 Commvault | All Rights Reserved. | Legal | Privacy Policy