Search in sources :

Example 6 with DiskDrive

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);
}
Also used : DiskDrive(com.iwave.ext.windows.model.wmi.DiskDrive) Map(java.util.Map) BlockObjectRestRep(com.emc.storageos.model.block.BlockObjectRestRep) Disk(com.iwave.ext.windows.model.Disk)

Example 7 with DiskDrive

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);
    }
}
Also used : DiskDrive(com.iwave.ext.windows.model.wmi.DiskDrive)

Example 8 with 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);
}
Also used : DiskDrive(com.iwave.ext.windows.model.wmi.DiskDrive) BlockObjectRestRep(com.emc.storageos.model.block.BlockObjectRestRep) Map(java.util.Map) Disk(com.iwave.ext.windows.model.Disk)

Example 9 with DiskDrive

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);
    }
}
Also used : DiskDrive(com.iwave.ext.windows.model.wmi.DiskDrive) BlockObjectRestRep(com.emc.storageos.model.block.BlockObjectRestRep) Disk(com.iwave.ext.windows.model.Disk)

Example 10 with DiskDrive

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;
}
Also used : DiskDrive(com.iwave.ext.windows.model.wmi.DiskDrive) BlockObjectRestRep(com.emc.storageos.model.block.BlockObjectRestRep)

Aggregations

DiskDrive (com.iwave.ext.windows.model.wmi.DiskDrive)10 BlockObjectRestRep (com.emc.storageos.model.block.BlockObjectRestRep)7 Disk (com.iwave.ext.windows.model.Disk)4 Map (java.util.Map)2 Volume (com.iwave.ext.windows.model.Volume)1 StrBuilder (org.apache.commons.lang.text.StrBuilder)1 Element (org.w3c.dom.Element)1