Commit graph

502 commits

Author SHA1 Message Date
Rick Bradley
46815f26ac (maint) Don't clobber default redis database when running specs 2016-06-02 13:38:41 -05:00
Rick Bradley
652a56f4cd (maint) rename api_spec to dashboard_spec 2016-06-02 12:17:10 -05:00
Rick Bradley
bd31d56fff (maint) finish converting dashboard specs 2016-06-02 12:16:04 -05:00
Rick Bradley
9af40db8b3 (maint) repair incorrect test
The mockist version of the test allows redis' scard to return nil, which
it does not actually do in real life. Verified the behavior in the code
via a debugger. Fixed the test.
2016-06-02 12:10:34 -05:00
Rick Bradley
c30c7ac26b (maint) begin de-mockistifying api_spec.rb 2016-06-02 12:09:41 -05:00
Rick Bradley
ab88720496 (maint) cosmetic cleanup in spec helper 2016-06-02 12:08:42 -05:00
Rick Bradley
15b5d328ab (maint) Drop now-obsolete v1_spec.rb 2016-06-01 17:16:47 -05:00
Rick Bradley
0c3a269923 (maint) Convert specs for vm snapshot operations 2016-06-01 17:15:45 -05:00
Rick Bradley
62928f4436 (maint) Convert vm deletion specs 2016-06-01 16:26:15 -05:00
Rick Bradley
09d7f9ca92 (maint) Update vm/hostname tag and lifetime specs 2016-06-01 15:32:01 -05:00
Rick Bradley
48149eda64 (maint) Drop clear_pool from vm/template specs 2016-06-01 15:14:02 -05:00
Rick Bradley
2fcd639882 (maint) drop unneeded clear_pool helper
Given the way we're flushing redis (which seems super performant), we don't
need to clear pools any more at the beginning of tests.
2016-06-01 14:55:10 -05:00
Rick Bradley
ea9fd004d6 (maint) Lift #redis definition into spec helper library 2016-06-01 14:15:59 -05:00
Rick Bradley
e4aa311834 (maint) Define :config in token tests
Miscellaneous whitespace cleanup.
2016-06-01 14:12:38 -05:00
Rick Bradley
b1cdc4fbe4 (WIP) notes for next steps 2016-05-27 16:23:26 -05:00
Rick Bradley
def1a4e596 (maint) clean up vm_spec 2016-05-27 16:16:54 -05:00
Rick Bradley
b5350760a4 (WIP) add partially-converted /vm/hostname specs 2016-05-27 16:16:32 -05:00
Rick Bradley
5c2c18ac44 (maint) rename create_vm -> create_ready_vm 2016-05-27 16:16:00 -05:00
Rick Bradley
4d6368a42d (maint) Move extracted spec helper methods to spec_helper 2016-05-27 15:42:57 -05:00
Rick Bradley
355b48981d (maint) Clean up, reorganize specs 2016-05-27 15:39:04 -05:00
Rick Bradley
d6e8a0e168 (maint) Convert specs for /vm/template 2016-05-27 15:38:47 -05:00
Rick Bradley
d2c9e285fc (maint) Clean up some of the /vm/ tests 2016-05-27 15:28:09 -05:00
Rick Bradley
d69c433d96 (MAINT) gitignore some common files 2016-05-27 10:39:14 -05:00
Rick Bradley
95d4a0b401 Remove mockist tests from main suite. 2016-05-20 17:03:37 -05:00
Rick Bradley
82f3cccd65 De-mockistify v1/token specs; use real redis.
Open questions:

 - Do we need to do better cleanup here?
 - Should we be using a separate database to prevent clobbering other local db's?
2016-05-20 16:59:24 -05:00
Rick Bradley
306d6eacc1 Add redis to our travis runs 2016-05-20 15:26:09 -05:00
Colin
b59a1f8886 Merge pull request #148 from sschneid/master
Update license copyright
2016-01-14 16:07:49 -08:00
Scott Schneider
d11cd2964d Update license copyright 2016-01-14 15:48:24 -08:00
Colin
d4f3eb3c5f Merge pull request #147 from sschneid/add_disk
Allow new disks to be added to running VMs via vmpooler API
2016-01-14 14:38:24 -08:00
Scott Schneider
48a1a8d621 Add new disks via API
Add an additional disk to a running VM via the vmpooler API.

````
$ curl -X POST -H X-AUTH-TOKEN:a9znth9dn01t416hrguu56ze37t790bl --url vmpooler.company.com/api/v1/vm/fq6qlpjlsskycq6/disk/8
````
````json
{
  "ok": true,
  "fq6qlpjlsskycq6": {
    "disk": "+8mb"
  }
}
````

Provisioning and attaching disks can take a moment, but once the task completes it will be reflected in a `GET /vm/<hostname>` query:

````
$ curl --url vmpooler.company.com/api/v1/vm/fq6qlpjlsskycq6
````
````json
{
  "ok": true,
  "fq6qlpjlsskycq6": {
    "template": "debian-7-x86_64",
    "lifetime": 2,
    "running": 0.08,
    "state": "running",
    "disk": [
      "+8mb"
    ],
    "domain": "delivery.puppetlabs.net"
  }
}
2016-01-14 10:46:57 -08:00
Scott Schneider
9e8a7d034b Merge pull request #149 from frozenfoxx/master
Added prefix parameter to the vmpooler configuration
2016-01-14 10:42:33 -08:00
Scott Schneider
7d0f7254ae Disk-adding functionality for vsphere_helper lib
This commit adds the following functions:

- `add_disk`: the wrapper function to add a new disk to a VM

Usage is:

````
add_disk(vmname, disksize, datastore)
````

`vmname` is the name of the VM to add the disk to, `disksize` is the
disk size in MB, and `datastore` is the datastore on which to provision
the new disk.

`add_disk` required the addition of the following helper functions:

- `find_device`: locate a device object in vSphere
- `find_disk_controller`: find the disk controller used by a VM
- `find_disk_devices`: find the disk devices used by a VM
- `find_disk_unit_number`: find a free SCSI ID to assign to a new disk
- `find_vmdks`: find names of VMDK disks attached to a VM
2016-01-14 10:35:22 -08:00
FOXX
38a184c6f5 Made adjustments from colinPL 2016-01-14 12:27:46 -06:00
FOXX
10e507c262 Added prefix parameter to the vmpooler configuration 2016-01-14 11:42:12 -06:00
Colin
ad4e760f56 Merge pull request #109 from sschneid/dashboard2
An updated dashboard
2016-01-13 15:15:56 -08:00
Scott Schneider
5f787a3ca7 dashboard2 2016-01-13 12:01:05 -08:00
Scott Schneider
b79c3bfb75 Merge pull request #145 from frozenfoxx/patch-1
Updated YAML config variables in create_template_deltas.rb
2016-01-06 10:05:59 -08:00
FOXX
61bbb798ca Updated YAML config variables
The symbol notation for the YAML variables "server," "username," and, "password," were not working for me.  When changing them to strings the script seems to work.
2016-01-05 13:59:05 -06:00
Colin
b60ceb12bf Merge pull request #143 from cowofevil/maint/master/QA-2036/update_readme_for_client
(QA-2036) Update README for Client Utility
2015-12-28 10:52:31 -08:00
Ryan Gard
1a78b1ae0d (QA-2036) Update README for Client Utility
Add a new section to the README to reference the CLI utility for accessing
vmpooler services.
[skip ci]
2015-12-18 15:33:25 -08:00
Scott Schneider
1a6cd99ed2 Merge pull request #139 from heathseals/extraconfig
add guestinfo.hostname to VirtualMachineConfigSpecs
2015-11-13 10:13:55 -08:00
Scott Schneider
20fa7d20be Merge pull request #138 from sschneid/qeng_2807
(QENG-2807) Allow pool 'alias' names
2015-11-13 09:24:48 -08:00
Heath Seals
6b9bcc4307 add guestinfo.hostname to VirtualMachineConfigSpecs
This commit adds a custom guestinfo keyword and hostname variable
that allows the VMware Tools to query the hostname.
2015-11-10 16:50:27 -08:00
Scott Schneider
1fcda86124 Spec tests for pool aliases, /vm/:template
This PR adds spec testing for pool 'alias' functionality introduced in
17b24d6, as well as the following previously non-existant tests:

- new tests for handling requests for a VM from a nonexistant pool
- new tests for the `POST /vm/:template` endpoint
2015-11-05 11:53:38 -08:00
Scott Schneider
17b24d69ad Allow pool 'alias' names
The following pool configuration would allow a pool to be aliased in POST
requests as 'centos-6-x86_64', 'centos-6-amd64', or 'centos-6-64':

````yaml
- name: 'centos-6-x86_64'
  alias: [ 'centos-6-amd64', 'centos-6-64' ]
  template: 'templates/centos-6-x86_64'
  folder: 'vmpooler/centos-6-x86_64'
  datastore: 'instance1'
  size: 5
````

The 'alias' configuration can be either a string or an array.

Note that even when requesting an alias, the pool's 'name' is returned in
the JSON response:

````
$ curl -d '{"centos-6-64":"1"}' --url vmpooler/api/v1/vm
````
````json
{
  "ok": true,
  "centos-6-x86_64": {
    "hostname": "cuna2qeahwlzji7"
  },
  "domain": "company.com"
}
````
2015-11-05 11:51:53 -08:00
Michael Stahnke
36f83fef82 Merge pull request #137 from sschneid/token_vm_list
(QENG-2995) Display associated VMs in GET /token/:token endpoint
2015-11-05 10:36:15 -08:00
Scott Schneider
d74c9ff512 Don't require username/password authentication for GET /token/:token route 2015-11-04 13:19:15 -08:00
Scott Schneider
e0356968df (QENG-2995) Display associated VMs in GET /token/:token endpoint 2015-11-04 12:35:35 -08:00
Scott Schneider
12da1e07d2 Merge pull request #136 from briancain/master
Update API docs to include "domain" key for get vm requests
2015-10-20 14:58:34 -05:00
Brian Cain
e1168e1145 Update API docs to include "domain" key for get vm requests 2015-10-16 15:32:07 -07:00