use of com.emc.storageos.model.block.BlockObjectRestRep in project coprhd-controller by CoprHD.
the class UnmountBlockVolumeHelper method unmountVolumes.
public void unmountVolumes() {
Set<URI> untaggedVolumeIds = Sets.newHashSet();
for (VolumeSpec volume : volumes) {
aixSupport.unmount(volume.mountPoint.getPath());
// remove mount point tag from all volumes for this mount point
for (BlockObjectRestRep mountedVolume : volume.relatedVolumes) {
aixSupport.removeVolumeMountPointTag(mountedVolume);
untaggedVolumeIds.add(mountedVolume.getId());
}
if (usePowerPath) {
aixSupport.removePowerPathDevices(volume.powerpathDevices);
}
// delete the directory entry if it's empty
if (aixSupport.isDirectoryEmpty(volume.mountPoint.getPath())) {
aixSupport.deleteDirectory(volume.mountPoint.getPath());
}
aixSupport.removeFromFilesystemsConfig(volume.mountPoint.getPath());
}
// Ensure all volumes have had their mount point tag removed
for (VolumeSpec volume : volumes) {
if (untaggedVolumeIds.add(volume.viprVolume.getId())) {
aixSupport.removeVolumeMountPointTag(volume.viprVolume);
}
}
}
use of com.emc.storageos.model.block.BlockObjectRestRep in project coprhd-controller by CoprHD.
the class UnmountBlockVolumeHelper method unmountVolumes.
public void unmountVolumes() {
Set<URI> untaggedVolumeIds = Sets.newHashSet();
for (VolumeSpec volume : volumes) {
// unmount the volume
linux.unmountPath(volume.mountPoint.getPath());
// remove from fstab
linux.removeFromFSTab(volume.mountPoint);
// remove mount point tag from all volumes for this mount point
for (BlockObjectRestRep mountedVolume : volume.relatedVolumes) {
linux.removeVolumeMountPointTag(mountedVolume);
untaggedVolumeIds.add(mountedVolume.getId());
}
// delete the directory entry if it's empty
if (linux.isDirectoryEmpty(volume.mountPoint.getPath())) {
linux.deleteDirectory(volume.mountPoint.getPath());
}
}
// Ensure all volumes have had their mount point tag removed
for (VolumeSpec volume : volumes) {
if (untaggedVolumeIds.add(volume.viprVolume.getId())) {
linux.removeVolumeMountPointTag(volume.viprVolume);
}
}
}
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);
}
}
}
}
use of com.emc.storageos.model.block.BlockObjectRestRep in project coprhd-controller by CoprHD.
the class CreateAndMountVolumeService method execute.
@Override
public void execute() throws Exception {
BlockObjectRestRep volume = createVolume();
acquireHostsLock();
refreshStorage(volume);
artificialFailure(ArtificialFailures.ARTIFICIAL_FAILURE_LINUX_MOUNT_VOLUME);
mountVolume(volume);
}
use of com.emc.storageos.model.block.BlockObjectRestRep in project coprhd-controller by CoprHD.
the class BlockStorageUtils method isVMAXUsePortGroupEnabled.
public static boolean isVMAXUsePortGroupEnabled(URI resourceId) {
SimpleValueRep value = execute(new GetVMAXUsePortGroupEnabledConfig());
if (value.getValue().equalsIgnoreCase("true")) {
if (ResourceType.isType(ResourceType.VOLUME, resourceId)) {
BlockObjectRestRep obj = getVolume(resourceId);
if (obj instanceof VolumeRestRep) {
VolumeRestRep volume = (VolumeRestRep) obj;
boolean isVMAX = StringUtils.equalsIgnoreCase(volume.getSystemType(), DiscoveredDataObject.Type.vmax.name()) || StringUtils.equalsIgnoreCase(volume.getSystemType(), DiscoveredDataObject.Type.vmax3.name());
boolean isRPOrVPlex = isVplexOrRPVolume(volume);
if (isVMAX && !isRPOrVPlex) {
return true;
}
}
if (obj instanceof BlockSnapshotRestRep) {
BlockSnapshotRestRep snapshot = (BlockSnapshotRestRep) obj;
BlockObjectRestRep parent = getVolume(snapshot.getParent().getId());
if (parent instanceof VolumeRestRep) {
VolumeRestRep volume = (VolumeRestRep) obj;
if (StringUtils.equalsIgnoreCase(volume.getSystemType(), DiscoveredDataObject.Type.vmax.name()) || StringUtils.equalsIgnoreCase(volume.getSystemType(), DiscoveredDataObject.Type.vmax3.name())) {
return true;
}
}
if (parent instanceof BlockMirrorRestRep) {
BlockMirrorRestRep mirror = (BlockMirrorRestRep) obj;
if (StringUtils.equalsIgnoreCase(mirror.getSystemType(), DiscoveredDataObject.Type.vmax.name()) || StringUtils.equalsIgnoreCase(mirror.getSystemType(), DiscoveredDataObject.Type.vmax3.name())) {
return true;
}
}
}
if (obj instanceof BlockMirrorRestRep) {
BlockMirrorRestRep mirror = (BlockMirrorRestRep) obj;
if (StringUtils.equalsIgnoreCase(mirror.getSystemType(), DiscoveredDataObject.Type.vmax.name()) || StringUtils.equalsIgnoreCase(mirror.getSystemType(), DiscoveredDataObject.Type.vmax3.name())) {
return true;
}
}
}
if (ResourceType.isType(ResourceType.VIRTUAL_POOL, resourceId)) {
BlockVirtualPoolRestRep virtualPool = execute(new GetBlockVirtualPool(resourceId));
boolean isVMAX = StringUtils.equalsIgnoreCase(virtualPool.getSystemType(), DiscoveredDataObject.Type.vmax.name()) || StringUtils.equalsIgnoreCase(virtualPool.getSystemType(), DiscoveredDataObject.Type.vmax3.name());
boolean isVPLEX = virtualPool.getHighAvailability() != null;
if (isVMAX && !isVPLEX) {
return true;
}
}
}
return false;
}
Aggregations