use of com.emc.sa.service.vmware.file.tasks.CreateNfsDatastore in project coprhd-controller by CoprHD.
the class VMwareSupport method createNfsDatastore.
/**
* Creates an NFS datastore for a host.
*
* @param host
* the host.
* @param fileSystem
* the file system.
* @param export
* the export.
* @param datacenterId
* the datacenter ID.
* @param datastoreName
* the name of the datastore to create.
* @return datastore
*/
public Datastore createNfsDatastore(HostSystem host, FileShareRestRep fileSystem, FileSystemExportParam export, URI datacenterId, String datastoreName) {
addNfsDatastoreTag(fileSystem, export, datacenterId, datastoreName);
String fileServer = StringUtils.substringBefore(export.getMountPoint(), ":");
String mountPath = StringUtils.substringAfter(export.getMountPoint(), ":");
Datastore datastore = execute(new CreateNfsDatastore(host, fileServer, mountPath, datastoreName));
addAffectedResource(fileSystem);
ExecutionUtils.clearRollback();
return datastore;
}
use of com.emc.sa.service.vmware.file.tasks.CreateNfsDatastore in project coprhd-controller by CoprHD.
the class VMwareSupport method createNfsDatastore.
/**
* Creates an NFS datastore for the hosts in the cluster
*
* @param cluster
* the cluster.
* @param fileSystem
* the file system.
* @param export
* the export.
* @param datacenterId
* the datacenter ID.
* @param datastoreName
* the name of the datastore to create.
* @return datastores
*/
public List<Datastore> createNfsDatastore(ClusterComputeResource cluster, FileShareRestRep fileSystem, FileSystemExportParam export, URI datacenterId, String datastoreName) {
addNfsDatastoreTag(fileSystem, export, datacenterId, datastoreName);
List<Datastore> datastores = Lists.newArrayList();
String fileServer = StringUtils.substringBefore(export.getMountPoint(), ":");
String mountPath = StringUtils.substringAfter(export.getMountPoint(), ":");
for (HostSystem host : cluster.getHosts()) {
datastores.add(execute(new CreateNfsDatastore(host, fileServer, mountPath, datastoreName)));
addAffectedResource(fileSystem);
ExecutionUtils.clearRollback();
}
return datastores;
}
Aggregations