mirror of
https://github.com/puppetlabs/vmpooler.git
synced 2026-01-27 02:18:41 -05:00
(POOLER-123) Implement a max TTL
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
This commit is contained in:
parent
86dbc783ef
commit
ac17284a61
4 changed files with 63 additions and 1 deletions
|
|
@ -99,6 +99,10 @@ def fetch_vm(vm)
|
|||
redis.hgetall("vmpooler__vm__#{vm}")
|
||||
end
|
||||
|
||||
def set_vm_data(vm, key, value)
|
||||
redis.hset("vmpooler__vm__#{vm}", key, value)
|
||||
end
|
||||
|
||||
def snapshot_revert_vm(vm, snapshot = '12345678901234567890123456789012')
|
||||
redis.sadd('vmpooler__tasks__snapshot-revert', "#{vm}:#{snapshot}")
|
||||
redis.hset("vmpooler__vm__#{vm}", "snapshot:#{snapshot}", "1")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue