Search in sources :

Example 46 with AccessProfile

use of com.emc.storageos.plugins.AccessProfile in project coprhd-controller by CoprHD.

the class SMICommunicationInterfaceTest method testXIVBlockPlugin.

// Need to start coordinator & DB service, before running this test
@Test
public void testXIVBlockPlugin() {
    StorageProvider provider = createXIVProvider();
    try {
        Map<String, Object> cache = new ConcurrentHashMap<String, Object>();
        Set<String> idset = new HashSet<String>();
        idset.add("SYMMETRIX+000194900404+VOLUME+00000");
        cache.put("000194900404-block-Volumes", idset);
        xiv.injectCache(cache);
        xiv.injectDBClient(_dbClient);
        xiv.injectCoordinatorClient(coordinator);
        // scanTest(_smiplugin);
        AccessProfile profile = populateSMISAccessProfile(provider);
        verifyDB(profile);
        Map<String, StorageSystemViewObject> storageSystemsCache = Collections.synchronizedMap(new HashMap<String, StorageSystemViewObject>());
        profile.setCache(storageSystemsCache);
        xiv.scan(profile);
        DataCollectionJobUtil util = new DataCollectionJobUtil();
        util.setDbClient(_dbClient);
        util.setConfigInfo(configinfo);
        List<URI> providerList = new ArrayList<URI>();
        providerList.add(provider.getId());
        util.performBookKeeping(storageSystemsCache, providerList);
        // provider.getStorageSystems();
        // profile.setSystemId(provider.getSystemId());
        profile.setserialID(profile.getserialID());
        xiv.discover(profile);
    } catch (Exception e) {
        _LOGGER.error(e.getMessage(), e);
    }
}
Also used : StorageSystemViewObject(com.emc.storageos.plugins.StorageSystemViewObject) ArrayList(java.util.ArrayList) AccessProfile(com.emc.storageos.plugins.AccessProfile) DataCollectionJobUtil(com.emc.storageos.volumecontroller.impl.plugins.discovery.smis.DataCollectionJobUtil) URI(java.net.URI) BaseCollectionException(com.emc.storageos.plugins.BaseCollectionException) StorageSystemViewObject(com.emc.storageos.plugins.StorageSystemViewObject) ConcurrentHashMap(java.util.concurrent.ConcurrentHashMap) HashSet(java.util.HashSet) Test(org.junit.Test)

Example 47 with AccessProfile

use of com.emc.storageos.plugins.AccessProfile in project coprhd-controller by CoprHD.

the class SMICommunicationInterfaceTest method populateSMISAccessProfile.

private AccessProfile populateSMISAccessProfile(StorageProvider provider) {
    AccessProfile _profile = new AccessProfile();
    _profile.setSystemId(provider.getId());
    _profile.setSystemClazz(provider.getClass());
    _profile.setIpAddress(provider.getIPAddress());
    _profile.setUserName(provider.getUserName());
    _profile.setPassword(provider.getPassword());
    _profile.setSystemType(Type.ibmxiv.name());
    _profile.setProviderPort(String.valueOf(provider.getPortNumber()));
    _profile.setSslEnable(String.valueOf(provider.getUseSSL()));
    _profile.setInteropNamespace(Constants.INTEROP);
    _profile.setProps(configinfo);
    _profile.setCimConnectionFactory(cimConnectionFactory);
    return _profile;
}
Also used : AccessProfile(com.emc.storageos.plugins.AccessProfile)

Example 48 with AccessProfile

use of com.emc.storageos.plugins.AccessProfile in project coprhd-controller by CoprHD.

the class SMICommunicationInterfaceTest method createXIVAccessProfile.

private AccessProfile createXIVAccessProfile() {
    AccessProfile _profile = new AccessProfile();
    _profile.setInteropNamespace(providerNamespace);
    _profile.setIpAddress(providerIP);
    _profile.setUserName(providerUser);
    _profile.setPassword(providerPassword);
    _profile.setProviderPort(String.valueOf(providerPort));
    // _profile.setnamespace("Performance");
    _profile.setelementType("Array");
    _profile.setSslEnable(String.valueOf(isProviderSslEnabled));
    return _profile;
}
Also used : AccessProfile(com.emc.storageos.plugins.AccessProfile)

Example 49 with AccessProfile

use of com.emc.storageos.plugins.AccessProfile 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

AccessProfile (com.emc.storageos.plugins.AccessProfile)49 BaseCollectionException (com.emc.storageos.plugins.BaseCollectionException)33 StorageSystem (com.emc.storageos.db.client.model.StorageSystem)30 Iterator (java.util.Iterator)25 CIMInstance (javax.cim.CIMInstance)24 CIMObjectPath (javax.cim.CIMObjectPath)16 URI (java.net.URI)14 DbClient (com.emc.storageos.db.client.DbClient)12 List (java.util.List)11 IOException (java.io.IOException)9 ArrayList (java.util.ArrayList)9 Map (java.util.Map)9 Stat (com.emc.storageos.db.client.model.Stat)8 StoragePool (com.emc.storageos.db.client.model.StoragePool)7 SMIPluginException (com.emc.storageos.plugins.metering.smis.SMIPluginException)7 StoragePort (com.emc.storageos.db.client.model.StoragePort)6 URIQueryResultList (com.emc.storageos.db.client.constraint.URIQueryResultList)5 HashMap (java.util.HashMap)5 HashSet (java.util.HashSet)5 CIMArgument (javax.cim.CIMArgument)4