mirror of
https://github.com/apache/cloudstack.git
synced 2025-11-03 04:12:31 +01:00
bug 9455: when host is disconnected, also remove entry in storage_pool_host_ref
status 9455: resolved fixed
This commit is contained in:
parent
8d7131d9fb
commit
86f32e4735
@ -40,7 +40,7 @@ import com.cloud.utils.db.GenericDaoBase;
|
||||
public class StoragePoolHostVO implements StoragePoolHostAssoc {
|
||||
@Id
|
||||
@GeneratedValue(strategy=GenerationType.IDENTITY)
|
||||
Long id;
|
||||
private Long id;
|
||||
|
||||
@Column(name="pool_id")
|
||||
private long poolId;
|
||||
@ -77,7 +77,12 @@ public class StoragePoolHostVO implements StoragePoolHostAssoc {
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String getLocalPath() {
|
||||
return localPath;
|
||||
}
|
||||
|
||||
@ -191,4 +191,6 @@ public interface StorageManager extends Manager {
|
||||
List<CapacityVO> getStoragePoolUsedStats(Long poolId, Long podId, Long zoneId);
|
||||
|
||||
boolean createStoragePool(long hostId, StoragePoolVO pool);
|
||||
|
||||
boolean delPoolFromHost(long hostId);
|
||||
}
|
||||
|
||||
@ -1359,6 +1359,17 @@ public class StorageManagerImpl implements StorageManager, StorageService, Manag
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean delPoolFromHost(long hostId) {
|
||||
List<StoragePoolHostVO> poolHosts = _poolHostDao.listByHostId(hostId);
|
||||
for (StoragePoolHostVO poolHost : poolHosts) {
|
||||
s_logger.debug("Deleting pool " + poolHost.getPoolId() + " from host " + hostId);
|
||||
_poolHostDao.remove(poolHost.getId());
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean addPoolToHost(long hostId, StoragePoolVO pool) {
|
||||
s_logger.debug("Adding pool " + pool.getName() + " to host " + hostId);
|
||||
|
||||
@ -61,7 +61,7 @@ public class StoragePoolMonitor implements Listener {
|
||||
|
||||
@Override
|
||||
public synchronized boolean processDisconnect(long agentId, Status state) {
|
||||
|
||||
_storageManager.delPoolFromHost(agentId);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user