Exporting OVF/OVA template using OVF tool fails with below error:

================

$ ovftool vi://root@192.168.2.8/

Enter login information for source vi://192.168.2.8/

Username: root

Password: *******

Error: Could not lookup host: root

================

My password for host was VMware@123!.

As per VMware documentation OVF tool doesn’t understand special characters. You can refer below link and check page 25:

https://www.vmware.com/support/developer/ovf/ovf420/ovftool-420-userguide.pdf

Encoding Special Characters in URL Locators

When you use URIs as locators, you must escape special characters using % followed by their ASCII hex value.

For instance, if you use a “@” in your password, it must be escaped with %40 as in vi://foo:b%40r@hostname,

and a slash in a Windows domain name (\) can be specified as %5c.

For a quick list of HEX values you can reference: http://www.ascii.cl/htmlcodes.htm

So the password that I had to enter was VMWare%40123%21 after which exporting completed successfully.