Search in sources :

Example 1 with PortMetricsProcessor

use of com.emc.storageos.volumecontroller.impl.plugins.metering.smis.processor.PortMetricsProcessor in project coprhd-controller by CoprHD.

the class PlacementTestUtils method setupSchedulers.

private static PlacementManager setupSchedulers(DbClient dbClient, CoordinatorClient coordinator) {
    PortMetricsProcessor portMetricsProcessor = new PortMetricsProcessor();
    portMetricsProcessor.setDbClient(dbClient);
    portMetricsProcessor.setCoordinator(coordinator);
    PlacementManager placementManager = new PlacementManager();
    placementManager.setDbClient(dbClient);
    Map<String, Scheduler> schedulerMap = new HashMap<String, Scheduler>();
    StorageScheduler storageScheduler = new StorageScheduler();
    storageScheduler.setDbClient(dbClient);
    storageScheduler.setCoordinator(coordinator);
    AttributeMatcherFramework matcherFramework = new AttributeMatcherFramework();
    storageScheduler.setMatcherFramework(matcherFramework);
    storageScheduler.setPortMetricsProcessor(portMetricsProcessor);
    SRDFScheduler srdfScheduler = new SRDFScheduler();
    srdfScheduler.setDbClient(dbClient);
    srdfScheduler.setCoordinator(coordinator);
    srdfScheduler.setBlockScheduler(storageScheduler);
    srdfScheduler._permissionsHelper = new PermissionsHelper(dbClient);
    VPlexScheduler vplexScheduler = new VPlexScheduler();
    vplexScheduler.setDbClient(dbClient);
    vplexScheduler.setBlockScheduler(storageScheduler);
    vplexScheduler.setPlacementManager(placementManager);
    PermissionsHelper permHelperVplex = new PermissionsHelper(dbClient);
    vplexScheduler._permissionsHelper = permHelperVplex;
    RecoverPointScheduler rpScheduler = new RecoverPointScheduler();
    rpScheduler.setDbClient(dbClient);
    rpScheduler.setVplexScheduler(vplexScheduler);
    rpScheduler.setBlockScheduler(storageScheduler);
    PermissionsHelper permHelper = new PermissionsHelper(dbClient);
    rpScheduler._permissionsHelper = permHelper;
    schedulerMap.put("srdf", srdfScheduler);
    schedulerMap.put("vplex", vplexScheduler);
    schedulerMap.put("block", storageScheduler);
    schedulerMap.put("rp", rpScheduler);
    placementManager.setStorageSchedulers(schedulerMap);
    // Set up the new schedulerStack.
    List<String> schedulerStack = new ArrayList<String>();
    schedulerStack.add("rp");
    schedulerStack.add("vplex");
    schedulerStack.add("srdf");
    schedulerStack.add("block");
    placementManager.setSchedulerStack(schedulerStack);
    return placementManager;
}
Also used : HashMap(java.util.HashMap) ArrayList(java.util.ArrayList) PermissionsHelper(com.emc.storageos.api.service.authorization.PermissionsHelper) PortMetricsProcessor(com.emc.storageos.volumecontroller.impl.plugins.metering.smis.processor.PortMetricsProcessor) AttributeMatcherFramework(com.emc.storageos.volumecontroller.impl.utils.AttributeMatcherFramework)

Example 2 with PortMetricsProcessor

use of com.emc.storageos.volumecontroller.impl.plugins.metering.smis.processor.PortMetricsProcessor in project coprhd-controller by CoprHD.

the class VPlexMeteringTest method mockPortMetricsProcessor.

private PortMetricsProcessor mockPortMetricsProcessor(MockDbClient mockDbClient) {
    CustomConfigHandler customConfigHandler = new MockCustomConfigHandler();
    customConfigHandler.setDbClient(mockDbClient);
    PortMetricsProcessor portMetricsProcessor = new PortMetricsProcessor();
    portMetricsProcessor.setDbClient(mockDbClient);
    portMetricsProcessor.setCustomConfigHandler(customConfigHandler);
    return portMetricsProcessor;
}
Also used : CustomConfigHandler(com.emc.storageos.customconfigcontroller.impl.CustomConfigHandler) PortMetricsProcessor(com.emc.storageos.volumecontroller.impl.plugins.metering.smis.processor.PortMetricsProcessor)

Example 3 with PortMetricsProcessor

use of com.emc.storageos.volumecontroller.impl.plugins.metering.smis.processor.PortMetricsProcessor in project coprhd-controller by CoprHD.

the class VPlexMeteringTest method testVPlexPerpetualCSVFileCollector.

@Test
public void testVPlexPerpetualCSVFileCollector() throws InstantiationException, IllegalAccessException {
    MockDbClient mockDbClient = new MockDbClient();
    mockStorageDriverManager();
    StorageSystem storageSystem = mockStorageSystem("vplex-1", "000123ABC000XYZ");
    mockDbClient.MOCK_DB.put(storageSystem.getId(), storageSystem);
    int directorIndex = 1;
    String[] directors = DIRECTORS.split(",");
    for (String directorName : directors) {
        int adapterIndex = (directorIndex % 2);
        String aOrB = directorName.substring(directorName.length() - 1);
        String adapterSerial = String.format("CF23K00000%d%d", directorIndex, adapterIndex);
        StorageHADomain director = mockVPlexAdapter(storageSystem, directorName, adapterSerial);
        mockDbClient.MOCK_DB.put(director.getId(), director);
        for (int cpuIndex = 0; cpuIndex < 2; cpuIndex++) {
            for (int portIndex = 0; portIndex < PORT_PER_DIRECTOR; portIndex++) {
                String portName = String.format("%s%d-FC%02d", aOrB, cpuIndex, portIndex);
                String wwn = String.format("5C:CC:DD:EE:FF:00:%02d:%02d", directorIndex, portIndex);
                StoragePort port = mockStoragePort(director, portName, wwn, adapterSerial);
                mockDbClient.MOCK_DB.put(port.getId(), port);
            }
        }
        directorIndex++;
    }
    AccessProfile accessProfile = new AccessProfile();
    accessProfile.setIpAddress(HOST);
    accessProfile.setUserName(USERNAME);
    accessProfile.setPassword(PASSWORD);
    accessProfile.setSystemId(storageSystem.getId());
    Map<String, Object> context = new HashMap<>();
    context.put(Constants.dbClient, mockDbClient);
    context.put(Constants._Stats, new LinkedList<Stat>());
    context.put(Constants._TimeCollected, System.currentTimeMillis());
    VPlexPerpetualCSVFileCollector collector = new VPlexPerpetualCSVFileCollector();
    PortMetricsProcessor portMetricsProcessor = mockPortMetricsProcessor(mockDbClient);
    collector.setPortMetricsProcessor(portMetricsProcessor);
    collector.collect(accessProfile, context);
}
Also used : HashMap(java.util.HashMap) StoragePort(com.emc.storageos.db.client.model.StoragePort) AccessProfile(com.emc.storageos.plugins.AccessProfile) Constraint(com.emc.storageos.db.client.constraint.Constraint) Stat(com.emc.storageos.db.client.model.Stat) PortMetricsProcessor(com.emc.storageos.volumecontroller.impl.plugins.metering.smis.processor.PortMetricsProcessor) DataObject(com.emc.storageos.db.client.model.DataObject) DiscoveredDataObject(com.emc.storageos.db.client.model.DiscoveredDataObject) StorageHADomain(com.emc.storageos.db.client.model.StorageHADomain) VPlexPerpetualCSVFileCollector(com.emc.storageos.volumecontroller.impl.plugins.metering.vplex.VPlexPerpetualCSVFileCollector) StorageSystem(com.emc.storageos.db.client.model.StorageSystem) Test(org.junit.Test)

Aggregations

PortMetricsProcessor (com.emc.storageos.volumecontroller.impl.plugins.metering.smis.processor.PortMetricsProcessor)3 HashMap (java.util.HashMap)2 PermissionsHelper (com.emc.storageos.api.service.authorization.PermissionsHelper)1 CustomConfigHandler (com.emc.storageos.customconfigcontroller.impl.CustomConfigHandler)1 Constraint (com.emc.storageos.db.client.constraint.Constraint)1 DataObject (com.emc.storageos.db.client.model.DataObject)1 DiscoveredDataObject (com.emc.storageos.db.client.model.DiscoveredDataObject)1 Stat (com.emc.storageos.db.client.model.Stat)1 StorageHADomain (com.emc.storageos.db.client.model.StorageHADomain)1 StoragePort (com.emc.storageos.db.client.model.StoragePort)1 StorageSystem (com.emc.storageos.db.client.model.StorageSystem)1 AccessProfile (com.emc.storageos.plugins.AccessProfile)1 VPlexPerpetualCSVFileCollector (com.emc.storageos.volumecontroller.impl.plugins.metering.vplex.VPlexPerpetualCSVFileCollector)1 AttributeMatcherFramework (com.emc.storageos.volumecontroller.impl.utils.AttributeMatcherFramework)1 ArrayList (java.util.ArrayList)1 Test (org.junit.Test)1