if(s_logger.isTraceEnabled())
s_logger.trace("vCenter API trace - mountDatastore(). target MOR: " + _mor.getValue() + ", vmfs: " + vmfsDatastore + ", poolHost: " + poolHostAddress
+ ", poolHostPort: " + poolHostPort + ", poolPath: " + poolPath + ", poolUuid: " + poolUuid);
ManagedObjectReference morDs = null;
ManagedObjectReference morDsFirst = null;
List<ManagedObjectReference> hosts = (List<ManagedObjectReference>)_context.getVimClient().getDynamicProperty(_mor, "host");
if(hosts != null && hosts.size() > 0) {
for(ManagedObjectReference morHost : hosts) {
HostMO hostMo = new HostMO(_context, morHost);
morDs = hostMo.mountDatastore(vmfsDatastore, poolHostAddress, poolHostPort, poolPath, poolUuid);
if(morDsFirst == null)
morDsFirst = morDs;
// assume datastore is in scope of datacenter
assert(morDsFirst.getValue().equals(morDs.getValue()));
}
}
if(morDs == null) {
String msg = "Failed to mount datastore in all hosts within the cluster";