VMware {code} Community
rampang
Contributor
Contributor

Finding information about metadata files within datastore?

ls -al within the datastore lists metadata files for the VMFS3 volume.

.fdc.sf - file descriptor system file

.sbc.sf - sub-block system file

.fbb.sf - file block system file

.pbc.sf - pointer block system file

.vh.sf - volume header system file

Is there any way to get these files information like size, date last modified from SDK?

Thanks

0 Kudos
5 Replies
lamw
Community Manager
Community Manager

You can probably do following given MOR of Datastore:

#capture VM dir contents w/delta files
my $browser = Vim::get_view (mo_ref => $ds->browser);
my $ds_path = "";

my $file_query = FileQueryFlags->new(fileSize => 1,fileType => 0,modification => 1);

my $searchSpec = HostDatastoreBrowserSearchSpec->new(details => $file_query,matchPattern => );
my $search_res = $browser->SearchDatastoreSubFolders(datastorePath => $ds_path,searchSpec => $searchSpec);

if ($search_res) {
	foreach my $result (@$search_res) {
		my $files = $result->file;
		if ($files) {
    		foreach my $file (@$files) {
				print $file->path,"\n";
				print $file->modification,"\n";
    		}
		}
	}
}

And just substitute the match pattern of the file's you're looking for.

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

William Lam

VMware vExpert 2009

VMware ESX/ESXi scripts and resources at:

0 Kudos
rampang
Contributor
Contributor

Thanks. I already tried browsing the folder files through the datastore browser, its only returning the datastore files(those we see in the VI Client), but not the metadata files of datastore.

Any solutions for meta data files using sdk?

0 Kudos
lamw
Community Manager
Community Manager

Well in terms of the VI Client browser, it might work slightly different, you would have to implement the code to see if it's able to see the metadata. If not, then it could be limitation of the API. I'm not aware of any other method

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

William Lam

VMware vExpert 2009

VMware ESX/ESXi scripts and resources at:

0 Kudos
rampang
Contributor
Contributor

Thanks William. I did implement the code and listed all the files within the datastore. I also tried in the code with the exact file in the matched pattern. API does not return the meta data files.

You are right that most likely its not supported by API.

0 Kudos
lamw
Community Manager
Community Manager

Perhaps you can file an SR with VMware for possible enhancement in a future release of the VI API? That sounds like it would be useful to have and one of those things that would still require Service Console access in the Classic ESX or the unsupported Tech Support Mode in ESXi

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

William Lam

VMware vExpert 2009

VMware ESX/ESXi scripts and resources at:

0 Kudos