Commit Graph

59 Commits

Author SHA1 Message Date
Sandon Van Ness
48357d666c Fix for #5836 (--lock-many with vms)
This makes --lock-many work when --machine-type vps is passed.
Before it wasn't handled correctly and guests were not created.
Now it creates and gives the back the user the list-targets for
said guests.

teuthology-lock --lock-many 4 --machine-type vps --os-type centos

This fixes issue #5836

Signed-off-by: Sandon Van Ness <sandon@inktank.com>
Reviewed-by: Alfredo Deza <alfredo@deza.pe>
2013-08-01 17:06:16 -07:00
Sandon Van Ness
b9c7445b1b More changes for creating vms manually with lock (no config)
Needed some more changes to allow for the case of creating vm's
manually with teuthology-lock instead of letting teuthology handle
it in internal.py with lock_machines(). Just some additional checks
to go to defaults when ctx.config is non-existent (causes an
attributeerror).

Signed-off-by: Sandon Van Ness <sandon@inktank.com>
Reviewed-by: Warren Usui <warren.usui@inktank.com>
2013-07-29 17:07:31 -07:00
Sandon Van Ness
d41b4e5ed6 Fixing teuthology-lock for os-type instead of vm-type.
Teuthology got updated to use --os-type and os_type in yaml
instead of --vm-type. I added this to teuthology but forgot
to update tuthology-lock as well for manually creating vms.

Signed-off-by: Sandon Van Ness <sandon@inktank.com>
2013-07-29 16:34:20 -07:00
Sandon Van Ness
c01c200f15 Allow OS version over-ride (distro version)
Read os_version from yaml to over-ride teuthology defaults.

Signed-off-by: Sandon Van Ness <sandon@inktank.com>
2013-07-26 16:15:19 -07:00
Sandon Van Ness
41cafb1a10 Merge remote-tracking branch 'origin/wip-sandon-vm'
Conflicts:
	teuthology/lock.py
	teuthology/misc.py
	teuthology/task/install.py
2013-07-25 19:50:02 -07:00
Sandon Van Ness
810cca1daf Added get_distro() to misc.py
Since getting the ostype is used multiple places I made a
function for it and modified the existing code to use
said function. I also added tests for the function.

Signed-off-by: Sandon Van Ness <sandon@inktank.com>
2013-07-25 14:45:02 -07:00
Sandon Van Ness
e6a30d73a7 Re-create guest if it already exists
In some cases tests fail or nuke fails and the guest is
not properly destroyed. This will look to see if it gets
an error due to the guest already existing or its disks
existing and will re-create the guest.

Signed-off-by: Sandon Van Ness <sandon@inktank.com>
2013-07-23 16:10:24 -07:00
Sandon Van Ness
52a886c596 Use os_type instead of vm_type. Add os_version
Use os_type instead of vm_type for more generic naming
for when we start re-imaging bare metal. Also added a
os_version dictionary for default versions of distros
that we want over-riding what downburst defaults are.

Signed-off-by: Sandon Van Ness <sandon@inktank.com>
2013-07-23 15:50:50 -07:00
Sage Weil
99c40128e4 lock: filter machine type for --list, --list-targets
Signed-off-by: Sage Weil <sage@inktank.com>
2013-07-17 20:54:16 -07:00
Sage Weil
608d8a201a lock: make --summary list all machines by default
Signed-off-by: Sage Weil <sage@inktank.com>
2013-07-17 20:54:15 -07:00
Sage Weil
1d16a9ba7f lock: drop machine-type default, but require for lock-many
Signed-off-by: Sage Weil <sage@inktank.com>
2013-07-17 20:54:08 -07:00
Sandon Van Ness
4f478ccf2c Add description option to lock.lock()
For some reason lock_many() has a description but lock()
does not. This was useful in my testing of unlocking and
re-locking VPS machines to destroy.

Signed-off-by: Sandon Van Ness <sandon@inktank.com>
2013-07-12 20:16:28 -07:00
Sandon Van Ness
d7a20ba293 Fix Missed parenthesis.
Signed-off-by: Sandon Van Ness <sandon@inktank.com>
2013-07-12 20:08:06 -07:00
Sandon Van Ness
da7483a741 VM: Use mac addresses from DB instead of randomizing.
In order to make IP addresses less likely to change and to allow
a smaller DHCP pool to be used I generated static MAC addresses
for all the vpm entries in the DB. I also put the correct entries
for all the other types of machines as well for their primary
(eth0) mac address as well in order to keep things standardized
and so there is another location where we have this information.

Without this fix going through a few tests would exhaust the DHCP
pool which at the time was around 460 IP addresses for virtual
machines and has since been upped to ~690 IP addresses.

Signed-off-by: Sandon Van Ness <sandon@inktank.com>
Reviewed-by: Warren Usui <warren.usui@inktank.com>
2013-07-12 20:05:39 -07:00
Sage Weil
b325d17030 lock: fix typo 2013-07-08 22:22:22 -07:00
Sandon Van Ness
d18fe740a2 VM: Use mac addresses from DB instead of randomizing.
In order to make IP addresses less likely to change and to allow
a smaller DHCP pool to be used I generated static MAC addresses
for all the vpm entries in the DB. I also put the correct entries
for all the other types of machines as well for their primary
(eth0) mac address as well in order to keep things standardized
and so there is another location where we have this information.

Without this fix going through a few tests would exhaust the DHCP
pool which at the time was around 460 IP addresses for virtual
machines and has since been upped to ~690 IP addresses.

Signed-off-by: Sandon Van Ness <sandon@inktank.com>
Reviewed-by: Warren Usui <warren.usui@inktank.com>
2013-07-08 16:54:22 -07:00
Sandon Van Ness
d54932cbc8 Fix VM issues.
Fix of #5494 although bad description. Instead of adding a wait
the code used to detect if the guest was back up is fixed. The
previous code appeared to assume only one machine and broke
when it was waiting for multiple machines if the guests did not
come up within 10 seconds of each other

Make nuke not do the normal stuff if the machine is a VPS as we
just destroy them when they get unlocked.

Instead of getting downburst options from ~/.teuthology.yaml get
it from the yaml given to teuthology for the test/task instead.

Fixed an error that would make all the default downburst values
not take effect if any of them were set via a yaml.

Signed-off-by: Sandon Van Ness <sandon@inktank.com>
Reviewed-by: Warren Usui <warren.usui@inktank.com>
2013-07-03 19:07:35 -07:00
Dan Mick
a3c1122658 teuthology-lock --summary: allow --machine-type=all
Somehow this got lost; putting it back

Signed-off-by: Dan Mick <dan.mick@inktank.com>
(cherry picked from commit e4eb4aa23b)
2013-06-10 14:10:52 -07:00
Warren Usui
d034e17a11 Merge branch 'wip-teuthVm-wusui' 2013-06-10 09:46:42 -07:00
Warren Usui
a4994e3bde Support added for running scheduled tasks on virtual machines.
This included:
    A). changes made so that full path names on some files were used
        (scheduled tasks started in different home directories).
    B.) Changes to insure tasks come up on the beanstalkc queue properly,
    C.) Finding and inserting the libvirt eqivalent code for vm machines
        in order to simulate ipmi actions,
    D.) Fix host key code, report valgrind issue more clearly.
    E.) Some message and downburst call changes.

    Fix #4988
    Fix #5122
    Signed-off-by: Warren Usui <warren.usui@inktank.com>
2013-06-07 19:32:15 -07:00
Dan Mick
e4eb4aa23b teuthology-lock --summary: allow --machine-type=all
Signed-off-by: Dan Mick <dan.mick@inktank.com>
2013-06-04 17:46:05 -07:00
Warren Usui
a12464f7db Do not scan for vm locks when listing all machines.
Fixes: #4830
Signed-off-by: Warren Usui <warren.usui@inktank.com>
2013-05-10 17:33:31 -07:00
Warren Usui
01d2e1593a For vms, fix some bad default configuration settings.
Fixes: #4881
Signed-off-by: Warren Usui <warren.usui@inktank.com>
2013-05-01 15:18:52 -07:00
Warren Usui
a0acdcf380 Use get('field', default) to assign downburst values for vps.
Fixes: #4592
Signed-off-by: Warren Usui <warren.usui@inktank.com>
Reviewed by: Dan Mick <dan.mick@inktank.com>
2013-04-25 12:49:09 -07:00
Warren Usui
fd750da993 Add changes to make teuthology suites work on vms.
Fixes: #4719
Signed-off-by: Warren Usui <warren.usui@inktank.com>
Reviewed by: Dan Mick <dan.mick@inktank.com>
2013-04-23 18:10:29 -07:00
Warren Usui
b7aaa1982c Check downburst paths. Display an appropriate error message if an
executable downburst cannot be found.

Fixes: #4693
Signed-off-by: Warren Usui <warren.usui@inktank.com>
Reviewed by: Dan Mick <dan.mick@inktank.com>
2013-04-23 16:28:38 -07:00
Sam Lang
a6b84a5613 lock: Fix import cycle breakage
fa2049f caused an import cycle between lock.py and misc.py.  Move the
needed functions from lock.py to lockstatus.py so that we can avoid the
import cycle.

Signed-off-by: Sam Lang <sam.lang@inktank.com>
2013-04-12 12:57:33 -05:00
Warren Usui
8129bffb17 Implement full reinstallation of a VM system.
Downburst create is used to reinstall a VM when it is locked.
Downburst destroy is used to remove a VM when it is unlocked.
Host keys are regenerated on each vm instantiation, so the keys
need to be checked prior to use.
If needed, qa-ceph-chef is run on newly installed systems to insure that
they are fully functional.

Signed-off-by: Warren Usui <warren.usui@inktank.com>
2013-04-03 12:29:47 -07:00
Sage Weil
0b72c8dbd2 lock: pass desc to lock operation; leave on unlock
Pass the desc to the lock operation.

The unlock operation now clears desc for us; no need to do it outselves.

Signed-off-by: Sage Weil <sage@inktank.com>
2013-03-25 16:47:02 -07:00
Dan Mick
e7cd598e60 lock: make do_summary() respect --machine-type
Signed-off-by: Dan Mick <dan.mick@inktank.com>
2013-03-20 18:31:11 -07:00
Sage Weil
fd1e083c61 lock: tolerate description of None
Signed-off-by: Sage Weil <sage@inktank.com>
2013-03-12 19:50:07 -07:00
Josh Durgin
cef6e5d5e9 lock: remove description when unlocking
This will hopefully make it easier to track down what's leaving nodes unlocked.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
2013-03-07 09:40:29 -08:00
Sage Weil
4869b494c9 lock: allow filtering by description, description substring
Signed-off-by: Sage Weil <sage@inktank.com>
2013-02-18 13:39:06 -08:00
Sandon Van Ness
75d86e47fd Made teuthology-lock --summary machine type aware.
Signed-off-by: Sandon Van Ness <sandon@van-ness.com>
2013-02-07 16:06:21 -08:00
Sandon Van Ness
030bc7c23d Added support for multiple types of machines.
Added the ability to support multiple types of machines with
--machine-type added to teuthology-lock when used with --lock-many
or --machine-type with teuthology --lock (automated tests). It
defaults to 'plana' and the 'vps' type is currently unused but
should be in the future.

Signed-off-by: Sandon Van Ness <sandon@van-ness.com>
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
2013-02-07 13:26:37 -08:00
Sage Weil
ff0f4742fe set machine description to ctx.archive when auto-locking machines for a run 2012-07-16 10:53:25 -07:00
tamil
353d9ccfe5 fixed typo
Signed-off-by: tamil <tamil.muthamizhan@inktank.com>
2012-07-12 16:36:40 -07:00
Dan Mick
03597ca6b9 Check for machine args based on local, not ctx.machines
Signed-off-by: Dan Mick <dan.mick@inktank.com>
2012-06-21 14:33:20 -07:00
Dan Mick
4fa665c19d --summary: add total counts, also note free machines
Signed-off-by: Dan Mick <dan.mick@inktank.com>
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
2012-06-07 13:50:51 -07:00
Dan Mick
44374bc4fb new variable lock hid lock() function 2012-06-06 20:29:28 -07:00
Dan Mick
9313cdea97 teuthology-lock: add --summary and --brief options
Signed-off-by: Dan Mick <dan.mick@inktank.com>
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
2012-06-06 18:54:33 -07:00
Dan Mick
fac88a4096 More shortnames fixes:
- Allow shortnames in teuthology-updatekeys as well
- Use list comprehensions instead of map()
2012-06-05 18:40:49 -07:00
Dan Mick
044697d178 Allow short names to teuthology-lock (e.g. "plana14")
Signed-off-by: Dan Mick <dan.mick@inktank.com>
Reviewed-by: Sam Just <sam.just@inktank.com>
2012-06-04 17:50:07 -07:00
Mark Nelson
31762c0003 lock: Improved logging when there aren't enough nodes available to lock-many. 2012-03-07 12:55:54 -08:00
Mark Nelson
05a07dda7d lock: Added a --locked flag to teuthology-lock.
Can be used to restrict searches based on lock status, e.g.
'teuthology-lock --list -a --locked false --status up' shows available nodes.
2012-03-07 12:55:33 -08:00
Josh Durgin
8f2ef43b9e lock: default to only listing machines you have locked
--all removes this restriction
2011-09-02 19:12:16 -07:00
Sage Weil
c2c5ac0c54 lock: --list-targets: list locks and dump result in targets: yaml format. 2011-08-24 10:03:43 -07:00
Josh Durgin
c7b62feac8 teuthology-lock: update usage 2011-08-02 16:15:57 -07:00
Josh Durgin
cd04423541 teuthology-lock: allow list of locks to be filtered by owner and status 2011-08-02 15:56:14 -07:00
Josh Durgin
629187f302 Set content-type with PUT. 2011-07-19 18:34:42 -07:00