Search in sources :

Example 1 with CreateNfsDatastore

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;
}
Also used : MountDatastore(com.emc.sa.service.vmware.block.tasks.MountDatastore) ExpandVmfsDatastore(com.emc.sa.service.vmware.block.tasks.ExpandVmfsDatastore) FindLunsBackingDatastore(com.emc.sa.service.vmware.block.tasks.FindLunsBackingDatastore) UnmountVmfsDatastore(com.emc.sa.service.vmware.block.tasks.UnmountVmfsDatastore) CreateNfsDatastore(com.emc.sa.service.vmware.file.tasks.CreateNfsDatastore) ExtendVmfsDatastore(com.emc.sa.service.vmware.block.tasks.ExtendVmfsDatastore) Datastore(com.vmware.vim25.mo.Datastore) FindDatastore(com.emc.sa.service.vmware.tasks.FindDatastore) DeleteDatastore(com.emc.sa.service.vmware.tasks.DeleteDatastore) FindFilesystemWithDatastore(com.emc.sa.service.vipr.file.tasks.FindFilesystemWithDatastore) CreateVmfsDatastore(com.emc.sa.service.vmware.block.tasks.CreateVmfsDatastore) CreateNfsDatastore(com.emc.sa.service.vmware.file.tasks.CreateNfsDatastore)

Example 2 with CreateNfsDatastore

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;
}
Also used : MountDatastore(com.emc.sa.service.vmware.block.tasks.MountDatastore) ExpandVmfsDatastore(com.emc.sa.service.vmware.block.tasks.ExpandVmfsDatastore) FindLunsBackingDatastore(com.emc.sa.service.vmware.block.tasks.FindLunsBackingDatastore) UnmountVmfsDatastore(com.emc.sa.service.vmware.block.tasks.UnmountVmfsDatastore) CreateNfsDatastore(com.emc.sa.service.vmware.file.tasks.CreateNfsDatastore) ExtendVmfsDatastore(com.emc.sa.service.vmware.block.tasks.ExtendVmfsDatastore) Datastore(com.vmware.vim25.mo.Datastore) FindDatastore(com.emc.sa.service.vmware.tasks.FindDatastore) DeleteDatastore(com.emc.sa.service.vmware.tasks.DeleteDatastore) FindFilesystemWithDatastore(com.emc.sa.service.vipr.file.tasks.FindFilesystemWithDatastore) CreateVmfsDatastore(com.emc.sa.service.vmware.block.tasks.CreateVmfsDatastore) HostSystem(com.vmware.vim25.mo.HostSystem) CreateNfsDatastore(com.emc.sa.service.vmware.file.tasks.CreateNfsDatastore)

Aggregations

FindFilesystemWithDatastore (com.emc.sa.service.vipr.file.tasks.FindFilesystemWithDatastore)2 CreateVmfsDatastore (com.emc.sa.service.vmware.block.tasks.CreateVmfsDatastore)2 ExpandVmfsDatastore (com.emc.sa.service.vmware.block.tasks.ExpandVmfsDatastore)2 ExtendVmfsDatastore (com.emc.sa.service.vmware.block.tasks.ExtendVmfsDatastore)2 FindLunsBackingDatastore (com.emc.sa.service.vmware.block.tasks.FindLunsBackingDatastore)2 MountDatastore (com.emc.sa.service.vmware.block.tasks.MountDatastore)2 UnmountVmfsDatastore (com.emc.sa.service.vmware.block.tasks.UnmountVmfsDatastore)2 CreateNfsDatastore (com.emc.sa.service.vmware.file.tasks.CreateNfsDatastore)2 DeleteDatastore (com.emc.sa.service.vmware.tasks.DeleteDatastore)2 FindDatastore (com.emc.sa.service.vmware.tasks.FindDatastore)2 Datastore (com.vmware.vim25.mo.Datastore)2 HostSystem (com.vmware.vim25.mo.HostSystem)1