Unfortunately, vRO isn't really built for this kind of use case. It's an orchestrator, not a file server. At least not for now.
I can't think of any other solution. I think the main reason is that VMware has developed a Content Library for managing VMs, ISOs, images, and VM templates. So, the image should already be in the CL before vRO can use it. I'm using Hashicorp Packer to manage VM templates and store them in the CL. Then, I'm using vRO to deploy the VM from the CL. This works perfectly in all my use cases. I think VMware is thinking the same way. So, if you try to bypass this logic, any homemade solution will probably be a bit messy.
If you find the answer helpful, please click on the RECOMMEND button.
Original Message:
Sent: Nov 21, 2024 02:27 AM
From: Cristescu Catalin
Subject: Upload file to vCenter through vRO
Hello,
The initial plan was to use a MimeAttachment input in vRO to upload a file, which would then be saved to the vRO server at the following path: /usr/lib/vco/app-server/temp
, as you mentioned.
This approach worked fine for files under 30 MB. However, for ISO files required for VM provisioning-which are typically 1-2 GB or larger-this method is not practical.
Step 1: Use MimeAttachment to upload the file to vRO.
Step 2: Utilize the built-in workflow "Upload file to datastore" to transfer the ISO from vRO to a vCenter datastore. This works as expected for smaller files.
The challenge is finding a solution for uploading larger files. Ideally, the process should still involve vRO, as the goal is to keep the workflow user-friendly. The user would open the workflow, upload the file, and in the background, the system would handle the transfer to a Datastore or Content Library.
I want to avoid relying on an additional web server to serve as a temporary repository for Step 1. However, if no other viable option is available, I may have to consider this approach.
Thanks,
Catalin
Original Message:
Sent: Nov 19, 2024 01:36 PM
From: WhiteForEver
Subject: Upload file to vCenter through vRO
Hi,
so, a few things. For my opinion, there are two options I can think of:
1. Use Generic Element called "File Upload". The problem is that it's limited to 768Kb file size. Therefore, not solving your problem.
2. Utilize the "FileManager.uploadFileToDatastore" vRO API. This API has a property called "srcFilePath". For example, the file can be copied to the temp dir. The proper path can be found by running `System.log(System.getTempDirectory())`. Usually, it is `/usr/lib/vco/app-server/temp`.
There is some configuration required to make this path to be writable.
Unfortunately, there's no straightforward way to upload a file to vRO. Additionally, due to the size limit, it's not feasible to use the File Upload browser feature. If I were to require such a task, I would proceed as follows:
1. Upload files to the remote share.
2. Create a custom form with a dropdown that dynamically queries the share and displays all the files available there.
3. Select the file from the dropdown, construct the path and use the "SCP" command to copy it from the share to the vRO file system (built-in vRO workflow "SCP get command" can be used).
4. After the file is copied, use "FileManager.uploadFileToDatastore" to upload it to the destination datastore.
Sorry, I can't be more helpful. I hope you find it useful anyway!
------------------------------
If you find the answer helpful, please click on the RECOMMEND button.
Please visit my blog to get more information: https://www.clouddepth.com
Original Message:
Sent: Nov 19, 2024 07:25 AM
From: WhiteForEver
Subject: Upload file to vCenter through vRO
Hi,
let me take a look. I'll update you as soon as possible.
------------------------------
If you find the answer helpful, please click on the RECOMMEND button.
Please visit my blog to get more information: https://www.clouddepth.com
Original Message:
Sent: Nov 19, 2024 06:44 AM
From: Cristescu Catalin
Subject: Upload file to vCenter through vRO
Hello,
I'm looking for a way to upload a file from vRO to a vCenter datastore or a content library. Specifically, is it possible to upload the file to vRO first and then transfer it to the vCenter datastore?
I attempted to use an input of type MimeAttachment, but the process is extremely slow and fails for larger files, such as a 2GB ISO. Is there an alternative approach to achieve this upload through vRO without relying on a web server and transferring via API to vCenter ( datastore or content library )?
I would greatly appreciate any guidance on this.
Thank you!