VMware {code} Community
venkat70
Contributor
Contributor

Problem with datastore and datastoreFolder in Datacenter object In virtual center 4.0,

Hi

Using some credential if we query datastore attribute of Datacenter object, we get the array of Datastore ManagedObjectReference.

But for a different credential in the same virtual center, datastore attribute is not set. Instead, the data is available only in datastoreFolder attribute.

The virtual center server version is "VMware vCenter Server 4.0.0 build-208111"

Is this a bug?

Thanks

Venkat

0 Kudos
4 Replies
lamw
Community Manager
Community Manager

Are the permissions the same for both users when you query for this information? Depending on how the permissions are set, you may see different things.

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

William Lam

VMware vExpert 2009

VMware ESX/ESXi scripts and resources at:

Twitter: @lamw

VMware Code Central - Scripts/Sample code for Developers and Administrators

VMware Developer Community

If you find this information useful, please award points for "correct" or "helpful".

0 Kudos
venkat70
Contributor
Contributor

We are trying to find that out. But in both cases (the credential that works and the one that doesn't), datastoreFolder is always set.

It's that datastore attribute is not set for one of the credential.

Does this mean for 4.0 version of Virtual center server, Only datastoreFolder is reliable?

Thanks

Venkat

0 Kudos
lamw
Community Manager
Community Manager

So the permissions thing should be trivial to figure out, you should be able to login as an "Administrator" or someone with full privileges and compare the two accounts being used.

Secondly, the "datastoreFolder" is always guarantee to be set, take a look at - http://www.vmware.com/support/developer/vc-sdk/visdk400pubs/ReferenceGuide/vim.Datacenter.html

You'll see that you're always guarantee to have datastore, vm, host and network folders. So that is something you can expect to have and specifically datastoreFolder and networkFolder was recently introduced with vSphere API 4.0 where as in VI API 2.5 only the host and vm folder existed under the Datacenter Managed Object

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

William Lam

VMware vExpert 2009

VMware ESX/ESXi scripts and resources at:

Twitter: @lamw

VMware Code Central - Scripts/Sample code for Developers and Administrators

VMware Developer Community

If you find this information useful, please award points for "correct" or "helpful".

venkat70
Contributor
Contributor

Yeah. The credential didn't have System.View permission. But still I'm not sure why it's not consistent. If datastore attribute cannot be populated, then datastoreFolder also should not be populated. Right? Maybe because it can contain folders, it can still have folders. But when we navigate the folders, you should not be able to get to datastores if the same restrictions are applied. Right?

Anway, Your answer helped me. I rewrote my queries to use datastoreFolder if the vcenter server version starts with 4 or above.

Thanks

Venkat

0 Kudos