use of com.emc.storageos.model.block.BlockObjectRestRep in project coprhd-controller by CoprHD.
the class ExtendDriveHelper method precheck.
public void precheck() {
windows.verifyWinRM();
volume2disk = windows.findDisks(volumes);
// Get the actual mount points for the volumes from the system
volume2mountPoint = Maps.newHashMap();
for (Map.Entry<? extends BlockObjectRestRep, DiskDrive> entry : volume2disk.entrySet()) {
BlockObjectRestRep volume = entry.getKey();
DiskDrive disk = entry.getValue();
if (volumeExpandSizeGB != null && BlockStorageUtils.isViprVolumeExpanded(volume, volumeExpandSizeGB)) {
ExecutionUtils.fail("expand.win.fail", new Object[] {}, volume.getName(), BlockStorageUtils.getCapacity(volume));
}
logInfo("extendDrive.diskVolumeOnHost", disk.getNumber(), windows.getHostName());
Disk detail = windows.getDiskDetail(disk);
if (windows.isClustered()) {
if (isDiskVolumeOnHost(detail)) {
// host in cluster and found
foundClusteredVolume = true;
} else {
// host in cluster and not found, don't process
continue;
}
}
windows.checkPartitionRestriction(disk, volumeSizeInBytes);
String mountPoint = getMountPoint(disk, detail);
logInfo("extendDrive.volumeMountPoint", volume.getName(), mountPoint);
volume2mountPoint.put(volume, mountPoint);
}
WindowsUtils.verifyMountPoints(hostId, volume2mountPoint);
}
use of com.emc.storageos.model.block.BlockObjectRestRep in project coprhd-controller by CoprHD.
the class FindDisksForVolumes method findDisksForVolumes.
protected Map<BlockObjectRestRep, DiskDrive> findDisksForVolumes() throws WinRMException {
Map<BlockObjectRestRep, DiskDrive> results = Maps.newHashMap();
List<DiskDrive> disks = getTargetSystem().listDiskDrives();
for (DiskDrive disk : disks) {
String wwid = getTargetSystem().getWwid(disk);
logDebug("find.disks.volumes.wwid", wwid, disk.getDeviceId());
for (BlockObjectRestRep volume : volumes) {
if (VolumeWWNUtils.wwnMatches(wwid, volume.getWwn())) {
logInfo("find.disks.volumes.wwid", wwid, disk.getSerialNumber());
results.put(volume, disk);
break;
}
}
}
return results;
}
use of com.emc.storageos.model.block.BlockObjectRestRep in project coprhd-controller by CoprHD.
the class BlockProvider method getVirtualArrayIds.
private static List<URI> getVirtualArrayIds(Collection<? extends BlockObjectRestRep> blockObjects) {
List<URI> varrayIds = Lists.newArrayList();
for (BlockObjectRestRep blockObject : blockObjects) {
if (blockObject instanceof VolumeRestRep) {
VolumeRestRep volume = (VolumeRestRep) blockObject;
varrayIds.add(volume.getVirtualArray().getId());
}
}
return varrayIds;
}
use of com.emc.storageos.model.block.BlockObjectRestRep in project coprhd-controller by CoprHD.
the class BlockProviderUtils method getBlockResources.
public static List<? extends BlockObjectRestRep> getBlockResources(ViPRCoreClient viprClient, URI tenantId, URI hostOrClusterId, boolean onlyMounted) {
List<URI> hostIds = buildHostIdsList(viprClient, hostOrClusterId, onlyMounted);
List<BlockObjectRestRep> volumes = Lists.newArrayList();
for (BlockObjectRestRep volume : getExportedBlockResources(viprClient, tenantId, hostOrClusterId)) {
boolean isMounted = isMounted(hostIds, volume);
if (onlyMounted && isMounted) {
volumes.add(volume);
} else if (!onlyMounted && !isMounted) {
volumes.add(volume);
}
}
return volumes;
}
use of com.emc.storageos.model.block.BlockObjectRestRep in project coprhd-controller by CoprHD.
the class UnmountBlockVolumeHelper method findRelatedVolumes.
/**
* Finds the volumes related to the mount points selected. When a mount point is removed, all related volumes have
* to have their mount point tags removed.
*/
private void findRelatedVolumes() {
for (VolumeSpec volume : volumes) {
volume.relatedVolumes = Lists.newArrayList();
Set<String> volumeWwns = getVolumeWwns(volume);
for (String relatedWwn : volumeWwns) {
BlockObjectRestRep related = findVolumeRestRepByWwn(relatedWwn);
if (related == null) {
related = BlockStorageUtils.getVolumeByWWN(relatedWwn);
}
if (related != null) {
volume.relatedVolumes.add(related);
}
}
}
}
Aggregations