Hi All,
I have a requirement to tag / de-tag list of VMs in vCenter. Created a CSV input file type with columns needed for tagging/detagging. However, the CSV file type is not a supported input file type in order to create XaaS catalog in vRA 8.7.
The workflow reads/interprets the CSV data each row, passes the searches for VM name in vCenter SDKs and uses "add VM tag"/"Remove VM tag" action elements.
Please suggest if there is any alternative I can choose instead of CSV file type in order to pass Tag values for list of VMs(more than 100).
Regards,
Sasidhar
Hi
You could use a TextArea input which supports multi-line input. I'm guessing that your workflow uses a String.split(',') call to turn each CSV into an array so this would work
I can't recall what the input length limit for a TextArea is but it should be in order of Kb IIRC
Alternatively, the Datagrid might work but it depends on how you're handling ADD vs REMOVE tags (operations embedded in text? e.g.,
<VMNAME>,ADD:<Tagname 1>,REMOVE:<Tagname 2>
etc?
Since vRA 8.8 you can upload files up to 1MB via XaaS custom forms: vRA 8.8 Release Notes
Create a WF with input type MimeAttachment:
In a scriptable task process the file contents. Here is a sample to print the rows one by one:
var rows = csv.content.split("\n");
for (i in rows) {
System.log(i + ". " + rows[i]);
}
Add the WF to your XaaS content source.
Request the catalog item:
WF logs:
HTH
Thanks for your inputs, am using the CSV input file as per below snippets. Each row is having VMname, Cluster, removal tags, addition tags and date details. Can I copy paste the same content of CSV into text area and change the inFile type from MimeAttachment to Text Area? Any additional changes are needed here..Thanks in advance..
Thanks for your reply. We have received the same response from VMware support to upgrade to 8.8, as of now, we do not have plans to upgrade, hence looking for alternative options to provide XaaS catalog access to users in vRA 8.7.
8.7 is end of support on 2023-03-22 so you should upgrade soon, anyway.
If you use a string input called csv, use this code:
var rows = csv.split("\n");
Thanks again!!
Until we upgrade to 8.8, I need an alternative solution passing the row data instead of a CSV file. I would request you to provide the details of using the text area with a sample code on how to use multiple rows of data .
See in my previous reply.