[GitHub] [cloudstack] ravening opened a new pull request #4228: Dont add host back after agent service restart

2020-10-14 Thread GitBox


ravening opened a new pull request #4228:
URL: https://github.com/apache/cloudstack/pull/4228


   ## Description
   
   Fixes #4218 
   
   If a host is removed from cloudstack, it will be
   added back if we restart the agent service on
   the host. It should not be added back if manualy
   removed.
   
   Provide a global setting "add.host.on.service.restart" with
   default value of true. If set to false, the zoneid,
   clusterid and podid in agent.properties will be set to
   null so that when service is restarted, the agent is not
   added back
   
   If true these values will not be set to null so that it
   can be still added back on service restart
   
   
   ## Types of changes
   
   - [X] Bug fix (non-breaking change which fixes an issue)
   
   
   ## Screenshots (if appropriate):
   
   ## How Has This Been Tested?
   1. Add a host from ui. It will be successfully added
   2. Now remove the host
   3. Set the global setting `add.host.on.service.restart` to false
   3. ssh to host and restart cloudstack-agent service
   4. The host is not added back
   5. Try to add host from ui again. It will be added
   
   
   
   



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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [cloudstack] ravening opened a new pull request #4228: Dont add host back after agent service restart

2020-07-29 Thread GitBox


ravening opened a new pull request #4228:
URL: https://github.com/apache/cloudstack/pull/4228


   
   ## Description
   
   Fixes #4218 
   
   If a host is removed from cloudstack, it will be
   added back if we restart the agent service on
   the host. It should not be added back if manualy
   removed.
   
   So when host is removed, guid is set to null.
   When service is restarted, check if guid is null
   for the host it send to mgt server. If guid is
   null then dont add it back.
   
   When we are adding host, temporarily set guid to
   non null value so that when agent sends startuprouting command
   it knows that the host is getting explicitly added.
   Once host is added, set it back to null
   
   
   ## Types of changes
   
   - [X] Bug fix (non-breaking change which fixes an issue)
   
   
   ## Screenshots (if appropriate):
   
   ## How Has This Been Tested?
   1. Add a host from ui. It will be successfully added
   2. Now remove the host
   3. ssh to host and restart cloudstack-agent service
   4. The host is not added back
   5. Try to add host from ui again. It will be added
   
   
   
   



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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org