Skip to content

GCP: Add option to configure minimum number of instances#32

Closed
Mohsen Rezaei (mohsenrezaeithe) wants to merge 9 commits into
JetBrains:masterfrom
mohsenrezaeithe:min_instance_limit
Closed

GCP: Add option to configure minimum number of instances#32
Mohsen Rezaei (mohsenrezaeithe) wants to merge 9 commits into
JetBrains:masterfrom
mohsenrezaeithe:min_instance_limit

Conversation

@mohsenrezaeithe

@mohsenrezaeithe Mohsen Rezaei (mohsenrezaeithe) commented Sep 17, 2019

Copy link
Copy Markdown
Contributor

Fixes #30

On the UI

  1. Configurable in the image configs:
    image
  2. Visible on the profile page:
    image

On the server
The quota check guards the minimum number of instances that must be kept alive at all times for the image group:

[2019-09-17 07:02:54,749]   INFO [uled executor 3] - te.IdleTimeoutTerminateFactory - Will stop instance GoogleCloudInstance{myName='poc-tcagent-poc-stg2-1567103841-1040'}, profile 'GCP POC staging'{id=google-1, projectId=_Root} with idle time 12 minutes (idle time is 3 minutes)
[2019-09-17 07:02:54,749]   INFO [uled executor 3] - l.instances.StopInstanceAction - Terminating instance 'poc-tcagent-poc-stg2-1567103841-1040', profile 'GCP POC staging'{id=google-1, projectId=_Root}, reason: "Idle timeout reached"
[2019-09-17 07:02:54,749]   INFO [uled executor 3] - r.impl.DBCloudStateManagerImpl - Image: GoogleCloudImage{myName='poc-tcagent-poc-stg2-1567103841-'}, profile: profile 'GCP POC staging'{id=google-1, projectId=_Root} was marked to CONTAIN agent
[2019-09-17 07:02:54,758]   INFO [uled executor 3] - clouds.google.GoogleCloudImage - Unable to terminate anymore instances. Configured minimum limit has reached (min: 1)

@mohsenrezaeithe

Copy link
Copy Markdown
Contributor Author

Did some more testing, and it looks like the return on terminateInstance() causes something to mark the agent as CONTAIN:

[2019-09-17 06:57:54,656]   INFO [uled executor 2] - r.impl.DBCloudStateManagerImpl - Image: GoogleCloudImage{myName='poc-tcagent-poc-stg2-1567103841-'}, profile: profile 'GCP POC staging'{id=google-1, projectId=_Root} was marked to CONTAIN agent

which I'm assuming is also related to this warning on the profile:
image

Any suggestion on what's the best way to achieve the minimum number limitation?

@mohsenrezaeithe

Copy link
Copy Markdown
Contributor Author

@dimyriy Dmitry Treskunov (@dmitry-treskunov) is this something that can be pulled into the profiles implementation, or needs to be implemented on the server?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add support for minimum num of instances as hot standbys

3 participants