use of com.vmware.vim25.ArrayOfHostFileSystemMountInfo in project photon-model by vmware.
the class EnumerationClient method getDatastoresHostMountInfo.
/**
* Get the mount info of all the datastores that are connected to a given host.
*/
public Set<String> getDatastoresHostMountInfo(HostSystemOverlay hs) throws InvalidPropertyFaultMsg, RuntimeFaultFaultMsg {
Set<String> sharedDs = new HashSet<>();
ArrayOfHostFileSystemMountInfo mountInfo = this.getMoRef.entityProp(hs.getId(), HOST_DS_MOUNT_INFO);
if (mountInfo != null) {
mountInfo.getHostFileSystemMountInfo().stream().filter(fsMountInfo -> fsMountInfo.getVolume() instanceof HostVmfsVolume).forEach(fsMountInfo -> {
HostVmfsVolume vmfsVol = (HostVmfsVolume) fsMountInfo.getVolume();
if (!vmfsVol.isLocal()) {
sharedDs.add(vmfsVol.getName());
}
});
}
return sharedDs;
}
Aggregations