mirror of
https://github.com/apache/cloudstack
synced 2026-08-02 05:26:35 +00:00
DeleteStoragePool command fix
1. not delete SR in xenserver side, only delete it in database. 2. remove a storagepool, adding it back fails
This commit is contained in:
parent
182c3de665
commit
1b477750e0
@ -4099,15 +4099,9 @@ public abstract class CitrixResourceBase implements StoragePoolResource, ServerR
|
||||
try {
|
||||
Connection conn = getConnection();
|
||||
SR sr = getStorageRepository(conn, poolTO);
|
||||
sr.setNameLabel(conn, pool.getUuid());
|
||||
sr.setNameDescription(conn, pool.getName());
|
||||
|
||||
removeSR(sr);
|
||||
Answer answer = new Answer(cmd, true, "success");
|
||||
return answer;
|
||||
} catch (XenAPIException e) {
|
||||
String msg = "DeleteStoragePoolCommand XenAPIException:" + e.toString() + " host:" + _host.uuid + " pool: " + pool.getName() + pool.getHostAddress() + pool.getPath();
|
||||
s_logger.warn(msg, e);
|
||||
return new Answer(cmd, false, msg);
|
||||
} catch (Exception e) {
|
||||
String msg = "DeleteStoragePoolCommand XenAPIException:" + e.getMessage() + " host:" + _host.uuid + " pool: " + pool.getName() + pool.getHostAddress() + pool.getPath();
|
||||
s_logger.warn(msg, e);
|
||||
|
||||
@ -199,7 +199,7 @@ public class StoragePoolDaoImpl extends GenericDaoBase<StoragePoolVO, Long> imp
|
||||
sc.setParameters("hostAddress", host);
|
||||
sc.setParameters("path", path);
|
||||
|
||||
return listBy(sc);
|
||||
return listActiveBy(sc);
|
||||
}
|
||||
|
||||
public StoragePoolVO listById(Integer id)
|
||||
|
||||
@ -1359,7 +1359,8 @@ public class StorageManagerImpl implements StorageManager {
|
||||
for (StoragePoolHostVO host : hostPoolRecords) {
|
||||
_storagePoolHostDao.deleteStoragePoolHostDetails(host.getHostId(),host.getPoolId());
|
||||
}
|
||||
|
||||
sPool.setUuid(null);
|
||||
_storagePoolDao.update(id, sPool);
|
||||
_storagePoolDao.remove(id);
|
||||
return true;
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user