VMware Cloud Community
DexG83
Enthusiast
Enthusiast

Orchestrator 8.4 REST-API download Host ISO from Red Hat Satellite API

Hello Community,

I am actually testing an automated Linux deployment with Red Hat Satellite. The final obstacle is to download the host ISO and mount it to a new VM.

I tested the functionality with the following curl command:

 

curl --header "Accept:application/json,version=2" --header "Content-Type:application/json" --request GET --user <u>:<p> https://satellite-test.testdomain/bootdisk/api/hosts/123 --output hostname.iso

 

 Is there any possibility to download that ISO with vRO REST-API?

Or any other hint on how to get that iso on a vm?

 

thx alot,

Dex

Reply
0 Kudos
5 Replies
kev01228
Enthusiast
Enthusiast

It's not REST-API, but the vRO workflow "Mount CD-ROM" would attach it to the VM. 

 

Reply
0 Kudos
DexG83
Enthusiast
Enthusiast

Hi kev,

 

thx for your reply. The most challenging thing is how to download the ISO file with a vRO REST Operation and place it somewhere I can use it.

I am very grateful for any hint.

 

Regards,

Dex

Reply
0 Kudos
imtrinity94
Enthusiast
Enthusiast

Have you found it yet?


Mayank Goyal
vRO Engineer
https://www.linkedin.com/in/mayankgoyal1994/
https://cloudblogger.co.in/
Reply
0 Kudos
eoinbyrne
Expert
Expert

The only way to mount the ISO on a new VM would be one of

  • client device
  • host device
  • Datastore ISO file

I'm guessing you plan for the last one there which means you need to do

  1. Download the ISO to some filesystem via REST/curl
  2. Upload the ISO to a datastore
  3. Mount the ISO file 
  4. Boot the VM

 

If I understand the REST plugin correctly, downloading something like an ISO would not be possible (unless the ISO were extremely small). The REST plugin will capture the entire content of the response for each request and make it available via RestRequest.contentAsString. This approach means that if the ISO were in any way large, you might get OutOfMemory exceptions in the Java application server which Orchestrator runs in. Also, the REST operation timeouts would need to be considered as the operation would continue until the entire ISO was downloaded. If you can get that part to work then you need to write the content to a file somewhere, then upload it to the Datastore, then you can mount the ISO to the VM.

If you absolutely had to do it this way I would use your curl command to download the file as it's more predictable (either a local command on vRO node which you'd have to whitelist in js-io-rights (can't recall if this is still allowed in 8.x), or over SSH to some other staging node)

The VC plugin has workflows / actions to do the upload & subsequent ISO mount if you get this far.

 

BTW: Is there a reason you're not using Satellite to PXE boot the VM? That was how we did this before and it worked quite well. We used the REST API to add the VM details to the HostGroup in Satellite and let it do the boot & install for us 

 

Anyway, HTH

 

Reply
0 Kudos
DexG83
Enthusiast
Enthusiast

Hi,

we implemented a workaround on a linux scripting host wich downloads the ISO and place it on an appropriate datastore.

After that Orchestrator mounts the ISO on the new VM and boots it.

 

Regards,

Dex