VMware {code} Community
venkat70
Contributor
Contributor
Jump to solution

InvalidProperty when doing info.vmfs on Datastore when querying properties

when i try to query with a property spec for datastore as below, it throws an exception.

PropertySpec pdsspec = DataObjectFactory.newInstance(PropertySpec.class);

TypeName DatastoreType = TypeName.forClass(Datastore.class);

pdsspec.setType(DatastoreType);

pdsspec.setAll(Boolean.FALSE);

pdsspec.setPathSet(new String[] {"host","info.name","summary.url","summary.capacity","summary.freeSpace","info.vmfs.type"});

i found out that info.vmfs.type is causing the InvalidProperty exception. any idea? Any workaround?

thanks

venkat

0 Kudos
1 Solution

Accepted Solutions
storm27
Enthusiast
Enthusiast
Jump to solution

Hi,

Yes you are right, you need to first get instance of "info" and then retreive it's properties.

Another approach for retreiving the "type" property of datastore is by using "summary.type" in the setPathSet. This retreives the type of the datastore.

Hope this helps.

-Angela

View solution in original post

0 Kudos
2 Replies
venkat70
Contributor
Contributor
Jump to solution

if i just do "info" in setpathSet and then get the vmfs on the client side, it should work. right?

0 Kudos
storm27
Enthusiast
Enthusiast
Jump to solution

Hi,

Yes you are right, you need to first get instance of "info" and then retreive it's properties.

Another approach for retreiving the "type" property of datastore is by using "summary.type" in the setPathSet. This retreives the type of the datastore.

Hope this helps.

-Angela

0 Kudos