Hello,

You should be able to upload an ISO via CLI using CloudMonkey and cURL:

1. Via CloudMonkey, call the `getUploadParamsForIso` API in order to obtain the parameters that will be used for upload.

```
(admin) 🐱 > get uploadparamsforiso name=<name_of_the_ISO> displaytext=<display_text_of_the_ISO> format="iso" zoneid=<uuid_of_the_zone>
```

The output should look like this:
```
{
  "getuploadparams": {
    "expires": "2024-05-20T14:17:30.466Z",
    "id": "afbd9fa8-ec98-4886-a958-29cb978e46e7",
    "metadata": "PmZ7p+TpMJNiNotZ+xzaNanPNbezskK5w2I7YX8A+tZQsVsCier5wMlO4mjf6wodvu2mUheKrBA2QTGf4wB/1+FQk/RVpMbJmbwJjOGh0huIqwnV9DWqmI7NodLitCvFVvoMg90+WR888mo5mgkoYKJ7qUEKtNH3c39gbh2eYC4VxDP9ELJOJLsW76KxG8298cmXV76gqzFHDQcVVJ+32HOTuX/innx3C6WvtcfuUH+XVG+6qbFFSMMtN1icMQWbgpkvJmuRr0hXMiWvTTZ1YcE0Xtlk/NSN2V6b42b46kawfPP0HzfsVo9RQijZ2y7UdjBKIbFkabQnVnXHNxONW/3aYmVfRtXqNhL+7x/xhfI4uLk8XbFyHm2Gx8OdPdjbV3/RBvbwUK5scWDjEczAyynxQGfRNkLjDCOGzSNv2JRT1qiHUm1srIFy/sMb7UP9E4REtk2WXUJRESf2ZgPiqsZxlsOz2oKpA8sTjhmM1kQu1j9iKyK1qAYY1yopiqleaI1tpMn/Yswu8+P1MnnKTn+0wOJNI013oW+OIW0zf4wd7Mw/PDSaXAtdJMzUGfoWxSRuoLLSEBYlkQOR1zV5/Xn9cMjQQoGboqJrW6o=",     "postURL": "https://172.16.200.100/upload/afbd9fa8-ec98-4886-a958-29cb978e46e7";,
    "signature": "u9dvlWl9CdbtWnpon3LibWIAC64="
  }
}
```

2. Upload the ISO using cURL.

```
curl -X POST "<postURL>" -H "X-signature:<signature>" -H "X-metadata:<metadata>" \
    -H "X-expires:<expires>" -H "Expect:" \
    -F "file=@<iso_path>" -v
```

Replace the placeholders in the command with the values you got from `getUploadParamsForIso` and with the ISO's path. The header `Expect` should remain blank; otherwise, cURL will wait until the SSVM sends a signal to begin the upload, which will result in a timeout as the SSVM does not implement this feature. If your SSVMs do not have SSL termination configured or you do not have the CA keys, also add `--insecure` at the end of the command in order to disable certificate validation.

This method can be used to upload templates and volumes as well, calling either `getUploadParamsForTemplate` or `getUploadParamsForVolume` instead of the `getUploadParamsForIso` API.

On 2024/05/20 13:00:37 Embedded Devel wrote:
> trying to download debian iso from
> https://cdimage.debian.org/debian-cd/12.5.0/amd64/iso-cd/debian-12.5.0-amd64-netinst.iso
>
>
> via the register iso button fails with
> Failed to download
> https://cdimage.debian.org/debian-cd/12.5.0/amd64/iso-cd/debian-12.5.0-amd64-netinst.iso
> due to redirection, response code: 302
>
>
> any way to manually upload an iso from cli ?
> --
> Sent with Vivaldi Mail. Download Vivaldi for free at vivaldi.com
>

Reply via email to