Ive poured over examples from the web, and gone all through the User Guide, just cannot figure this out. Trying to do deploy to a VM/template folder that already exists
Using ovftool 4.2 on linux
ovftool --acceptAllEulas --name=TST1-pub --datastore=EMC3-DS --network:VMNet=VMNet --vmFolder=TST2-300 --powerOn --noSSLVerify vi://$TF_VAR_vsphere_user:$TF_VAR_vsphere_pass@esxic.int.com/VMWAREDC/TST2-300
(ignore that incorrect email urlization that the forum did there, I am indeed entering that data correctly)
but no matter WHAT I try to use for the vi locator, it always complains. sometimes it gives me hints, sometimes not, and invariably using the hint leads to some error.
Welcome to the Community,
deploying a VM into a folder requires to specify the target path with the key word "vm". So in your case s.th. like this should work to specify a target folder:
vi://$TF_VAR_vsphere_user:$TF_VAR_vsphere_pass@esxic.int.com/VMWAREDC/vm/TST2-300
For more details, take a look at Open Virtualization Format Tool (ovftool) which contains examples for different deployments.
Note: I can't reproduce this at the moment, so I'm not 100% sure whether the command also requires the VM's target name behind the folder name.
André
Thanks! however this doesnt wok either (already tried that) Conveniently though, if you just use /vm at the end of the vi locator, the tool is nice enough to list all the vm&template folders present on the VMWare datacenter you gave it. first it gives the error
Error: Found wrong kind of object (Folder). Possible completions are:
Then it lists all the folders.
My TST2-300 folder already is present, and does show up in the list. I created it with the python sdk. But then when I try to use /vm/TST2-300 at the end of the location then I still get an error:
Error: Locator does not refer to an object: vi://$TF_VAR_vsphere_user:$TF_VAR_vsphere_pass@esxic.int.com/VMWAREDC/vm/TST2-300
I get same thing if I use /TST1-pub at the end (the hostname of the VM Im trying to create)
Theres just got to be something im missing here. Thanks!
Did you try it with the VM's name appended to the path (.../VMWAREDC/vm/TST2-300/Your-VMs-Name)?
André
It looks like you just edited your last reply while I posted my reply.
Anyway,, one more thing which you may try, is to remove --vmFolder=TST2-300 from the command line. According to the documentation, --folder= requires a MoRef rather than a name, and since the folder name is already in the target locator, it shouldn't be required.
André
Yes I tried with /TST2-pub at the end there as well since that is the name Im telling ovftool to use as VM name. Same error.
Error: Locator does not refer to an object:
I edited my post up above with this info but you were too fast for me
Thanks - I took that --folder option out, same error,regardless of then if I used the vm name at the end of the vi or not
So Im actually having the same issue understanding the documentation - I get the list of possible completions, but these are just a list of already created VMs on the Datacentre. My intention is to deploy a new VM which does not exist yet. Would like to see how this has been fixed as the documentation is rather not specific about our case.
Edit: So I have just realized I need to replace the 'vm' with 'host' in VI tagret...silly me.