Cloud support : API usage for "mark for termination" ?
Hello,
I'm working on yandex-qatools/teamcity-openstack-plugin, the TeamCity OpenStack Cloud Support.
I'm trying to improve the configuration reload mechanism (when image or some properties like 'Instance Cap' update), which currently terminate all running instances (=> #2).
When this method is called (because configuration is reloaded):
jetbrains.buildServer.clouds.CloudClientEx.dispose()
All resources (=> images & instances) are "disposed" too. This instance terminaison is a little violent :-).
Without going to an high-level implementation like the native AWS, a improvement could be to "mark for termination after current build finishes" these agents.
With that, on any configuration change, current build finish (and is not stopped) and agent is deleted.
Is there a way to set this property (mark agent for termination) from CloudClientEx / CloudImage / CloudInstance interfaces ?
Thanks in advance.
Best regards
Please sign in to leave a comment.
Hi, was finally able to review the plugin. I'm going to write down the things I noticed. They will address the pain points you mentioned above, but not only them. So,
So, to make this more viable, I would recommend to fix at least the following places in the code:
1) Get rid of IdGenerator and use permanent values for CloudImage.getId() implementation (OpenstackCloudClient.java:69)
2) OpenstackCloudClient#isInitialized should return only after plugin got initial state from the openstack. This can (and should be) done async. There's no problem with waiting a few seconds to let plugin fully initialize.
3) Don't terminate all instances in OpenstackCloudImage#dispose.
There are a few more comments, but they are minor. If you'd like, I can create a ticket at GitHub and put my notes here as well.
Hi Sergey, many thanks for this high valuable comments.
Agree todo any follow up of that in plugin issue: #2.