Skip to content

Commit 63f37ac

Browse files
Srivastava, PiyushSrivastava, Piyush
authored andcommitted
vm instance creation test4
1 parent dcbc73e commit 63f37ac

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

plugins/storage/volume/ontap/src/main/java/org/apache/cloudstack/storage/listener/OntapHostListener.java

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -71,16 +71,11 @@ public boolean hostConnect(long hostId, long poolId) {
7171
logger.error("Failed to connect host - storage pool not found with id: {}", poolId);
7272
return false;
7373
}
74-
// CRITICAL: Check if already connected to avoid infinite loops
75-
StoragePoolHostVO existingConnection = storagePoolHostDao.findByPoolHost(poolId, hostId);
76-
if (existingConnection != null && existingConnection.getLocalPath() != null && !existingConnection.getLocalPath().isEmpty()) {
77-
logger.info("Host {} is already connected to storage pool {} at path {}. Skipping reconnection.", host.getName(), pool.getName(), existingConnection.getLocalPath());
78-
return true;
79-
}
80-
8174
logger.info("Connecting host {} to ONTAP storage pool {}", host.getName(), pool.getName());
8275
try {
8376
// Create the ModifyStoragePoolCommand to send to the agent
77+
// Note: Always send command even if database entry exists, because agent may have restarted
78+
// and lost in-memory pool registration. The command handler is idempotent.
8479
ModifyStoragePoolCommand cmd = new ModifyStoragePoolCommand(true, pool);
8580

8681
Answer answer = _agentMgr.easySend(hostId, cmd);

0 commit comments

Comments
 (0)