Search in sources :

Example 1 with MountDatastore

use of com.emc.sa.service.vmware.block.tasks.MountDatastore in project coprhd-controller by CoprHD.

the class VMwareSupport method mountDatastores.

/**
 * Mount datastores that are backed by the list of volumes
 *
 * @param host the host to mount the datastore on, or null if cluster is being used
 * @param cluster the cluster to mount the datastore on, or null if host is being used
 * @param datacenterName name of the datacenter
 * @param volumeIds the list of volumes
 * @throws Exception thrown if an error occurs
 */
public void mountDatastores(HostSystem host, ClusterComputeResource cluster, String datacenterName, List<URI> volumeIds) throws Exception {
    List<HostSystem> hosts = cluster == null ? Lists.newArrayList(host) : Lists.newArrayList(cluster.getHosts());
    rescanVmfs(hosts);
    for (URI volumeId : volumeIds) {
        BlockObjectRestRep volume = BlockStorageUtils.getVolume(volumeId);
        Set<String> datastoreNames = VMwareDatastoreTagger.getDatastoreNames(volume);
        for (String datastoreName : datastoreNames) {
            Datastore datastore = getDatastore(datacenterName, datastoreName);
            mountDatastore(datastore, hosts);
        }
    }
}
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) URI(java.net.URI) BlockObjectRestRep(com.emc.storageos.model.block.BlockObjectRestRep)

Example 2 with MountDatastore

use of com.emc.sa.service.vmware.block.tasks.MountDatastore in project coprhd-controller by CoprHD.

the class VMwareSupport method unmountVmfsDatastore.

public void unmountVmfsDatastore(HostSystem host, Datastore datastore) {
    execute(new UnmountVmfsDatastore(host, datastore));
    addRollback(new MountDatastore(host, datastore));
}
Also used : UnmountVmfsDatastore(com.emc.sa.service.vmware.block.tasks.UnmountVmfsDatastore) MountDatastore(com.emc.sa.service.vmware.block.tasks.MountDatastore)

Aggregations

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