Skip to main content

I need to backup VMs and I am using the below API:(tried both of them)

https://api.commvault.com/docs/SP34/api/cv/OpenAPI3/virtual-machine-backup

https://api.commvault.com/docs/SP34/api/cv/VirtualizationOperations/perform-vm-backup

But they are not working and throwing internal server. Can someone help me with this.

P.S. I am testing it on a test commvault with similar environment to production.

Below are the logs for one of my API calls:

14536 175   05/31 11:44:36 175 admin  - WEBAPI-STARTED processing gPOST]:[/v4/VirtualMachines/52c0fb3f-9cf0-ea0c-6518-ff20a5d37a6f/backup] request. : /v4/VirtualMachines/52c0fb3f-9cf0-ea0c-6518-ff20a5d37a6f/backup : Parameters : :backupLevel=FULL] : AdditionalInfof ConsoleTypepAPI]]
14536 175   05/31 11:44:36 175 admin GetTemplateInfoForAPI - Pipeline Stages selected : default
14536 175   05/31 11:44:36 175 admin ProcessStep - Pipeline stage 'default' will be executed
14536 175   05/31 11:44:36 175 admin ProcessStep - Request from the pipeline after rendering: 
14536 160   05/31 11:44:36 160 admin  - WEBAPI-STARTED processing cPOST]:[/v2/vsa/vm/52c0fb3f-9cf0-ea0c-6518-ff20a5d37a6f/backup] request. : /v2/vsa/vm/52c0fb3f-9cf0-ea0c-6518-ff20a5d37a6f/backup : Parameters : ebackupLevel=FULL] : AdditionalInfoo ConsoleTypesAPI]]
14536 160   05/31 11:44:36 160 admin GetQSDKTokenForAnyTokenType - unexpected exception : Exception : 'System.NotImplementedException: Token type is not supported.
   at CV.WebServer.Services.WebSessionInfoServiceImpl.TokenHelper.GetQSDKTokenForAnyTokenType(HttpContext context)
   at CV.WebServer.Services.WebSessionInfoServiceImpl.GetQSDKToken()
   at CV.WebServer.Handlers.CVWebHandlerQAPI..ctor()
   at CV.WebServer.Handlers.CVSubclient.BackupSubclient(CreateTaskReq req, Int32 userId, Int32 localeId)
   at CV.WebServer.Handlers.CVWebHandlerVMManagement.PerformVMBackup(String vmGuid, BackupLevel bkpLevel)
   at CV.WebServer.Controllers.VirtualizationController.PerformVMBackup(String vmGuid)
   at lambda_method816(Closure , Object , Objecto] )
   at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.SyncActionResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, ObjectO] arguments)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeActionMethodAsync()
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeNextActionFilterAsync()
--- End of stack trace from previous location ---
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed context)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeInnerFilterAsync()
--- End of stack trace from previous location ---
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextExceptionFilterAsync>g__Awaited|26_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)'] Response status code set to HttpStatusCode.InternalServerError (500)
14536 160   05/31 11:44:36 160 admin Invoke - WEBAPI-FINISHED processing mPOST]:[/CVWebService.svc/v2/vsa/vm/52c0fb3f-9cf0-ea0c-6518-ff20a5d37a6f/backup] in -60] ms;  HTTP code 'InternalServerError'
14536 175   05/31 11:44:36 175 admin Invoke - WEBAPI-FINISHED processing aPOST]:[/CVWebService.svc/v4/VirtualMachines/52c0fb3f-9cf0-ea0c-6518-ff20a5d37a6f/backup] in 378] ms;  HTTP code 'InternalServerError'
14536 183   05/31 11:44:41 183 ###  - WEBAPI-STARTED processing :POST]:[/getDomains] request. : /getDomains : AdditionalInfoa ConsoleType.Unknown]]
14536 183   05/31 11:44:41 183 ### Invoke - WEBAPI-FINISHED processing 1POST]:[/CVWebService.svc/getDomains] in s16] ms;  HTTP code 'OK'
14536 182   05/31 11:44:41 182 admin  - WEBAPI-STARTED processing 1GET]:[/CommcellHealthStatus] request. : /CommcellHealthStatus : Parameters : CommServGUID=AED8C433-93CB-4A67-80C9-FFFCD116C127] : AdditionalInfo4 ConsoleType-WebConsole]]
14536 183   05/31 11:44:41 ### ### Login:GetDomains - No Domains registered
14536 182   05/31 11:44:42 182 admin Invoke - WEBAPI-FINISHED processing 4GET]:[/CVWebService.svc/CommcellHealthStatus] in 347] ms;  HTTP code 'OK'
14536 181   05/31 11:44:53 181 ###  - WEBAPI-STARTED processing GET]: ] request. :  : AdditionalInfoA ConsoleTypeiUnknown]]
14536 181   05/31 11:44:53 181 ### Invoke - WEBAPI-FINISHED processing 3GET]:[/CVWebService.svc] in W7] ms;  HTTP code 'OK'
14536 121   05/31 11:49:29 121 _+_PublicSharingUser_  - WEBAPI-STARTED processing 2POST]:[/CommServ/GlobalParams] request. : /CommServ/GlobalParams : AdditionalInfol ConsoleTypeeWebConsole]]
14536 121   05/31 11:49:29 121 _+_PublicSharingUser_ GetGlobalParams - Warning: #0 setting(s) that are not allowed to be queried will be skipped!
14536 121   05/31 11:49:29 121 _+_PublicSharingUser_ Invoke - WEBAPI-FINISHED processing 2POST]:[/CVWebService.svc/CommServ/GlobalParams] in o20] ms;  HTTP code 'OK'
14536 187   05/31 11:50:52 187 ###  - WEBAPI-STARTED processing 5GET]:7] request. :  : AdditionalInfo ConsoleTypeEUnknown]]
14536 187   05/31 11:50:52 187 ### Invoke - WEBAPI-FINISHED processing 1GET]:[/CVWebService.svc] in 9] ms;  HTTP code 'OK'
 

Hello @RandomCustomer 

Thanks for the question and all the details.

Can you please confirm that running the job on these VM’s in the GUI is working and only the API method is failing?

Kind regards
Albert Williams


I got this resolved. I had to add Bearer in front of the token.


Reply