Commit graph

557 commits

Author SHA1 Message Date
mattkirby
a2a3bb7dfd
Merge pull request #382 from puppetlabs/pooler-167
(POOLER-167) Allow for network configuration at vm clone time
2020-06-23 14:30:25 -07:00
Jenkins
ffe07a3140 (GEM) update vmpooler version to 0.13.3 2020-06-15 15:21:59 +00:00
Belen Bustamante
3dfd70fa0e Allow for network configuration at vm clone time 2020-06-12 11:56:41 -07:00
Samuel
4ecd5dea51
(POOLER-174) Reduce duplicate of on demand code introduced in POOLER-158 (#383)
* (POOLER-174) Reduce duplicate of on demand code introduced in POOLER-158
refactored every parsing of request of type 'pool_alias:pool:count' into a
utility class, that is used by pool_manager and the api v1 class
* add some metrics to the od request generation
* fix rubocop offenses, we are now friends
2020-06-11 12:39:34 -05:00
Jenkins
2afc2a242b (GEM) update vmpooler version to 0.13.2 2020-06-05 22:43:53 +00:00
kirby@puppetlabs.com
e390efbb10 Rescue and warn when graphite connection cannot be opened
This commit updates vmpooler graphite stats behavior when a connection cannot be opened to the graphite server to warn instead of allowing the full backtrace to be output to stderr. Without this change a backtrace is output to stderr when a graphite connection fails.
2020-06-05 11:27:49 -07:00
Jenkins
9f397f02fb (GEM) update vmpooler version to 0.13.1 2020-06-04 18:10:55 +00:00
Samuel Beaulieu
30b96536b3 (maint) Fix merge issue
It seems like generate_and_check_hostname does not need a method argument
this was fixed in one PR, and another change made in another PR and was used
inconsistently
2020-06-04 12:55:30 -05:00
Jenkins
7d6c887aed (GEM) update vmpooler version to 0.13.0 2020-06-04 00:35:41 +00:00
kirby@puppetlabs.com
811fd8b60f (POOLER-158) Add capability to provision VMs on demand
This change adds a capability to vmpooler to provision instances on
demand. Without this change vmpooler only supports retrieving machines
from pre-provisioned pools.

Additionally, this change refactors redis interactions to reduce round
trips to redis. Specifically, multi and pipelined redis commands are
added where possible to reduce the number of times we are calling redis.

To support the redis refactor the redis interaction has changed to
leveraging a connection pool. In addition to offering multiple
connections for pool manager to use, the redis interactions in pool
manager are now thread safe.

Ready TTL is now a global parameter that can be set as a default for all
pools. A default of 0 has been removed, because this is an unreasonable
default behavior, which would leave a provisioned instance in the pool
indefinitely.

Pool empty messages have been removed when the pool size is set to 0.
Without this change, when a pool was set to a size of 0 the API and pool
manager would both show that a pool is empty.
2020-06-03 14:00:04 -07:00
Samuel Beaulieu
41f097cc3e with the addition of dns_available, renaming available to hostname_available 2020-05-29 12:14:29 -05:00
Samuel Beaulieu
6304743240 (POOLER-166) Check for stale dns records 2020-05-29 12:05:54 -05:00
Jenkins
eb0df8d83f (GEM) update vmpooler version to 0.12.0 2020-05-28 18:16:25 +00:00
Belen Bustamante
477f270b52 Enable support for multiple user objects 2020-05-28 10:42:47 -07:00
Jenkins
e9a79cb6db (GEM) update vmpooler version to 0.11.3 2020-04-29 15:02:04 +00:00
Samuel Beaulieu
9c6f50691d (DIO-608) vmpooler SUT handed out multiple times
Before this change if the smove returned false, we would continue handing out the VM
which presumably could still be in the 'ready' state. Upon 'delete' that ready VM would not be
picked up and return a 404 which is consistent with the behavior seen. Adding a metric to keep
track of the smove failures since this is not expected. I think some API logging would be good
to add in the future.
2020-04-23 16:10:36 -05:00
Jenkins
4019a082f0 (GEM) update vmpooler version to 0.11.2 2020-04-16 15:54:02 +00:00
Brandon High
5fac5684a9
Merge pull request #371 from puppetlabs/POOLER-161
(POOLER-161) Fix extending vm lifetime when max lifetime is set
2020-04-15 13:27:27 -07:00
Samuel Beaulieu
953aa68907 (POOLER-161) Fix extending vm lifetime when max lifetime is set
Before this PR, the current running time was being inspected to decide if the
vm lifetime could be extended. But since vm lifetime is absolute and not relative
this check is now removed.
2020-04-15 13:17:14 -05:00
kirby@puppetlabs.com
fc616ce055 Fix rubocop offenses 2020-04-07 11:22:05 -07:00
kirby@puppetlabs.com
68ecb7a3a4 (POOLER-165) Fix purge_unconfigured_folders
This commit fixes the purge_unconfigured_folders feature to ensure that it can successfully identify folders and instances that are no longer used. Without this change the feature does not work as advertised.
2020-04-07 09:39:59 -07:00
Jenkins
451003484e (GEM) update vmpooler version to 0.11.1 2020-03-17 23:51:30 +00:00
kirby@puppetlabs.com
7597185fa4 Fix reference to unused e to satisfy rubocop 2020-03-17 11:24:03 -07:00
kirby@puppetlabs.com
283dea62a7 (POOLER-156) Detect redis connection failures
This commit adds detection for redis connection failures to pool_manager. When a connection fails the error will be raised to executeforcing the connection to be re-established. Without this change, when a redis connection fails, it generates a redis connection error, which is swallowed by a rescue for StandardError, preventing the manager application component from recovering in the case of a redis connection failure.
2020-03-17 11:17:52 -07:00
Jenkins
d653ce482e (GEM) update vmpooler version to 0.11.0 2020-03-11 22:39:14 +00:00
Brandon High
57d2010db0
Use break instead of return in migrate_vm connection pool
This commit switches the early `return` in `migrate_vm`'s connection
pooling block to a `break`, since `return` implies you are returning
something from a method and I don't think `migrate_vm` wants to do that.

This is a place where a partial type system like Sorbet seems useful
because then we'd have some idea about what the intended return is here.
2020-03-05 17:17:30 -08:00
Brandon High
392232fb6a
Remove duplicated return statements
This commit removes two duplicate return statements in both branches of
a conditional with one return statement outside the conditional blocks.
2020-03-05 17:13:51 -08:00
Brandon High
ed88fb1302
Remove shadowed variable from get_provider_for_pool
This commit updates a block that was creating a shadow variable to use a
different variable.
2020-03-05 17:12:09 -08:00
Brandon High
61e9f56ed2
Fixing Naming/PredicateName issues
This commit drops the `has_` prefix from several `?` style methods
because that's against the ruby style guide and redundant for a method
ending in `?`.
2020-03-05 17:10:22 -08:00
Brandon High
5193ff6a84
Use consistent Style/NumericPredicate redux
Prior to this commit the codebase used the `zero?` method for comparing
to 0 on some places and not in others.
This commit makes all comparison to zero consistently use the `==`.
2020-03-05 17:10:22 -08:00
Brandon High
daa1a99073
Correct keyword arguments to traverse in create_folder
This commit fixes this call to `dc.vmFolder.traverse` to simply pass in
the arguements instead of assigning to variables that are discarded.
2020-03-05 17:10:22 -08:00
Brandon High
5dca8f9468
Fix bug in update_clone_target
This commit fixes a bug in update_clone_target where I believe `=` was
intended, not `==` because `==` just goes to the void context here.

Thanks Rubocop Lint/Void!
2020-03-05 16:56:06 -08:00
Brandon High
367565a3ee
Switch from casting to_f to using fdiv dividing floats
This commit updates places where previously we were casting both terms
in a float division into floats in order to ensure that float division
occurs to use the `fdiv` method, which will always do float division and
is available on both `Floats` and `Integers` because they are
both `Numeric`.
2020-03-05 16:56:06 -08:00
Brandon High
532ca96131
Ignore set_linked_clone for Naming/AccessorMethodName
This commit ignores the `set_linked_clone` method, which doesn't obey
the Rubocop recommended method naming convention.
2020-03-05 16:56:06 -08:00
Brandon High
f1f173ddb6
Fix alignment of end keywords 2020-03-05 16:56:06 -08:00
Brandon High
a839af2710
Use URI.parse.open/File.open instead of open
This commit updates the dashboard to use `URI.parse` instead of `Kernel#open`
because open can potentially open files on the server and has other
possible security issues.

Also updated the logger to use `File.open` as it is more explicit and
doesn't have the extra potential for abuse like `Kernel#open`

https://rubocop.readthedocs.io/en/latest/cops_security/#securityopen
2020-03-05 16:56:06 -08:00
Brandon High
f90ef4839e
Remove unused assignment
As far as I can tell, this variable doesn't exist before this assignment
and is immediately overwritten with the result of the method call so I
don't think it needs to be here?
2020-03-05 16:56:05 -08:00
Brandon High
0b841d63fd
Do not save exception in a variable if it isn't referenced
Prior to this commit there were a couple locations where exceptions were
saved to `_e` but weren't used in the handler except to re-raise the
exception, which simply calling the `raise` keyword will do without a
provided argument.
This commit removes the unnecessary assignment of the exception to a
variable and simply uses `raise` instead.
2020-03-05 16:56:05 -08:00
Brandon High
a5a2740762
Consistent Style/FormatStringToken
This commit fixes the various calls to `format` to consistently use the
keyword token style. Hopefully this is more understandable and explicit?
2020-03-05 16:53:06 -08:00
Brandon High
b4f42cd4b1
Disable Naming/VariableName for propSpecs
I assume `propSpecs` is a reference to the VMWare API so using camelCase
is intentional.
2020-03-05 16:23:43 -08:00
mattkirby
f85f5126e8
Merge pull request #360 from highb/2020-03-05_unsafe_rubocop_fixes
"Unsafe" rubocop fixes
2020-03-05 16:03:21 -08:00
Brandon High
f22a84f26f
"Unsafe" rubocop fixes
Adds the remaining "unsafe" fixes that aren't included in #359
2020-03-05 11:23:37 -08:00
Brandon High
29519006fa
Fix Rubocop "safe" auto-corrections
Generated using `bundle exec rubocop --safe --auto-correct`
2020-03-05 10:32:11 -08:00
kirby@puppetlabs.com
8bb89b604d (POOLER-157) Add extra_config option to vmpooler
This commit adds the extra_config option to vmpooler to allow specifying additional configuration files to load from. Without this change vmpooler does not offer a mechanism to provide additional configuration files for the application.
2020-03-04 17:19:24 -08:00
Jenkins
dfa2f8620a (GEM) update vmpooler version to 0.10.3 2020-03-04 20:47:38 +00:00
Brandon High
6929377132
Decrement version in version.rb
I always forget that the job both bumps this version and tags, so
undoing the bump I did previously.
2020-03-04 12:46:13 -08:00
Brandon High
cec7183fdc
Release 0.10.3
Updates for release 0.10.3, tagging will be handled by the job.
2020-03-04 11:44:36 -08:00
Brandon High
1fe80194e3
(POOLER-154) Delay vm host update until after migration completes
Prior to this commit the vsphere migration code updated the redis value
for where the VM is running (`vmpooler__vm__#{vm_name}/host`) before
attempting the migration. This meant that if the migration failed, there
was no record of what the original host for the VM was. Additionally,
the VM was marked as migrated before the migration happened which
didn't reflect reality if the migration failed.

This commit moves the redis update during migration to after the
migration has completed. This means that if an exception is thrown in
the migration code, the original host won't be lost and the host won't
be considered as migrated when it was not.
2020-03-03 14:00:00 -08:00
Jenkins
7ac03c6c94 (GEM) update vmpooler version to 0.10.2 2020-02-14 18:24:38 +00:00
Brandon High
81db9fb515
Bump version.rb and CHANGELOG.md to 0.10.1
This commit is to fix a mistake made the in the tagging and release
process.
2020-02-14 10:15:42 -08:00