use of com.iwave.ext.linux.model.PowerPathDevice in project coprhd-controller by CoprHD.
the class PowerPathInquiryParser method parseDevice.
private PowerPathDevice parseDevice(String deviceBlock) {
Matcher deviceMatcher = DEVICE_PATTERN.matcher(deviceBlock);
if (deviceMatcher.find()) {
PowerPathDevice device = new PowerPathDevice();
device.setDevice(deviceMatcher.group(1));
device.setVendor(deviceMatcher.group(2));
device.setProduct(deviceMatcher.group(3));
device.setWwn(deviceMatcher.group(4));
return device;
}
return null;
}
use of com.iwave.ext.linux.model.PowerPathDevice in project coprhd-controller by CoprHD.
the class FindPowerPathEntriesForMountPoint method executeTask.
@Override
public Void executeTask() throws Exception {
List<PowerPathDevice> powerPathDevices = executeCommand(new PowerPathInquiry());
for (VolumeSpec volume : volumes) {
volume.powerpathDevices = Lists.newArrayList();
String device = volume.mountPoint.getDevice();
for (PowerPathDevice powerpathDevice : powerPathDevices) {
logDebug("FindPowerPathEntriesForMountPoint.checking", powerpathDevice.getDeviceName(), powerpathDevice.getDevice(), device);
if (StringUtils.equals(device, powerpathDevice.getDevice())) {
volume.powerpathDevices.add(powerpathDevice);
break;
}
}
if (volume.powerpathDevices.size() == 0) {
logWarn("FindPowerPathEntriesForMountPoint.noDevices", volume.mountPoint.getPath());
}
}
return null;
}
use of com.iwave.ext.linux.model.PowerPathDevice in project coprhd-controller by CoprHD.
the class FindHDiskForVolume method tryExecute.
@Override
protected String tryExecute() {
List<PowerPathDevice> devices = executeCommand(new ListHDisksCommand(usePowerPath, false));
for (PowerPathDevice device : devices) {
if (VolumeWWNUtils.wwnMatches(device.getWwn(), volume.getWwn())) {
return device.getDevice();
}
}
devices = executeCommand(new ListHDisksCommand(usePowerPath, true));
for (PowerPathDevice device : devices) {
if (VolumeWWNUtils.wwnMatches(device.getWwn(), volume.getWwn())) {
return device.getDevice();
}
}
// could not find associated hdisk for volume
throw new HDiskNotFoundException(volume.getWwn());
}
use of com.iwave.ext.linux.model.PowerPathDevice in project coprhd-controller by CoprHD.
the class FindPowerPathEntriesForMountPoint method executeTask.
@Override
public Void executeTask() throws Exception {
List<PowerPathDevice> powerPathDevices = executeCommand(new PowerPathInquiry());
for (VolumeSpec volume : volumes) {
volume.powerpathDevices = Lists.newArrayList();
String device = volume.mountPoint.getDevice();
for (PowerPathDevice powerpathDevice : powerPathDevices) {
if (StringUtils.equals(device, powerpathDevice.getDevice())) {
volume.powerpathDevices.add(powerpathDevice);
break;
}
}
if (volume.powerpathDevices.size() == 0) {
warn("No PowerPath devices for %s", volume.mountPoint.getPath());
}
}
return null;
}
use of com.iwave.ext.linux.model.PowerPathDevice in project coprhd-controller by CoprHD.
the class LinuxSupport method findPowerPathDevices.
public void findPowerPathDevices(List<VolumeSpec> volumes) {
for (VolumeSpec volume : volumes) {
PowerPathDevice device = execute(new FindPowerPathEntryForVolume(volume.viprVolume));
volume.powerpathDevices = Lists.newArrayList(device);
}
}
Aggregations