-
Notifications
You must be signed in to change notification settings - Fork 48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
(POOLER-123) Implement a max TTL #349
Conversation
9122c2d
to
a8ca47a
Compare
Hmmm... seems that when I spin this up with
And here's with the changes running locally:
|
I should check what api command floaty uses? Did you put |
Like this?
:config:
site_name: '<b>vmpooler-provisioner-highb</b>.delivery.puppetlabs.net'
domain: 'delivery.puppetlabs.net'
logfile: '/var/log/vmpooler.log'
clone_target: 'acceptance4'
task_limit: 10
vm_lifetime: 1
vm_lifetime_auth: 2
vm_checktime: 1
max_tries: 3
retry_factor: 10
create_folders: true
backend_weight:
'acceptance1': 5
'acceptance2': 6
'acceptance3': 6
purge_unconfigured_folders: true
experimental_features: true
migration_limit: 10
max_lifetime_upper_limit: 9000
|
As for floaty, I think it just
|
lib/vmpooler/api/v1.rb
Outdated
@@ -892,6 +892,22 @@ def invalid_pool(payload) | |||
when 'lifetime' | |||
need_token! if Vmpooler::API.settings.config[:auth] | |||
|
|||
# in hours, defaults to one week | |||
max_lifetime_upper_limit = config[:max_lifetime_upper_limit] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, I found the issue. This key is a string, not a symbol. When I switched that out, it works.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good catch. That was an issue with testing this as well, since we set the parameters and I wasn't sure if it was a symbol or a string. Thanks!
Before this change, we could checkout a vm and set the lifetime to a very high number which would esssentially keep the vm running forever. Now implementing a config setting max_lifetime_upper_limit which enforces a maximum lifetime in hours both for initial checkout and extending a running vm
Prior to this commit the PUT vm endpoint didn't give any useful information about why a user's request failed. This commit updates PUT to output a more helpful set of error messages in the `failure` key that gets returned in the JSON response.
I've switched out the symbol for a string in the config hash reference and added a little better error messaging so a user knows what actually went wrong. Also, vmfloaty didn't correctly handle when the PUT came back with |
@@ -22,6 +22,8 @@ services: | |||
- redislocal | |||
redislocal: | |||
image: redis | |||
# Uncomment this if you don't want the redis data to persist | |||
#command: "redis-server --save '' --appendonly no" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh and this little line was helpful for me to ensure that redis wasn't persisting between testing runs, as it was getting a strange no space left on device error. My computer has plenty of room, so I'm not sure where that is coming from all of a sudden.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
check the docker settings for how much space is allowed for all containers? I had to bump mine up a few times.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, I didn't even know that was a setting. Thanks!
This commit switches the max_lifetime_upper_limit key from being a symbol to being a string, which is what the config hash seems to contain.
This commit is just a handy little command override to the redis container to prevent persistence.
Thanks for the commits @highb |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm, I'm especially glad to see we'll be including the message with an error return.
this will still have to be released, I'm not planning on doing this on merge.
Before this change, we could checkout a vm and set the lifetime to a
very high number which would esssentially keep the vm running forever.
Now implementing a config setting max_lifetime_upper_limit which enforces
a maximum lifetime in hours both for initial checkout and extending a
running vm