VMware Cloud Community
GarTomlon
Enthusiast
Enthusiast

Upload File (ISO) to a datastore

I need a create  workflow that will upload a specific file to a datastore.  The destination will not change. I created a workflow and I created attributes for destFilePath, datacenter and datastore.  I have set the values to these.  The only item that I am asking for input is the srcFilePath.  I added ActionElement for FileUploadDatastore. I run this workflow and the I am getting invalid file/path for srcFilePath.  Trubleshooting, I simply tried to run the Upload a File Workflow.  It has the four inputs: Datacenter, Datastore, Source Path, Destination Path.  WHen i click on the field to select the Datacenter plugin, the session locks up.  Any ideas what is ocurring ?  Thx

Tom

Reply
0 Kudos
6 Replies
jasnyder
Hot Shot
Hot Shot

I simply tried to run the Upload a File Workflow.  It has the four inputs: Datacenter, Datastore, Source Path, Destination Path.  WHen i click on the field to select the Datacenter plugin, the session locks up.  Any ideas what is ocurring ?

This is normally because the VcPlugin is trying to load inventory and cache it, and thus locks for a minute or two.  If inventory is already in cache, you shouldn't see much if any of a delay.  As for why yours is locking up indefinitely, it may have a connection issue and the timeout is sufficiently long as to make you think it's locking up.  If you browse the inventory tab in vRO, can you see the vCenter inventory?

pastedImage_2.png

I added ActionElement for FileUploadDatastore. I run this workflow and the I am getting invalid file/path for srcFilePath.

The srcFilePath needs to be resolvable on the vRO server and readable by the vco user/group.  Where did you put the ISO and is the path mounted from the vRO server?

As a test, you can put the iso file in /var/run/vco on the vRO server and run chown vco:vco on the file.  Then try to run the upload workflow using /var/run/vco/file.iso as the srcFilePath and it should work.

Reply
0 Kudos
GarTomlon
Enthusiast
Enthusiast

Thanks for the reply.  I did try placing the file in the path that you suggested.  It allowed the script to get past that error.  I think I am now hung up on the destFilePath.  Right now, I am just running the Upload File to Datastore workflow (right out of the box).  I am selecting Datacenter, the Datastore, I am using the path that you selected for the srcFilePath.  For the desFilePath, I am using [MARVIN-Virtual-SAN-Datastore-4867eada-77ca-4c56-b804-440d52586928] testiso/testing.iso

I am getting the following error:

[2017-12-05 11:02:20.527] [I] Uploading file: /var/run/vco/testing.iso to datastore: MARVIN-Virtual-SAN-Datastore-4867eada-77ca-4c56-b804-440d52586928

[2017-12-05 11:02:20.534] [I] Uploading failed. Reason: InternalError: Error uploading file (Dynamic Script Module name : uploadFileToDatastore#5)

[2017-12-05 11:02:20.553] [E] Workflow execution stack:

***

item: 'Copy of Upload file to datastore/item2', state: 'failed', business state: 'null', exception: 'Failed to upload the file: /var/run/vco/testing.iso Reason: InternalError: Error uploading file (Dynamic Script Module name : uploadFileToDatastore#5) (Dynamic Script Module name : uploadFileToDatastore#14)'

workflow: 'Copy of Upload file to datastore' (8aad641d-aefc-4ad7-b2c2-314b4bdcd01b)

|  'attribute': name=errorCode type=string value=Failed to upload the file: /var/run/vco/testing.iso Reason: InternalError: Error uploading file (Dynamic Script Module name : uploadFileToDatastore#5) (Dynamic Script Module name : uploadFileToDatastore#14)

|  'input': name=datacenter type=VC:Datacenter value=dunes://service.dunes.ch/CustomSDKObject?id='vdiavc.genpt.net%2Cid:datacenter-2'&dunesName='VC:Datacenter'

|  'input': name=datastore type=VC:Datastore value=dunes://service.dunes.ch/CustomSDKObject?id='vdiavc.genpt.net%2Cid:datastore-12'&dunesName='VC:Datastore'

|  'input': name=srcFilePath type=string value=/var/run/vco/testing.iso

|  'input': name=destFilePath type=string value=[MARVIN-Virtual-SAN-Datastore-4867eada-77ca-4c56-b804-440d52586928] testiso/testing.iso

|  'no outputs'

*** End of execution stack.

I am thinking that I am missing the syntax somewhere.  Any suggestions?

Reply
0 Kudos
iiliev
VMware Employee
VMware Employee

Hi,

For the destFilePath, you should provide /testiso/testing.iso or testiso/testing.iso

Reply
0 Kudos
AnkushMehta
Contributor
Contributor

Hi Ilian Iliev

Thank you so much for posting this after spending 2 weeks I was able to use that workflow as you mentioned above, it worked for me. It will be great if you can help me with the below follow up question.

"The srcFilePath needs to be resolvable on the vRO server and readable by the vco user/group. Where did you put the ISO and is the path mounted from the vRO server?"

Can you please let me know how to make the source path resolvable to vRO server. I dont want to put the file to be uploaded to datastore on the vRO server , I want to upload the file from my local mahcine to the datastore. Is it possible by any means?

Reply
0 Kudos
SovanDas
Contributor
Contributor

Hello All,

I am using "APAQVV000C\TestISO\APICM.iso" as a destpath. Where I can see "TestISO" folder is getting created under "APAQVV000C" folder but the ISO is failing to get uploaded to target folder.
Can you please suggest where the I am making the mistake?

Reply
0 Kudos
SovanDas
Contributor
Contributor

Hi iiliev,

 

I am using "APAQVV000C\TestISO\APICM.iso" as a destpath. Where I can see "TestISO" folder is getting created under "APAQVV000C" folder but the ISO is failing to get uploaded to target folder.
Can you please suggest where the I am making the mistake?

Reply
0 Kudos