Hello Guys,
I was trying to read/write some xml files from vCO workflows:
I am kinda stuck here, and I would like to see if anyone else has ever encountered this problem before, and how did you fix it?
Any insight into this issue will be much appreciated.
Thanks,
DH
Odd.
What is your use case ? Does this file need to to be accessed from an external system or not ? If not storing the file in a resource element is a better option.
Someone? Anyone?:smileyconfused:
Is /Orchestrator/xml/ a valid path ?
You have to use relative path starting by ".." or path from the root of the appliance.
Thanks for your reply and sorry for the confusion.
In my default setting, I have:
-rwx /
+rwx /var/run/orchestrator
I changed that to:
+rwx /
+rwx /var/run/orchestrator/xml
The filePath I input for the workflow is:
/var/run/orchestrator/xml/sample.xml I also copied the sample.xml file to the root and tried /sample.xml
The results are all the same - permission denied.
Can I ask what will the relative path be like in this case?
Many thanks
The paths have changed since earlier release of the appliance but your relative bath should start from the bin directory (if this still exist) or from wherever orchestrator.sh is.
Thanks for the prompt reply, the followings are the settings in my js-io.rights.conf, are they seem to be right?
I don't quite understand what do you mean by the "start from bin directory", what should the filepath in the workflow be?
I've found out the orchestrator.sh file, it is located on the "./opt/vmo/app-server/bin"
I tried to copy the xml file in the bin folder, and called it from WF as "/opt/vmo/app-server/bin/samle.xml", still "permission denied"
Forgot my comment on the change of path. this is on a version of vCO that is not publicly available yet.
+rwx /var/run/orchestrator/xml should allow you to write there.
You can also use System.getTempDirectory as a place to read / write temp data.
the relative path start from within the bin directory so it is going to be ../xml if you create a directory a the same level of the bin directory.
because you would need to change it to +rwx ../bin
This may seems obvious but have you restarted the vCO service after doing the change
Our vCenter server is temporarily down, so I haven't got a chance to restart the vCO service from the web configuration.
But very likely, you are right, I'm about to find out in a very short time...
Hi cdecanini,
I restarted the vCO service several times, I've changed it to +rwx ../bin, and I also put the sample.xml file directly into the bin folder, but still permission denied.
It's really like a pain in the ass...
Odd.
What is your use case ? Does this file need to to be accessed from an external system or not ? If not storing the file in a resource element is a better option.
The case here is like I'd like to use a xml file to keep track of all the vms provisioned, and I may also extract some parameters from that file to provision new machine.
What do you mean by resource element?
In the design tab of the vCO client there is a resources tab.
You can create a folder there and import any kind of file (I think the limit is 4096 KB).
Once done you can add an attribute of type resource element and set it to your file.
From a scriptable task you can access the file content like this
var xmlString = resource.getContentAsMimeAttachment().content;
If you need to change it you can do :
var mimeAttachment = new MimeAttachment();
mimeAttachment.content = xmlString;
mimeAttachment.mimeType = "text/xml";
mimeAttachment.name = resource.name;
Resource element are stored in the vCO database.
It works!!
And it really helped me.
Thanks so much!
Gob bless you!