Commit graph

60 commits

Author SHA1 Message Date
Scott Schneider
6b8a315b07 Predefine entire 'result' hash rather than a-key-at-a-time 2015-02-20 13:23:54 -08:00
Scott Schneider
c68e476df2 Extend dashboard stats
This PR includes the following changes:

  - everything at the /dashboard/stats/vmpooler/numbers API endpoint has
  been moved to /status, and stats-vmpooler-numbers.js is now looking to
  /status for it's metrics

  - added '.extra'-classed metrics to stats-vmpooler-numbers.js to pull
  in daily clone totals, average clone time, etc.

  - dashboard.css includes an @media query to display the extra metrics
  if the dashboard's max-width exceeds 1500px
2015-02-20 11:23:48 -08:00
Colin
2bfaaac563 Add /summary endpoint
Add an endpoint that returns clone totals and average clone time for
the given time spans. The time spans are determined by the query
parameters "from" and "to", with the resulting range being inclusive of
both. If you want a single day, it should be both the "from" and the
"to" value.
2015-02-20 10:10:18 -08:00
Scott Schneider
5bfc44c168 Fixing typo in 'percent' 2015-02-17 08:41:19 -08:00
Scott Schneider
e6e9203504 Remove subtle dots, fix typo 2015-02-10 16:29:07 -08:00
Scott Schneider
7bb0825b46 Rubocop --auto-correct syntax fixups 2015-02-06 11:08:54 -08:00
Scott Schneider
7a3a4c3abc Ensure 'lifetime' argument provided is an integer 2015-02-04 15:56:32 -08:00
Scott Schneider
4ece98a8cb Display application 'uptime' in API status endpoint 2015-02-04 12:56:59 -08:00
Scott Schneider
fd507cccb3 Account for divide-by-zero 2015-02-03 14:38:04 -08:00
Scott Schneider
8d32ff1703 Store and retrieve daily clone statistics from Redis db 2015-02-03 14:14:12 -08:00
Scott Schneider
51e14817f4 Record clone times in Redis, add a '/status' API endpoint 2015-01-27 12:59:11 -08:00
Scott Schneider
d2ae108010 Rename 'template'/'count' to 'key'/'value'
This should make the code cleaner; things other than a template name will
be used in the POST interface.
2015-01-09 10:47:24 -08:00
Scott Schneider
dc0a7feb21 Allow for a globally-configurable 'pending' timeout 2015-01-08 14:16:13 -08:00
Scott Schneider
0d8c8d83b7 Wrap hostname-shortening into a [Sinatra helper] method 2014-11-03 13:07:22 -08:00
Scott Schneider
69443470fc Allow VM metadata to be queryable via 'GET' 2014-11-03 09:28:40 -08:00
Scott Schneider
4f1dd9d507 Store template name in vmpooler__vm__$vm Redis hash 2014-11-03 09:27:28 -08:00
Scott Schneider
ddef2e642e Merge remote-tracking branch 'upstream/master' 2014-10-31 11:53:38 -07:00
Scott Schneider
43557781b9 Squashed pool squares, stretched running graph 2014-10-31 11:52:36 -07:00
Scott Schneider
39d600deeb Allow host FQDN in DELETE 2014-10-16 15:14:13 -07:00
Scott Schneider
3a7659f284 Ensure hosts aren't in 'maintenance mode' when cloning 2014-09-30 14:25:07 -07:00
Scott Schneider
74709e9bbd (maint) Style fix-ups 2014-09-04 12:09:25 -07:00
Scott Schneider
7f22476d22 Don't deploy VMs to not-good hypervisors
This implements a check to ensure that the VMware host being deployed to
is in a sane ('green') state.
2014-09-04 11:57:01 -07:00
Scott Schneider
5a2e36dd44 Return a 'domain' JSON key if configured 2014-08-29 11:38:06 -07:00
Scott Schneider
525a6c6bd9 Textured background, transparent logo 2014-08-27 20:30:43 -07:00
Scott Schneider
c16d9f0f42 From http://subtlepatterns.com/cream-pixels/ 2014-08-27 20:30:24 -07:00
Scott Schneider
77414441af Minor CSS tweaks 2014-08-27 18:50:21 -07:00
Scott Schneider
dc8dccff31 Allow per-pool override for clone_target 2014-08-27 16:45:29 -07:00
Scott Schneider
ee5687f0ec Increase sleep time = decrease CPU usage 2014-08-26 18:09:55 -07:00
Scott Schneider
a124a6a724 Correctly log a VM's lifetime 2014-08-22 13:35:18 -07:00
Scott Schneider
ae97bb1ecc Custom-set VM lifetimes override system-wide 2014-08-22 11:04:38 -07:00
Scott Schneider
036e9d93fc Allow a PUT to modify running VMs 2014-08-22 11:03:55 -07:00
Scott Schneider
c28692ec66 Fixing typo 2014-07-28 10:55:42 -07:00
Scott Schneider
67b8534b19 Allow a 'clone_target' configuration setting
If set, this setting will enable "fake DRS", cloning VMs onto the host
in the specified cluster containing the least amount of VMs.
2014-07-28 10:51:45 -07:00
Scott Schneider
e17ab16546 Don't use VMware resource pools for organization
This commit removes support for VMware 'resource pool' functionality
entirely, as VMware installations without the DRS feature enabled are
unable to configure or use resource pools.

Also, resource pools should have never been used for organization;
that's what folders are for.
2014-07-21 13:49:57 -07:00
Colin
e8e8bc4a0e Merge pull request #18 from sschneid/move_stats_to_header
Tweaks to views and CSS to move statistics to header
2014-07-21 11:36:58 -07:00
Scott Schneider
192db89503 Revive the per-pool 'ok' JSON response until beaker can be patched 2014-07-21 10:54:48 -07:00
Scott Schneider
b5db9ee4eb Alignment/spacing tweaks 2014-07-21 10:46:42 -07:00
Scott Schneider
763b031099 Tweaks to views and CSS to move statistics to header 2014-07-16 11:59:57 -07:00
Scott Schneider
1c9b9e6cbc Support batch (multiple VM) requests
This PR allows a single API request to return multiple VM objects.  It
supports the following formats:

- POST <json> /vm/
  eg. 'curl -d '{"debian-7-i386":"3","debian-7-x86_64":"1"}' --url vmpooler/vm

- POST /vm/<pool>+<pool>+<pool>...
  eg. 'curl -d --url vmpooler/vm/debian-7-i386+debian-7-i386+debian-7-i386+debian-7-x86_64

Both commands listed above will return a JSON hash of 3 debian-7-i386 VMs and
1 debian-7-x86_64 VM:

  {
    "ok": true,
    "debian-7-i386": {
      "hostname": [
        "v49pwwk5yzg6oad",
        "ylghlgote5uso54",
        "wt0c4xovvulo7ge"
      ]
    },
    "debian-7-x86_64": {
      "hostname": "v3dkrulttp360fm"
    }
  }
2014-06-09 15:15:05 -07:00
Scott Schneider
a2d4342ffc Add textured backgrounds to SVG area pathes 2014-03-11 12:49:42 -07:00
Scott Schneider
fde2a6aae6 Allow a configurable Graphite namespace (prefix) 2014-03-06 10:53:27 -08:00
Scott Schneider
8311c785d7 Centralize external Gem loading 2014-03-05 13:19:43 -08:00
Scott Schneider
1b0a21c556 Reworked into a single namespaced Ruby application 2014-03-05 12:57:25 -08:00
Scott Schneider
a02f63eadc Changing project name to 'vmpooler'
All instances of 'vmware-host-pooler' and 'vmware_host_pool' changed to
'vmpooler'.
2014-02-19 14:08:46 -08:00
Scott Schneider
55ada2d80e Store 'clone' timestamps in Redis database
Using redis keys to store clone timestamps will allow for a global TTL
for VMs in the 'pending' pool; failed clones should be cleaned up and
retried after a set period of time (eg. 15m).
2014-02-04 15:05:24 -08:00
Scott Schneider
1003afaf00 Rework vCenter VM retrieval method
Previous, the propertyCollector method was used to find VMs within
vCenter.  This method was ineffecient, as it would retrieve a list of
the entire vCenter inventory and then parse for the specified VM.  This
has been replaced with a fetch via searchIndex.FindByDnsName, which
returns only the requested VM object.
2014-02-04 09:42:28 -08:00
Scott Schneider
dc906164c1 Reinitialize if connection is reset 2013-11-25 11:33:59 -08:00
Scott Schneider
73c61ec26b Spacing 2013-11-21 15:33:41 -08:00
Scott Schneider
f9e2c30e29 Remove unused find_customization method 2013-11-21 14:44:15 -08:00
Scott Schneider
3239ea29bd Send graphite data from within a thread
...so that if it fails, it doesn't kill our whole processing thread
2013-11-13 13:31:17 -08:00