PowerCLI

 View Only
  • 1.  Deploy ovf from within the datastore help

    Posted Jul 28, 2011 07:06 PM

    Hi,

    I currently am trying to deploy an ovf onto an esxi machine. The ovf is currently located on the destination esxi machine.

    Here is the command I was trying to use:

    .\ovftool "https://<ip address>/folder/group1/Win7-5/Win7-5.ovf?dcPath=ha-datacenter&dsName=datastore1" vi://user:password@<ip address>

    group1/Win7-5/Win7-5.ovf is the is the location of the ovf within the datastore.

    When I try to execute this it has the error:

    Error: Could not open URL https://<ip address>/folder/group1/Win7-5/Win7-5.ovf?dcPath=ha-datacenter&dsName=datastore1 (response code 404)

    If i open up the vsphere UI and go through the deploy ovf wizard using

    https://<ip address>/folder/group1/Win7-5/Win7-5.ovf?dcPath=ha-datacenter&dsName=datastore1  (same as above)

    as the location of the ovf file it works fine.

    If anyone can help me i would greatly appriciate it. I searched all over and couldnt find an answer anywhere else and couldnt figure it out when looking at the docs. Sorry if this is a repeat post.

    Ray



  • 2.  RE: Deploy ovf from within the datastore help

    Posted Jul 28, 2011 07:13 PM

    Copy the ovf to the workstation that you have the vSphere client on.  Then use the deploy ovf template wizard and point it to the location on your workstation that the ovf is at.

    Hope this helps.

    -Alex



  • 3.  RE: Deploy ovf from within the datastore help

    Posted Jul 28, 2011 07:30 PM

    Thanks for the help. I know I can get it to work doing that but I am hoping to be able to use the ovftool to deploy from within the datastore. The vsphere UI can do this just fine but for some reason when I type the same thing in for the location using ovf tool it doesnt work.

    Do you know a way to use ovftool and deploy from within the datastore?



  • 4.  RE: Deploy ovf from within the datastore help

    Posted Jul 28, 2011 07:58 PM

    Never used ovf tool before.  Is it depreciated? 

    I think the problem about using the url from the datastore browser is probably the authentication.  I don't know of a way to deploy an ovf from within a datastore.

    What's the use case for this?  Why won't the method I outlined above work for you?

    Just curious.

    -Alex



  • 5.  RE: Deploy ovf from within the datastore help

    Posted Jul 28, 2011 08:19 PM

    Im not sure if it is depricated or not.

    The weird thing is that I know you can deploy from within the datastore because if i type in the url that I gave before into the vsphere deploy ovf template wizard it works just fine. It only doesnt work when I use that url when using the command line with ovftool

    I am trying to write a script that will go and deploy a bunch of ovf templates. If I can get the script working then everyone else at my work can execute the script whenever they need a new group of VMs that are already setup just how they want them.

    Im an intern, so my job is to try and make it easier for the other employees but Im running into difficulties as you can see haha.



  • 6.  RE: Deploy ovf from within the datastore help

    Posted Jul 28, 2011 08:43 PM

    Have you thought of using vCenter Orchestrator for this? It was designed for automating workflows. I have yet to use it myself but I think this could work for you. Plus it's included with vCenter.



  • 7.  RE: Deploy ovf from within the datastore help

    Posted Jul 28, 2011 08:46 PM

    Hmm i have never heard of it. I will have to look into it while I continue to tinker with my script.

    Thanks :smileyhappy:

    Ray



  • 8.  RE: Deploy ovf from within the datastore help

    Posted Jul 29, 2011 08:34 AM

    ovftool is very well and not dead and we will release a new version soon.

    .\ovftool "https://<ip address>/folder/group1/Win7-5/Win7-5.ovf?dcPath=ha-datacenter&dsName=datastore1" vi://user:password@<ip address>

    The source locator when using http(s) as transport protocol must point to the OVF. For this to work a simple "wget" / "curl" to the same URL should print the OVF.

    Will you be able to run the same command where you add

    --X:logFile=PATH_SOME_FILE --X:logLevel=trivia and mail me log so I can have a look.

    eske



  • 9.  RE: Deploy ovf from within the datastore help

    Posted Jul 29, 2011 05:02 PM

    I ended up creating a VM and puting all the .ovf files on the vm. From there I use ovftool to deploy the templates via script. I was able to get this to work because I can use a normal file path. If you would still like my to get the log I can.

    Is this what you would like me to try? I get an error when I go to do this

    .\ovftool --X:logFile="C:\Users\Ray\Desktop" --X:logLevel=trivia "https://<ip  address>/folder/group1/Win7-5/Win7-5.ovf?dcPath=ha-datacenter&dsName=datastore1"  vi://user:password@<ip address>

    the "group1" folder is actually a longer folder name with a couple spaces in it. Idk if that could be an issue too. That was why I had the ovf path in quotes, but this seemed to work fine when it was a C:\ file path, as long as I quoted the whole thing.

    Thanks for the help,

    Ray

    Edit: Oh and it would be awesome if I could deploy them to a resource pool. I think it involves adding something onto the end of

    vi://user:password@<ip address>. I can go look at the doc and tinker with it but I figured you'd be able to help me with that pretty easily. Thanks again for all the help :smileyhappy:

    And no hurry on any of this. ovftool really saved me and made this a lot easier. Im just happy I got it working in the VM, and I can work on my script.



  • 10.  RE: Deploy ovf from within the datastore help

    Posted Mar 26, 2024 04:51 PM

    The whole point is deploying from the datastore and the first comment is to copy it to a workstation..........