Search in sources :

Example 1 with HypervisorHostListener

use of org.apache.cloudstack.engine.subsystem.api.storage.HypervisorHostListener in project cloudstack by apache.

the class StorageManagerImpl method connectHostToSharedPool.

@Override
public void connectHostToSharedPool(long hostId, long poolId) throws StorageUnavailableException, StorageConflictException {
    StoragePool pool = (StoragePool) _dataStoreMgr.getDataStore(poolId, DataStoreRole.Primary);
    assert (pool.isShared()) : "Now, did you actually read the name of this method?";
    s_logger.debug("Adding pool " + pool.getName() + " to  host " + hostId);
    DataStoreProvider provider = _dataStoreProviderMgr.getDataStoreProvider(pool.getStorageProviderName());
    HypervisorHostListener listener = hostListeners.get(provider.getName());
    listener.hostConnect(hostId, pool.getId());
}
Also used : HypervisorHostListener(org.apache.cloudstack.engine.subsystem.api.storage.HypervisorHostListener) DataStoreProvider(org.apache.cloudstack.engine.subsystem.api.storage.DataStoreProvider)

Example 2 with HypervisorHostListener

use of org.apache.cloudstack.engine.subsystem.api.storage.HypervisorHostListener in project cloudstack by apache.

the class StorageManagerImpl method disconnectHostFromSharedPool.

@Override
public void disconnectHostFromSharedPool(long hostId, long poolId) throws StorageUnavailableException, StorageConflictException {
    StoragePool pool = (StoragePool) _dataStoreMgr.getDataStore(poolId, DataStoreRole.Primary);
    assert (pool.isShared()) : "Now, did you actually read the name of this method?";
    s_logger.debug("Removing pool " + pool.getName() + " from  host " + hostId);
    DataStoreProvider provider = _dataStoreProviderMgr.getDataStoreProvider(pool.getStorageProviderName());
    HypervisorHostListener listener = hostListeners.get(provider.getName());
    listener.hostDisconnected(hostId, pool.getId());
}
Also used : HypervisorHostListener(org.apache.cloudstack.engine.subsystem.api.storage.HypervisorHostListener) DataStoreProvider(org.apache.cloudstack.engine.subsystem.api.storage.DataStoreProvider)

Aggregations

DataStoreProvider (org.apache.cloudstack.engine.subsystem.api.storage.DataStoreProvider)2 HypervisorHostListener (org.apache.cloudstack.engine.subsystem.api.storage.HypervisorHostListener)2