For VMs using a custom BIOS, the custom BIOS file can be recovered using the file upload OpenAPI provided by SCP or HCI. Two recovery methods are supported:
Recover the custom BIOS file when creating a VM. To use this approach, the BIOS file must first be uploaded to the iso directory of the designated storage. Then, in the hardware_option parameters of the VM creation request, set bios.bios_type to CUSTOM to indicate that a custom BIOS is being used, and specify the BIOS file path using the format storageId:/storageId/path/of/file (e.g. a39b861a_vs_vol_rep3:/a39b861a_vs_vol_rep3/iso/bios.bin, where a39b861a_vs_vol_rep3 is the storage ID and bios.bin is the custom BIOS file name). This allows the newly created VM to boot using the specified custom BIOS file.
Overwrite the custom BIOS file of an existing VM. To use this approach, the BIOS file needs to be uploaded directly to the target VM's directory. Therefore, the target VM must already exist and be configured to use a custom BIOS file. Additionally, the file name specified in the file upload OpenAPI request must exactly match the current BIOS file name of the VM.
When using the file upload OpenAPI to restore the custom BIOS file, please note the following:
When uploading the custom BIOS file to the iso directory of the designated storage, there is no need to specify the VM ID parameter (SCP: server_id, HCI: vmID) in the API request. The BIOS file will then be uploaded directly to the iso directory of the target storage.
When uploading the custom BIOS file to the directory of a specific VM, the VM ID parameter must be specified. The BIOS file will then be uploaded to the corresponding VM directory, overwriting the existing BIOS file.
The upload API uses the POST method and requires the file to be uploaded in form-data format (Content-Type: multipart/form-data). Additional parameters should be passed as query parameters.