VMware {code} Community
neerjain
Contributor
Contributor

Problem while running ovftool against Virtual Center

Hi,

I am facing problems trying to import an ovf file using the vmware ovftool to the Virtual Center from the command line.

I have a Virtual Center with 3 ESX hosts regsistered.

From the command line,

if i execute something like this,

ovfTool.exe "C:\Documents and Settings\dev\Desktop\ovfStore\vmx_to_ovf1.ovf" "vi://[username:password@10.0.0.69/DC/host/10.0.0.199?name=vmx_from_ovf&datastore=NFS|http://username:password@10.0.0.69/DC/host/10.0.0.199?name=vmx_from_ovf&datastore=NFS]"

where

DC = DataCenter Name

10.0.0.69 = VC's IP

10.0.0.199 = One of the ESX hosts registered on VC

NFS = name of the datastore attached to the ESX host.

it fails and a warning like this is reported also

(vim.fault.OvfElementInvalidVa

lue) {

dynamicType = <unset>,

faultCause = (vmodl.MethodFault) null,

lineNumber = 86,

name = "Connection",

value = "New Switch",

msg = "",

}

But if i remove the datastore from the destination url, it works pretty fine,

as in if i execute

ovfTool.exe "C:\Documents and Settings\dev\Desktop\ovfStore\vmx_to_ovf1.ovf" "vi://[username:password@10.0.0.69/DC/host/10.0.0.199?name=vmx_from_ovf|http://username:password@10.0.0.69/DC/host/10.0.0.199?name=vmx_from_ovf]"

the import happens perfectly well.

Besides there is no problem when i execute these commands against an ESX host..

Import happens perfectly well even if i mention a datastore or not..It

is just that things aren't working against the VC when i mention the

datastore's name in the url.

Does any of you have an idea why this is happening?

Thanks in advance...

Regards,

N Jain

0 Kudos
2 Replies
njain
Expert
Expert

It seems that the OVF tool is taking the first datastore it gets on the host. Thus, when you try to import the OVF file using VirtualCenter, "NFS" datastore does not seem to be first datastore, and it results in error. Try to pass the other local datastore on the host and see if the import works (for VC). When directly connecting to host, "NFS" seems to be the first datastore and the import works.

To see the first host on the datastore, you can also check Virtual Center MOB (https://<VirtualCenter IP>/mob) and drill down till you reach the desired host. Then check the "datastore.summary.name" property of the first datastore that you see in the MOB. Pass this value to test if import works fine.

neerjain
Contributor
Contributor

njain, there are certain findings that i made with regards to the working of the ovftool..

With ESX, the ovftool works fine. No matter which NFS datastore i make a mention of in the command, the import happens properly.. And for a Virtual Center, for the first host registered with the same, things are working fine.

Is VmWare coming out with a new version of the ovftool tool which takes care of import properly?.

0 Kudos