Commit graph

545 commits

Author SHA1 Message Date
Brandon High
625472df35
(QENG-7530) Fix hostname_shorten regex
Prior to this commit the hostname_shorten regex wouldn't match the
updated human readable hostnames because they contain dashes.
This commit updates the regex to capture dashes in the hostname, and
adds a few specs to verify that behavior.
2019-11-01 10:30:56 -07:00
Jenkins
3732ed750e (GEM) update vmpooler version to 0.8.1 2019-10-25 16:35:08 +00:00
Jenkins
85665a0856 (GEM) update vmpooler version to 0.8.0 2019-10-25 00:08:48 +00:00
mattkirby
8a32ffb250
Merge pull request #341 from highb/imp/master/QENG-7530_human_readable_names
(QENG-7530) Make VM names more human readable
2019-10-24 16:59:04 -07:00
Jenkins
8c9b69b85d (GEM) update vmpooler version to 0.7.2 2019-10-24 23:47:08 +00:00
Brandon High
2ca6d49aeb
(QENG-7530) Make VM names more human readable
Prior to this commit hostnames for VMs provisioned by vmpooler were 15
random characters. This is difficult for humans to tell apart.

This commit updates the naming to use the `spicy-proton` gem to generate
adjective noun pair names for the VMs, which I think would be easier for
humans to tell apart, as well as fun and memorable to say.

The random name should not exceed 15 characters in order to prevent
issues with NETBIOS, etc as discussed in the attached ticket.
2019-10-24 09:12:18 -07:00
kirby@puppetlabs.com
0e1a6da043 Simplify declaration of checkoutlock mutex
This commit updates the way that checkoutlock is defined so it is not passed through bin/vmpooler. Without this change there's an unnecessary layer the mutex passes through.
2019-10-23 03:52:08 -07:00
kirby@puppetlabs.com
30bf2074fe (POOLER-150) Synchronize checkout operations for API
This commit adds a shared mutex to vmpooler API so that checkout requests can be synchronized across threads. Without this change it is possible in some scenarios for vmpooler to allocate the same SUT to different API requests for a VM.
2019-10-21 14:24:34 -07:00
Andrew Makousky
a2548d11e8
(POOLER-148) Improve code comment.
Co-Authored-By: Samuel <samuel@puppet.com>
2019-09-04 01:32:20 +00:00
Andrew Makousky
79ac9ad37e (POOLER-148) Fix undefined variable bug in _check_ready_vm.
The host['boottime'] variable in the function _check_ready_vm no longer
has its parent object in reference due to the refactoring in pull
request #269.  So in order to get the same information without the
performance impact from duplicate object lookups, we get similar
information from the time that the VM is ready.
2019-08-30 18:32:14 -05:00
Jenkins
b560cf4d28 (GEM) update vmpooler version to 0.7.1 2019-08-26 19:08:08 +00:00
kirby@puppetlabs.com
267772d8eb (POOLER-147) Fix create_linked_clone pool option
This commit updates the create_linked_clone pool option to correctly detect when linked clones have been set at a pool level. Without this change a pool setting create_linked_clone to false is not interpreted correctly, and a linked clone is created if possible.
2019-08-22 14:32:06 -07:00
Jenkins
9f2d653241 (GEM) update vmpooler version to 0.7.0 2019-08-21 21:19:39 +00:00
kirby@puppetlabs.com
9c5a0d114b (POOLER-142) Add running host to vm API data
This change adds the running host for a VM to the API data available via /vm/hostname. Without this change the running host would be logged to vmpooler log, but not available any other way. Additionally, the data will specify if a machine has been migrated. Without this change parent host data for a vmpooler machine is not available via the vmpooler API.
2019-08-21 12:43:06 -07:00
kirby@puppetlabs.com
09a382a10f Make it possible to disable linked clones
This commit adds a new configuration parameter to allow setting whether to create linked clones on a global, or per pool basis. Without this change vmpooler would always attempt to create linked clones. The default behavior of creating linked clones is preserved.
2019-08-06 14:29:31 -07:00
Jenkins
d319643123 (GEM) update vmpooler version to 0.6.3 2019-07-29 17:22:43 +00:00
Spencer McElmurry
98a547b807 (POOLER-143) Add clone_target config change to API
This allows the user to change the cluster in which the targeted pool
will clone to. Upon configuration change, the thread will wake up and
execute the change within 1 second.
2019-07-29 08:53:27 -07:00
Jenkins
3fef59d776 (GEM) update vmpooler version to 0.6.2 2019-07-17 22:06:33 +00:00
kirby@puppetlabs.com
7abfb97ab5 (POOLER-140) Fix typo in domain
This commit updates the reference to domain from vmpooler config. Without this change the domain value is read as an empty string and breaks checkouts.
2019-07-17 14:27:19 -07:00
kirby@puppetlabs.com
d6e948d34d (POOLER-140) Ensure a VM is alive at checkout
This commit duplicates the vm_ready? check to the API layer to allow for API to validate that a VM is alive at checkout. Without this change API relies upon the checks in pool_manager validating pools. This change should allow for additional insight into whether a machine is in a ready state and resopnding at checkout time.
2019-07-17 12:03:55 -07:00
Jenkins
a755d8d6a2 (GEM) update vmpooler version to 0.6.1 2019-05-08 16:48:35 +00:00
mattkirby
fa670ef3b9
Merge pull request #326 from puppetlabs/optimize-status-api
(maint) Optimize the status api using redis pipeline
2019-04-26 07:58:12 -07:00
Jenkins
5f8f64d269 (GEM) update vmpooler version to 0.6.0 2019-04-24 21:25:35 +00:00
Samuel Beaulieu
8eb15f8d10 (maint) Optimize the status api using redis pipeline
Before this change looping over many pools would query the redis backend
for each pool, leading in slow response from the backend for configurations
with many pools (60+)
Changed the requests to use redis pipelines https://redis.io/topics/pipelining
This is supported since the beginning, so will not force any redis update for
users. The pipeline method runs the queries in batches and we need to loop
over the result and reduces the number of requests to redis by N=number of
pools in the configuration.
2019-04-18 13:24:40 -05:00
Spencer McElmurry
6141cd7ecf
Merge pull request #323 from mattkirby/POOLER_141
(POOLER-141) Fix order of processing migrating and pending queues
2019-04-17 11:57:22 -05:00
Spencer McElmurry
ce6ea1662d
Merge pull request #324 from puppetlabs/QENG-7201
(QENG-7201) Vmpooler pool statistic endpoint optimization
2019-04-17 11:56:48 -05:00
Samuel Beaulieu
714a9edf5e (QENG-7201) Adding docs and tests 2019-04-15 13:09:53 -05:00
Samuel Beaulieu
11d94cc3d2 (QENG-7201) Vmpooler Status API QueueProcessor Optimization
Before this change we used the API /status endpoint to get specific information
on pools such as the number of ready VMs and the max.
This commit creates two new endpoints to get to that information much quicker
1) poolstat?pool= takes a comma separated list of pools to return, and will provide
the max, ready and alias values.
2) /totalrunning will calculate the total number of running VMs across all pools
2019-04-12 14:34:09 -05:00
kirby@puppetlabs.com
2d94cb4266 (POOLER-141) Fix order of processing migrating and pending queues
This commit updates how migrating and pending queues are processed. Sets to be processed are created with sadd in redis, and iterated over as a list in ruby. The latest member is added to the beginning of this set in redis, and becomes the first member of the set in ruby. To ensure that items are processed in the order they are added it is necessary to reverse the list before iterating through its members. Without this change the newest members of the set are processed first, which creates inconsistent times to evaluation.
2019-04-11 12:29:05 -07:00
Jenkins CI
2f89de35e7 (TAG) update version to 0.5.1 2019-04-11 18:35:43 +00:00
kirby@puppetlabs.com
d738f35727 (POOLER-140) Ensure a running VM stays in a queue
This commit updates how a VM is checked out to ensure that there is no window where the VM could be considered discovered, and therefore destroyed. Without this change the VM is retrieved by calling 'spop' on the ready queue, and then adding it to the running queue. This change moves to selecting the VM by retrieving the last member of the set, and moving it with 'smove' from ready to running. As a result of this change vmpooler moves from retrieving the VMs from the ready state randomly, to instead retrieve the oldest VM in the queue. This change should reduce churn where it would otherwise not be required to satisfy demand.
2019-04-05 14:01:18 -07:00
Jenkins
a1ec332ffe (TAG) update version to 0.5.0 2019-02-14 20:04:58 +00:00
kirby@puppetlabs.com
3e26a8f998 (POOLER-139) Fix discovering checked out VM
This commit updates how vmpooler retrieves VMs to add a VM to the running queue as soon as it is checked out. Without this change it is possible that a VM can be discovered when it is checked out before it is added to the running queue if multiple systems are requested. Additionally, the dockerfile is updated to support specifying the version of vmpooler to install.
2019-02-13 16:43:55 -08:00
Jenkins
5e4ba2bc7e (TAG) update version to 0.4.0 2019-02-06 23:07:36 +00:00
kirby@puppetlabs.com
49ec06e151 (POOLER-138) Support multiple pools per alias
This change updates handling of pool aliases to allow for more than a
single pool to be configured as an alias pool. Without this change if
multiple pools are configured as an alias the last one to configure it
is set as the alias for that pool.

Additionally, redis testing requirements are removed in favor of
mock_redis. Without this change a redis server is required to run
vmpooler tests.
2019-02-01 09:05:23 -08:00
kirby@puppetlabs.com
d94b14a4d8 (POOLER-137) Support integer environment variables
This commit updates vmpooler to set configuration values received via environment variables to integer values when an integer value is expected. Without this change vmpooler does not support setting integer values via environment variables. Additionally, testing is added for configuring vmpooler via environment variables.

To support this testing the gem climate_control is added, which allows
for testing environment variables without those set variables leaking to
other tests.
2019-01-22 15:02:07 -08:00
Jenkins
ae694c5167 (TAG) update version to 0.3.0 2018-12-20 22:52:00 +00:00
kirby@puppetlabs.com
2de4a6db0b Ensure nodes are consistent for usage stats
This commit updates vm usage stats collection to replace all instances of '.' characters within node strings. Without this change the node string containing a '.' character causes the metric to be interpreted as containing another node.
2018-12-19 12:45:50 -08:00
Jenkins
b4dfbca40e (TAG) update version to 0.2.31 2018-12-10 22:35:08 +00:00
Jenkins
bfc0c24106 (TAG) update version to 0.2.3 2018-12-10 21:06:47 +00:00
kirby@puppetlabs.com
9a57c6d1b5 (POOLER-134) Ship VM usage stats
This commit updates vmpooler to ship VM usage stats when a VM is destroyed. The stats are gathered for jobs based on user and pool name. If a jenkins build URL is present then this is broken down by user, instance, value stream, branch and project. Additionally, if present then the RMM_COMPONENT_TO_TEST_NAME will be listed after project. Without this change we do not collect stats on per VM usage and its correlation to users and pools.
2018-12-07 11:59:27 -08:00
kirby@puppetlabs.com
3c856d7ae9 (POOLER-133) Identify when a ready VM has failed
This commit fixes checking of a VM that has already been identified as ready. Without this change a ready VM that has failed will be identified as having failed, but will not successfully be removed from the ready queue. Additionally, the default vm_checktime value has been reduced from 15 to 1 to ensure that ready VMs are checked within one minute of the time they have reached the ready state by default.

Lastly, the docker-compose files are updated to specify that the redis
instance used is a local redis instance.
2018-12-03 12:21:08 -08:00
kirby@puppetlabs.com
5704488cc5 (POOLER-132) Sync pool size on dashboard start
This commit updates the dashboard for vmpooler to ensure it is synchronized with any redis based configuration values before displaying the dashboard. Without this change the pool size value may be displayed incorrectly if the value has been set via the /config/poolsize API endpoint.
2018-10-03 13:07:20 -07:00
Jenkins
9bc17a8935 (GEM) update vmpooler version to 0.2.2 2018-10-01 23:25:52 +00:00
kirby@puppetlabs.com
4ba4a1dd6c (POOLER-131) Return requested name when getting VMs
This commit updates fetch_single_vm to return the name of the template that was requested, instead of the name of the pool providing the VM to meet the request. Without this change, when an alias is used for fetching a VM, a different pool title may be returned containing the requested VMs than the user initially requested.
2018-09-27 12:05:30 -07:00
Jenkins
5e39bc2755 (GEM) update vmpooler version to 0.2.1 2018-09-19 00:05:01 +00:00
kirby@puppetlabs.com
f5c3c86632 Remove pool_backend method 2018-09-13 09:24:17 -07:00
kirby@puppetlabs.com
830acd705d Remove debug statements. Return when get_vm returns nil 2018-09-12 12:28:12 -07:00
kirby@puppetlabs.com
cd73f53561 (POOLER-129) Allow setting weights for backends
This commit updates get_vm in the vmpooler API to allow for setting weights for backends. Additionally, when an alias for a pool exists, and the backend configured is not weighted, then the selection of the pool based on alias will be randomly sampled. Without this change any pool with the title of the alias is exhausted before an alternate pool with the configured alias is used, which results in an uneven distribution of VMs. When all backends involved are configured with weighted values the VM selection will be based on probability using those weights.

A bug is fixed when setting the default ttl for check_ready_vm.

Pickup is added to handle weighted VM selection.

A dockerfile is added that allows for building and installing vmpooler
from the current HEAD in docker to make for easy testing.
2018-09-11 11:15:02 -07:00
mchllweeks
0e86937245
Merge pull request #297 from mattkirby/pooler_130
(POOLER-130) Improve delta disk creation handling
2018-08-30 17:22:35 -07:00