cloudstack-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mike-tutkowski <...@git.apache.org>
Subject [GitHub] cloudstack pull request: Notify listeners when a host has been add...
Date Mon, 09 May 2016 18:20:41 GMT
Github user mike-tutkowski commented on a diff in the pull request:

    https://github.com/apache/cloudstack/pull/816#discussion_r62547042
  
    --- Diff: plugins/storage/volume/solidfire/src/org/apache/cloudstack/storage/datastore/provider/SolidFireHostListener.java
---
    @@ -18,40 +18,69 @@
      */
     package org.apache.cloudstack.storage.datastore.provider;
     
    +import java.util.ArrayList;
    +import java.util.HashMap;
    +import java.util.List;
    +import java.util.Map;
    +
     import javax.inject.Inject;
     
     import org.apache.log4j.Logger;
     
     import org.apache.cloudstack.engine.subsystem.api.storage.DataStoreManager;
     import org.apache.cloudstack.engine.subsystem.api.storage.HypervisorHostListener;
    +import org.apache.cloudstack.storage.datastore.db.PrimaryDataStoreDao;
    +import org.apache.cloudstack.storage.datastore.db.StoragePoolDetailsDao;
    +import org.apache.cloudstack.storage.datastore.db.StoragePoolVO;
    +import org.apache.cloudstack.storage.datastore.util.SolidFireUtil;
     
     import com.cloud.agent.AgentManager;
     import com.cloud.agent.api.Answer;
     import com.cloud.agent.api.ModifyStoragePoolAnswer;
     import com.cloud.agent.api.ModifyStoragePoolCommand;
    +import com.cloud.agent.api.ModifyTargetsCommand;
     import com.cloud.alert.AlertManager;
    +import com.cloud.dc.ClusterDetailsDao;
    +import com.cloud.dc.dao.ClusterDao;
     import com.cloud.host.HostVO;
     import com.cloud.host.dao.HostDao;
     import com.cloud.hypervisor.Hypervisor.HypervisorType;
     import com.cloud.storage.DataStoreRole;
     import com.cloud.storage.StoragePool;
     import com.cloud.storage.StoragePoolHostVO;
    +import com.cloud.storage.VolumeVO;
     import com.cloud.storage.dao.StoragePoolHostDao;
    +import com.cloud.storage.dao.VolumeDao;
     import com.cloud.utils.exception.CloudRuntimeException;
    +import com.cloud.vm.VMInstanceVO;
    +import com.cloud.vm.dao.VMInstanceDao;
     
     public class SolidFireHostListener implements HypervisorHostListener {
         private static final Logger s_logger = Logger.getLogger(SolidFireHostListener.class);
     
    -    @Inject
    -    private AgentManager _agentMgr;
    -    @Inject
    -    private AlertManager _alertMgr;
    -    @Inject
    -    private DataStoreManager _dataStoreMgr;
    -    @Inject
    -    private HostDao _hostDao;
    -    @Inject
    -    private StoragePoolHostDao storagePoolHostDao;
    +    @Inject private AgentManager _agentMgr;
    +    @Inject private AlertManager _alertMgr;
    +    @Inject private ClusterDao _clusterDao;
    +    @Inject private ClusterDetailsDao _clusterDetailsDao;
    +    @Inject private DataStoreManager _dataStoreMgr;
    +    @Inject private HostDao _hostDao;
    +    @Inject private PrimaryDataStoreDao _storagePoolDao;
    +    @Inject private StoragePoolDetailsDao _storagePoolDetailsDao;
    +    @Inject private StoragePoolHostDao storagePoolHostDao;
    +    @Inject private VMInstanceDao _vmDao;
    +    @Inject private VolumeDao _volumeDao;
    +
    +    @Override
    +    public boolean hostAdded(long hostId) {
    +        HostVO host = _hostDao.findById(hostId);
    +
    +        SolidFireUtil.hostAddedToOrRemovedFromCluster(hostId, host.getClusterId(), true,
SolidFireUtil.PROVIDER_NAME,
    +                _clusterDao, _clusterDetailsDao, _storagePoolDao, _storagePoolDetailsDao,
_hostDao);
    +
    +        handleVMware(host, true);
    --- End diff --
    
    For now, yes (hypervisor hosts that require that we explicitly remove iSCSI targets in
this scenario).


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message