use of com.emc.storageos.model.varray.VirtualArrayRestRep in project coprhd-controller by CoprHD.
the class FailoverBlockVolumeService method precheck.
@Override
public void precheck() {
String sourceId = "";
String targetId = "";
String targetName = "";
String sourceName = "";
if (ConsistencyUtils.isVolumeStorageType(storageType)) {
// The type selected is volume
BlockObjectRestRep targetVolume = BlockStorageUtils.getVolume(protectionTarget);
BlockObjectRestRep sourceVolume = BlockStorageUtils.getVolume(protectionSource);
type = BlockStorageUtils.getFailoverType(targetVolume);
targetId = stringId(targetVolume);
targetName = targetVolume.getName();
sourceId = stringId(sourceVolume);
sourceName = sourceVolume.getName();
} else {
// The type selected is consistency group
BlockConsistencyGroupRestRep cg = BlockStorageUtils.getBlockConsistencyGroup(protectionSource);
VirtualArrayRestRep virtualArray = BlockStorageUtils.getVirtualArray(protectionTarget);
type = ConsistencyUtils.getFailoverType(cg);
targetId = stringId(virtualArray);
targetName = virtualArray.getName();
sourceId = stringId(cg);
sourceName = cg.getName();
}
if (type == null) {
ExecutionUtils.fail("failTask.FailoverBlockVolumeService", args(sourceId, targetId), args());
}
if (type.equals(RECOVER_POINT) && BlockProvider.PIT_IMAGE_OPTION_KEY.equals(imageToAccess) && pointInTime == null) {
ExecutionUtils.fail("failTask.FailoverBlockVolumeService.pit", new Object[] {}, new Object[] {});
}
// TODO: Add new fields
logInfo("fail.over.block.volume.service", type.toUpperCase(), sourceName, targetName);
}
use of com.emc.storageos.model.varray.VirtualArrayRestRep in project coprhd-controller by CoprHD.
the class FileVirtualPools method listReplicationVirtualArraysJson.
public static void listReplicationVirtualArraysJson(FileVirtualPoolForm vpool) {
if (vpool == null) {
renderJSON(Collections.emptyList());
}
vpool.deserialize();
List<StringOption> actualOptions = Lists.newArrayList();
List<VirtualArrayRestRep> virtualArrays = VirtualArrayUtils.getVirtualArrays();
for (StringOption option : dataObjectOptions(virtualArrays)) {
actualOptions.add(option);
}
renderJSON(actualOptions);
}
use of com.emc.storageos.model.varray.VirtualArrayRestRep in project coprhd-controller by CoprHD.
the class BlockVirtualPools method createAllFlashAuto.
/**
* This method create virtual pool according to storage system types
* @param types : List of storage system types discovered
*/
public static void createAllFlashAuto(List<String> types) {
List<String> vaIds4allflash = new ArrayList<String>();
List<String> vaIds4vmax = new ArrayList<String>();
List<String> vaIds4xio = new ArrayList<String>();
List<String> vaIds4unity = new ArrayList<String>();
JsonArray vpools = new JsonArray();
// Read cookies for storage systems and virtual pools
JsonObject dataObject = getCookieAsJson(GUIDE_DATA);
if (dataObject != null) {
JsonArray varrays = dataObject.getAsJsonArray(VARRAYS);
if (varrays != null) {
for (Object varray : varrays) {
JsonObject jsonvarray = (JsonObject) varray;
String varrayid = jsonvarray.get("id").getAsString();
// Check virtual array first
VirtualArrayRestRep varrayRest = VirtualArrayUtils.getVirtualArray(varrayid);
if (varrayRest != null) {
// Get virtual array attributes
Map<String, Set<String>> attributes = VirtualArrayUtils.getAvailableAttributes(uris(varrayid));
Set<String> system_type = attributes.get(ATTRIBUTE_SYSTEM_TYPES);
if (system_type != null && !system_type.isEmpty()) {
if (system_type.size() > 1) {
vaIds4allflash.add(varrayid);
} else {
// It has one system type
for (String vasystemtype : system_type) {
if (StringUtils.equals(UNITY, vasystemtype)) {
vaIds4unity.add(varrayid);
}
if (StringUtils.equals(VMAX, vasystemtype)) {
vaIds4vmax.add(varrayid);
}
if (StringUtils.equals(XTREMIO, vasystemtype)) {
vaIds4xio.add(varrayid);
}
}
}
} else {
// Control should not reach here but let add in all flash
vaIds4allflash.add(varrayid);
}
}
}
}
}
if (!vaIds4allflash.isEmpty()) {
Map<String, String> virtualpoolAllFlashMap = allFlashVirtualPool();
String vpid = virtualpoolAllFlashMap.get(VP_ALL_FLASH);
if (vpid != null) {
BlockVirtualPoolRestRep blockvpool = VirtualPoolUtils.getBlockVirtualPool(vpid);
List<RelatedResourceRep> virtualarrays = blockvpool.getVirtualArrays();
for (String vaid : vaIds4allflash) {
RelatedResourceRep newVaId = new RelatedResourceRep();
newVaId.setId(URI.create(vaid));
virtualarrays.add(newVaId);
}
blockvpool.setVirtualArrays(virtualarrays);
updateAutoVirtualPool(vpid, blockvpool, vpools);
} else {
createBaseVPool(VP_ALL_FLASH, StorageSystemTypes.NONE, vaIds4allflash, Messages.get("gettingStarted.vpool.allflash.desc"), vpools);
}
}
if (!vaIds4vmax.isEmpty()) {
Map<String, String> virtualpoolAllFlashMap = allFlashVirtualPool();
// Check if we should add in existing compressed vpool
boolean isCompression = isCompressionEnable(vaIds4vmax);
String vpid = virtualpoolAllFlashMap.get(VP_VMAX_DIAMOND);
if (vpid != null && !isCompression) {
BlockVirtualPoolRestRep blockvpool = VirtualPoolUtils.getBlockVirtualPool(vpid);
List<RelatedResourceRep> virtualarrays = blockvpool.getVirtualArrays();
for (String vaid : vaIds4vmax) {
RelatedResourceRep newVaId = new RelatedResourceRep();
newVaId.setId(URI.create(vaid));
virtualarrays.add(newVaId);
}
blockvpool.setVirtualArrays(virtualarrays);
updateAutoVirtualPool(vpid, blockvpool, vpools);
} else {
// Check compressed vpool
vpid = virtualpoolAllFlashMap.get(VP_VMAX_DIAMOND_COMPRESSED);
if (vpid != null && isCompression) {
BlockVirtualPoolRestRep blockvpool = VirtualPoolUtils.getBlockVirtualPool(vpid);
List<RelatedResourceRep> virtualarrays = blockvpool.getVirtualArrays();
for (String vaid : vaIds4vmax) {
RelatedResourceRep newVaId = new RelatedResourceRep();
newVaId.setId(URI.create(vaid));
virtualarrays.add(newVaId);
}
blockvpool.setVirtualArrays(virtualarrays);
updateAutoVirtualPool(vpid, blockvpool, vpools);
} else {
createBaseVPool(VP_VMAX_DIAMOND, StorageSystemTypes.VMAX, vaIds4vmax, Messages.get("gettingStarted.vpool.vmax.desc"), vpools);
}
}
}
if (!vaIds4xio.isEmpty()) {
Map<String, String> virtualpoolAllFlashMap = allFlashVirtualPool();
String vpid = virtualpoolAllFlashMap.get(VP_XIO_DIAMOND);
if (vpid != null) {
BlockVirtualPoolRestRep blockvpool = VirtualPoolUtils.getBlockVirtualPool(vpid);
List<RelatedResourceRep> virtualarrays = blockvpool.getVirtualArrays();
for (String vaid : vaIds4xio) {
RelatedResourceRep newVaId = new RelatedResourceRep();
newVaId.setId(URI.create(vaid));
virtualarrays.add(newVaId);
}
blockvpool.setVirtualArrays(virtualarrays);
updateAutoVirtualPool(vpid, blockvpool, vpools);
} else {
createBaseVPool(VP_XIO_DIAMOND, StorageSystemTypes.XTREMIO, vaIds4xio, Messages.get("gettingStarted.vpool.xio.desc"), vpools);
}
}
if (!vaIds4unity.isEmpty()) {
Map<String, String> virtualpoolAllFlashMap = allFlashVirtualPool();
String vpid = virtualpoolAllFlashMap.get(VP_UNITY_DIAMOND);
if (vpid != null) {
BlockVirtualPoolRestRep blockvpool = VirtualPoolUtils.getBlockVirtualPool(vpid);
List<RelatedResourceRep> virtualarrays = blockvpool.getVirtualArrays();
for (String vaid : vaIds4unity) {
RelatedResourceRep newVaId = new RelatedResourceRep();
newVaId.setId(URI.create(vaid));
virtualarrays.add(newVaId);
}
blockvpool.setVirtualArrays(virtualarrays);
updateAutoVirtualPool(vpid, blockvpool, vpools);
} else {
createBaseVPool(VP_UNITY_DIAMOND, StorageSystemTypes.UNITY, vaIds4unity, Messages.get("gettingStarted.vpool.unity.desc"), vpools);
}
}
dataObject.add(VPOOL_COOKIES, vpools);
saveJsonAsCookie(GUIDE_DATA, dataObject);
list();
}
use of com.emc.storageos.model.varray.VirtualArrayRestRep in project coprhd-controller by CoprHD.
the class VirtualArrays method createVirtualArray.
private static void createVirtualArray(StorageSystemRestRep storageSystem) {
// Check for existing virtual array
String vArrayName = VARRAY_PREFIX + storageSystem.getName();
List<VirtualArrayRestRep> availVarrays = VirtualArrayUtils.getVirtualArrays();
for (VirtualArrayRestRep availVarray : availVarrays) {
if (StringUtils.equals(availVarray.getName(), vArrayName)) {
Calendar localCalendar = Calendar.getInstance();
// Made time in seconds for name length
long currTime = localCalendar.getTimeInMillis() / 1000;
vArrayName = vArrayName + VARRAY_POSTFIX + currTime;
break;
}
}
VirtualArrayForm virtualArray = new VirtualArrayForm();
virtualArray.name = vArrayName;
VirtualArrayRestRep varray = virtualArray.save();
virtualArray.load(varray);
addVarrayStorageSystem(virtualArray.id, storageSystem.getId().toString());
updateVarrayCookie(virtualArray.id, virtualArray.name);
}
use of com.emc.storageos.model.varray.VirtualArrayRestRep in project coprhd-controller by CoprHD.
the class VirtualArrays method storagePorts.
/**
* Displays the storage ports page for the given virtual array.
*
* @param id
* the virtual array ID.
*/
public static void storagePorts(String id) {
VirtualArrayRestRep virtualArray = getVirtualArray(id);
VirtualArrayStoragePortsDataTable dataTable = new VirtualArrayStoragePortsDataTable();
render(virtualArray, dataTable);
}
Aggregations