Skip to content

Update proper error msg and status when download template/ISO fails due to invalid file format #4127

Description

@sureshanaparti

Description

The template download fails immediately with download state: DOWNLOAD_ERROR and error msg: Steam closed, for templates with invalid file format. The proper error message has to be reported when the download template/ISO fails due to invalid file format. The template status & download state should be set accordingly so that the SSVM never tries to re-download the template.

The file format is validated in SSVM using the output of cmd: "file | cut -d: -f2", after downloading atleast 1MB of data.

ISSUE TYPE
  • Improvement Request
COMPONENT NAME
Template, SSVM
CLOUDSTACK VERSION
4.13.0
CONFIGURATION
OS / ENVIRONMENT
SUMMARY

The Http template downloader in SSVM is aborting the connection immediately for the templates with invalid file format, and the template download fails with error msg: Stream closed as shown in below logs. The proper error message has to be reported when the download template/ISO fails due to invalid file format. Also, update download state & status of the template so that the SSVM never tries to re-download the template. Handle any cleanups if required.

The file format is validated in SSVM using the output of cmd: "file | cut -d: -f2", after downloading atleast 1MB of data.

logs:

Jun  3 07:17:22 s-2-VM _run.sh[1312]: 07:17:22,750  INFO HttpTemplateDownloader:207 - Starting download from http://***/****.ova to /mnt/SecStorage/802dfb3b-f7ef-3aec-9f46-c3dc12358ac8/template/tmpl/2/210/dnld982911992150124927tmp_ remoteSize=17536495476 , max size=53687091200
Jun  3 07:17:23 s-2-VM _run.sh[1312]: 07:17:23,372  INFO DownloadManagerImpl:270 - Download Completion for jobId: 0a4b329e-7698-4878-9d7d-0ea27c9796bd, status=UNRECOVERABLE_ERROR
Jun  3 07:17:23 s-2-VM _run.sh[1312]: 07:17:23,372  INFO DownloadManagerImpl:271 - local: /mnt/SecStorage/802dfb3b-f7ef-3aec-9f46-c3dc12358ac8/template/tmpl/2/210/dnld982911992150124927tmp_, bytes=1104917, error=Stream closed, pct=0

TemplateDownload_Steam-close

STEPS TO REPRODUCE
  1. Take any invalid OVA/other template

    Confirm the template is invalid using below steps:
    - Check the template file format using cmd: "file | cut -d: -f2"
    - Deploy VM from that template in the VMware/other respective hypervisor directly

  2. Register that template in CloudStack

EXPECTED RESULTS

CloudStack should report error as "Invalid file format" and never trigger re-download on SSVM.

ACTUAL RESULTS

CloudStack reports error as "Stream closed" and SSVM tries to re-download the template.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions