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);
}
}
}
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));
}
Aggregations