Getting Support Log Bundle using REST API
Starting from vSphere 7U1 we have got a new tool to generate and download a support log bundle from vCenter Server. It is REST API call used to achieve these tasks. It broadens an already wide range of methods of gathering vm-support log bundle. It has several interesting features.
First, it works even if the vCSA service is offline, whereas a vCSA management interface should be up and running.
Second, once started it generates a support bundle and stores it on vCSA disk. A downloaded bundle is deleted after 30 minutes. As you know, even in a small vSphere environment downloading a log bundle could be time consuming, therefor, if a generated bundle download task is in progress, the bundle deletion will be postponed for 30 minutes.
To be able to use this new method a user authenticated in SSO must be a member of a new SSO group – SystemConfiguration.SupportUsers. Users belonging to this group are entitled only to call support bundle REST API. They don’t have any other privileges to the environment. SSO Administrator role is a member of this group by default.
Now, let’s play with the API calls.
To enumerate every component which is gathered by support bundle REST API, you can use the following GET command:
To generate a bundle you can use this POST statement:
This statement takes a few parameters:
- Description – A text description of a the started task
- Components (optional) – You can provide a list of previously listed components. If you leave this parameter empty, then logs from all components will be gathered.
- Partition (optional) – You can define a place where generated log bundle will be stored, for example /storage/core. If you leave it blank, a default storage location (/storage/log) will be used.
This statement will return a task ID. You can use this task ID to get the information about a status of a task.
To return the status of a task you have started, issue this command providing a task ID at the end:
If you need more detailed information, use this command to return the complete information about the generation task:
You will get all the information (description, status, generation time, expiration time, bundle size) including URL, which you can use to download the generated support bundle.
If the support bundle REST API fails, you will be informed with an error message providing information about a failure reason.
I recommend using Postman to issue these commands because you can prepare an Environment, a Collection, named for example vCSA Support Bundle where you can store the commands above mentioned. You can use curl as well, if it’s your favourite multi-tool.
One thought on “Getting Support Log Bundle using REST API”
does vcenter7 support auditing of events and task occurred through rest api?
any referrable docs from vcenter