wido commented on code in PR #13719:
URL: https://github.com/apache/cloudstack/pull/13719#discussion_r3659114779


##########
server/src/main/java/com/cloud/resource/ResourceManagerImpl.java:
##########
@@ -1062,7 +1063,9 @@ public void doInTransactionWithoutResult(final 
TransactionStatus status) {
                 logger.debug("Deleting tags from database for host with UUID 
[{}].", host.getUuid());
                 _hostTagsDao.deleteTags(hostId);
 
-                host.setGuid(null);
+                // Note: the host GUID is intentionally preserved on the 
(soft-)deleted record so that a
+                // returning agent with the same GUID can be detected and 
refused re-registration when
+                // 'add.host.on.service.restart.kvm' is false. See 
getNewHost()/rejectReAddOfDeletedHost().

Review Comment:
   If you re-install it, the agent.properties will be empty and thus will 
contain a new (G)UUID, then it will work. The same UUID in the agent.properties 
will be blocked from being added again. You will have to assign a new one to it.
   
   I think that's also better, you should not recycle UUIDs, it can confuse 
things when going through old DB entries and logs.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to