Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unable to set network when using govc import.ova #460

Closed
thelangley opened this issue Mar 14, 2016 · 11 comments
Closed

unable to set network when using govc import.ova #460

thelangley opened this issue Mar 14, 2016 · 11 comments

Comments

@thelangley
Copy link

I've used the govc ls command to work out the correct name of the network / host / cluster.

No matter how I do it, I cannot seem to get the import.ova to honour the network selection.

I always get

govc: Host did not have any virtual network defined.

I'd really like it to be able to accept a -net=blahblah reference instead of using GOVC_NETWORK=

@tjim
Copy link

tjim commented Mar 28, 2016

Running into the same issue. Would like to abandon ovftool (which has --net) in favor of govc but can't for this reason.

@tsugliani
Copy link

That would indeed be great to avoid ovftool !

@mehrotra-prateek
Copy link

+1 has this been fixed?

@srbry
Copy link

srbry commented Aug 16, 2016

+1 has this got any progress?

@srbry
Copy link

srbry commented Aug 18, 2016

Hi all, while it would be nice to have an option to provide a -network arg to this command their is a current work around that can be used using the -options arg.

You can provide network mappings in an options.json file like so:

{
  "NetworkMapping": [
    "Name":"<network_name>",
    "Network":"<port_group>"
  ]
}

And then run this to deploy your ova:

govc import.ova -options=options.json <ova_file_path>

You can also do a whole load of extra config using options but it is not well documented, to gather an example file with all the options for your specific ova you can run (for my ova this gave me my NetworkMapping Name that I used above):

govc import.spec <ova_file_path>

@dougm
Copy link
Member

dougm commented Aug 25, 2016

Yes, should be fixed by #546 and #549 cc @egorovv

@egorovv
Copy link
Contributor

egorovv commented Aug 25, 2016

Yes, if the networks defined in the OVA are present in the the target DC it should just work now, and -options can provide the mapping for the rest.

@dougm
Copy link
Member

dougm commented Aug 25, 2016

Thanks @egorovv , would be great to capture some examples in the wiki and/or .md in the repo.

@koteswara-kelam
Copy link

koteswara-kelam commented Jan 21, 2020

even if i specify "myNetwork" which is DVS portgroup, the VM is getting deployed on "VM Network".
$ cat options.json
{
"DiskProvisioning": "flat",
"IPAllocationPolicy": "dhcpPolicy",
"IPProtocol": "IPv4",
"InjectOvfEnv": false,
"MarkAsTemplate": false,
"Name": null,
"NetworkMapping": [
{
"Name": "myNetwork",
"Network": "myNetwork"
}
],
"PowerOn": false,
"WaitForIP": false
}
$ govc import.ova --options=options.json centos-7-7-1579580585.ova
[21-01-20 11:28:57] Warning: Line 72: Invalid value 'bridged' for element 'Connection'.
[21-01-20 11:30:01] Uploading greenlake-centos-7-7-disk1.vmdk... OK

@koteswara-kelam
Copy link

it is working after changing "Name" to ova's network. Thanks @dougm I didn't read your comment carefully.

@koteswara-kelam
Copy link

it is working after changing "Name" to ova's network. Thanks @dougm I didn't read your comment carefully.
{
"Name": "bridged",
"Network": "myNetwork"
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants