Solved

Deploy VMware Access Node using API

  • 13 January 2023
  • 7 replies
  • 222 views

Userlevel 4
Badge +13

Hi

I’m trying to deploy Acess Node for VMware using API but can’t seem to get this to work.

I’m using this: https://api.commvault.com/#f9950083-6ef5-487d-9b32-d332b843b64c

with powershell from Commserve computer. I was able to successfully aquire QSDK Token, but when I try to deploy AN I get error:

Here is TaskManager.log fragment:

9456  1     01/13 16:09:11 ### ### ControlTaskMgr - Request received for [Tag_CreateTaskReq], userId [5], commcellId [2], sequenceNumber [1], fromUpgrade [False], endUser [False]
9456 1 01/13 16:09:11 ### ### ControlTaskMgr - Input xml <TMMsg_CreateTaskReq>
<processinginstructioninfo>
<locale _type_="66" localeId="0" />
<formatFlags skipIdToNameConversion="1" />
<user userName="" userId="5" _type_="13" />
</processinginstructioninfo>
<taskInfo>
<subTasks>
<subTask subTaskType="1" operationType="4038" />
<options>
<adminOpts>
<vmProvisioningOption operationType="59">
<virtualMachineOption accessNodeDeploymentType="0">
<password userName="root" />
<vmEntity vmName="XXXXXXXXX-API-Deploy1" _type_="88" />
<configValues value="False" key="beAutomaticOSUpdates" />
<configValues value="True" key="aaUseDHCP" />
<configValues value="XXXXXXXXX-API-Deploy1" key="baClientName" />
<configValues value="XXXXXXXXX" key="bbClientHostname" />
<configValues value="XXXXXXXXX" key="cbCSHostname" />
<configValues value="XXXXXXXXX" key="caCSName" />
<configValues value="" key="bdClientGroup" />
<vmInfo>
<vmLocation hostName="esxi01.XXXXXXXXX" dataCenterName="XXXXXXXXX" inventoryPath="/XXXXXXXXX/vm/XXXXXXXXX" resourcePoolPath="" clusterName="" vCenter="vcenter.XXXXXXXXX">
<datastore name="LUN02" />
</vmLocation>
<vm vmName="XXXXXXXXX-API-Deploy1" _type_="88" />
<advancedProperties>
<networkCards networkName="XXXXXXXXX" />
</advancedProperties>
<hardDisks>
<hardDisk diskType="1" />
</hardDisks>
</vmInfo>
</virtualMachineOption>
</vmProvisioningOption>
</adminOpts>
</options>
</subTasks>
</taskInfo>
</TMMsg_CreateTaskReq>
9456 1 01/13 16:09:11 ### ### ControlTaskMgr - ERROR: ErrorCode[587204001], ErrorString [Failed to create task. Could not insert task into data base [Object reference not set to an instance of an object.]], Message[Received request type Tag_CreateTaskReq]
9456 1 01/13 16:09:11 ### ### TaskMgr.createTask - ErrorString [Failed to create task. Input XML is [<TMMsg_CreateTaskReq>
<processinginstructioninfo>
<locale _type_="66" localeId="0" />
<formatFlags skipIdToNameConversion="1" />
<user userName="" userId="5" _type_="13" />
</processinginstructioninfo>
<taskInfo>
<subTasks>
<subTask subTaskType="1" operationType="4038" />
<options>
<adminOpts>
<vmProvisioningOption operationType="59">
<virtualMachineOption accessNodeDeploymentType="0">
<password userName="root" />
<vmEntity vmName="XXXXXXXXX-API-Deploy1" _type_="88" />
<configValues value="False" key="beAutomaticOSUpdates" />
<configValues value="True" key="aaUseDHCP" />
<configValues value="XXXXXXXXX-API-Deploy1" key="baClientName" />
<configValues value="XXXXXXXXX" key="bbClientHostname" />
<configValues value="XXXXXXXXX" key="cbCSHostname" />
<configValues value="XXXXXXXXX" key="caCSName" />
<configValues value="" key="bdClientGroup" />
<vmInfo>
<vmLocation hostName="esxi01.XXXXXXXXX" dataCenterName="XXXXXXXXX" inventoryPath="/XXXXXXXXX/vm/XXXXXXXXX" resourcePoolPath="" clusterName="" vCenter="vcenter.XXXXXXXXX">
<datastore name="LUN02" />
</vmLocation>
<vm vmName="XXXXXXXXX-API-Deploy1" _type_="88" />
<advancedProperties>
<networkCards networkName="XXXXXXXXX" />
</advancedProperties>
<hardDisks>
<hardDisk diskType="1" />
</hardDisks>
</vmInfo>
</virtualMachineOption>
</vmProvisioningOption>
</adminOpts>
</options>
</subTasks>
</taskInfo>
</TMMsg_CreateTaskReq>]]
9456 1 01/13 16:09:11 ### ### TaskMgr.createTask - Exception [System.NullReferenceException]. ErrorString [ ...
Object reference not set to an instance of an object.]
9456 1 01/13 16:09:11 ### ### TaskMgr.createTask - Exception [System.NullReferenceException] stack trace
at EvTaskMgrManaged.TaskMgr._createTask()

 

I’ve done the same from Command Center and tried to compare values passed through $body but the only difference I have found that api docs states 

`"subTaskType`": `"ADMIN`"

while in log from Command Center initiated job there is

<subTask subTaskType="1" operationType="4038" />

 

I have tried both but neither seem to work.

 

I don’t have much experience with API, so maybe I am missing something obvious.

Any ideas what else can I try?

icon

Best answer by Robert Horowski 27 January 2023, 16:11

View original

7 replies

Userlevel 4
Badge +13

Hi @Damian Andre 

Support came back to me with fixed body file. It still didn’t work from postman, but when I imported it into powershell I was finally able to deploy Access Node. It look like there is a part 

which is missing from documentation # https://api.commvault.com/#f9950083-6ef5-487d-9b32-d332b843b64c

I hope docs will be updated soon to reflect that. Have a great weekend!

Cheers!

Userlevel 7
Badge +23

Hi @Damian Andre 

I’ve opened a case for this. Support has tested this on their end using Postman and it should work in general. We tried to run this from Postman in my env, but it returns an error that body is invalid and we were not able to find what is wrong with it on the session. Still waiting for the support engineer to come back to me. I will update once we crack this.

Hmm… interesting! Ok lets see how we go - appreciate the update.

Userlevel 4
Badge +13

Hi @Damian Andre 

I’ve opened a case for this. Support has tested this on their end using Postman and it should work in general. We tried to run this from Postman in my env, but it returns an error that body is invalid and we were not able to find what is wrong with it on the session. Still waiting for the support engineer to come back to me. I will update once we crack this.

Userlevel 7
Badge +23

@Robert Horowski - any luck on this one?

webserver.log may have more detailed information - as well as taskmanager.log

Badge +1

Hello

Userlevel 4
Badge +13

Thanks @Orazan I will open a ticket as advised. 

Userlevel 6
Badge +15

@Robert Horowski Good morning.  I apologize for the delay in response.  I reviewed your post with one of our Server team expers and they recommended opening a case with our Server focus group to take a look at this more in depth.  This very well may need to be escalated to Development.

Reply