use of com.iwave.ext.windows.model.wmi.DiskDrive 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();
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.iwave.ext.windows.model.wmi.DiskDrive in project coprhd-controller by CoprHD.
the class MountBlockVolumeService method execute.
@Override
public void execute() throws Exception {
exportBlockVolumeHelper.exportVolumes();
acquireHostAndClusterLock();
volume = BlockStorageUtils.getBlockResource(uri(volumeId));
// Only perform mounting/formatting on ONE host
DiskDrive diskDrive = mountBlockVolumeHelpers.get(0).mountVolume(volume);
if (isClustered()) {
for (int i = 1; i < mountBlockVolumeHelpers.size(); i++) {
mountBlockVolumeHelpers.get(i).rescanDisks();
}
mountBlockVolumeHelpers.get(0).addDiskToCluster(diskDrive);
}
}
use of com.iwave.ext.windows.model.wmi.DiskDrive in project coprhd-controller by CoprHD.
the class UnmountBlockVolumeHelper method precheck.
public void precheck() {
windows.verifyWinRM();
windows.verifyVolumesMounted(volumes);
volume2disk = windows.findDisks(volumes);
// Get the actual mount points for the volumes from the system
Map<BlockObjectRestRep, String> volume2mountPoint = Maps.newHashMap();
for (Map.Entry<? extends BlockObjectRestRep, DiskDrive> entry : volume2disk.entrySet()) {
BlockObjectRestRep volume = entry.getKey();
DiskDrive disk = entry.getValue();
Disk detail = windows.getDiskDetail(disk);
String mountPoint = ExtendDriveHelper.getMountPoint(disk, detail);
volume2mountPoint.put(volume, mountPoint);
}
WindowsUtils.verifyMountPoints(hostId, volume2mountPoint);
}
use of com.iwave.ext.windows.model.wmi.DiskDrive in project coprhd-controller by CoprHD.
the class UnmountBlockVolumeHelper method removeVolumesFromCluster.
public void removeVolumesFromCluster() {
Map<String, String> diskToResourceMap = windows.getDiskToResourceMap();
for (BlockObjectRestRep volume : volumes) {
DiskDrive diskDrive = volume2disk.get(volume);
Disk diskDetail = windows.getDiskDetail(diskDrive);
String resourceName = "";
if (windows.isGuid(diskDetail.getDiskId())) {
resourceName = diskToResourceMap.get(diskDetail.getDiskId());
} else {
resourceName = diskToResourceMap.get(diskDrive.getSignature());
}
windows.offlineClusterResource(resourceName);
windows.deleteClusterResource(resourceName);
}
}
use of com.iwave.ext.windows.model.wmi.DiskDrive 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;
}
Aggregations