Commit Graph

90 Commits

Author SHA1 Message Date
Warren Usui
b7a7383d75 Allow .teuthology.yaml to set downburst path
If .teuthology.yaml defines downburst, _get_downburst_exec()
now returns that value as the path to the downburst executable.

Also cleaned up code in create_if_vm.  ctx.downburst_conf was
never defined, so the code that handled the AttributeError
was always being executed.

Fixes: 6921

Signed-off-by: Warren Usui <warren.usui@inktank.com>
2014-05-09 17:20:26 -07:00
Sandon Van Ness
9078513c0b Fix for #8115
Increase boot disk size per #8115 where monitors shut down due to
/ being full on vm machines.

Signed-off-by: Sandon Van Ness <sandon@inktank.com>
2014-04-22 12:35:11 -07:00
Warren Usui
4c0151367e Improve unlock error messages.
Added messages if the hostname is invalid, and if
the user is not the owner of the lock.

Fixes: 6295
Signed-off-by: Warren Usui <warren.usui@inktank.com>
2014-04-14 17:21:37 -07:00
Dan Mick
6dc29904c6 Change status to _status everywhere (fix regression)
0550dd1191 didn't add '_' to 'status'
everywhere it was needed.

Signed-off-by: Dan Mick <dan.mick@inktank.com>
2014-04-10 14:53:10 -07:00
Alfredo Deza
0550dd1191 more statuses redefinition fixes
Signed-off-by: Alfredo Deza <alfredo.deza@inktank.com>
2014-04-09 16:56:19 -04:00
Alfredo Deza
30f3b01a0d rename variable to avoid collision
Signed-off-by: Alfredo Deza <alfredo.deza@inktank.com>
2014-04-09 16:36:18 -04:00
Sage Weil
1ccabd802f lock: allow -a with --brief
Signed-off-by: Sage Weil <sage@inktank.com>
2014-03-12 08:57:23 -07:00
Dan Mick
69ed31cc34 lock.py: allow --brief to stand on its own (without --list)
I use --brief all the time, and it's annoying to have to type
the useless --list at the same time.

Signed-off-by: Dan Mick <dan.mick@inktank.com>
2014-03-10 19:38:46 -07:00
Zack Cerza
cfb7b948ea Guard against ctx.config being unset or None
Signed-off-by: Zack Cerza <zack.cerza@inktank.com>
2014-02-21 09:43:33 -06:00
Zack Cerza
021f84ac64 Simplify create_if_vm's downburst config logic
Signed-off-by: Zack Cerza <zack.cerza@inktank.com>
2014-02-20 17:46:08 -06:00
Dan Mick
381d4aa873 lock.py: request only rsa keys from ssh-keyscan
New versions of ssh-keyscan return two keytypes if possible; this
breaks the comparison of "number of lines of output from keyscan"
to "number of hosts we request keys from".  Fix by asking for only
one type of key (as older ssh-keyscans did).

Fixes: #7164
Signed-off-by: Dan Mick <dan.mick@inktank.com>
2014-01-16 12:51:39 -08:00
Warren Usui
94f7dd1f3a Implement --downburst-conf parameter for teuthology-lock.
Load the appropriate yaml information when found (this formerly
did not work).  Make sure teuthology --lock works with a downburst
entry in the yaml files.  Document how this works in README.rst.

Fixes: #6921
Reviewed-by: Dan Mick
2013-12-04 17:31:55 -08:00
Sandon Van Ness
c0297b436a Changes suggested per review.
Signed-off-by: Sandon Van Ness <sandon@inktank.com>
2013-11-25 01:19:13 -08:00
Sandon Van Ness
f7af3e723e Schedule-suite Use 'multi' tube for multiple types. Scheduling.
Signed-off-by: Sandon Van Ness <sandon@inktank.com>
2013-11-21 15:21:19 -08:00
Sandon Van Ness
c38eeec85f Allow ability to use multi machine type deliminated by ,- \t.
I was originally attempting a more complicated locking mechanism
but I think its almost as good to just have it attempt the other
machine type if one.

Signed-off-by: Sandon Van Ness <sandon@inktank.com>
2013-11-21 14:19:44 -08:00
Sandon Van Ness
d4a632df5f Support --os-version as argument.
You can use --os-type as an argument when not running teuthology
tests but instead just using teuthology-lock. This adds the ability
to also use --os-version so you can specify the version of the
distro without having to run an actual test with a yaml like you
normally would have had to do setting os_version in the yaml.

Signed-off-by: Sandon Van Ness <sandon@inktank.com>
2013-10-25 17:48:50 -07:00
Zack Cerza
ded5c219fc Remove needless arg from list_locks()
Signed-off-by: Zack Cerza <zack.cerza@inktank.com>
2013-10-16 16:20:24 -05:00
Zack Cerza
494c3b1fbe Make verbosity propagate correctly to modules
Signed-off-by: Zack Cerza <zack.cerza@inktank.com>
2013-10-11 17:10:57 -05:00
Zack Cerza
d341b588a7 Ignore the exit code of ssh-keyscan
Signed-off-by: Zack Cerza <zack.cerza@inktank.com>
2013-10-11 12:48:55 -05:00
Zack Cerza
098389da82 Properly express conflicting options
Signed-off-by: Zack Cerza <zack.cerza@inktank.com>
2013-10-10 19:09:35 -05:00
Zack Cerza
755ac2f129 Move teuthology-updatekeys' arg parsing to scripts/
Signed-off-by: Zack Cerza <zack.cerza@inktank.com>
2013-10-10 19:09:34 -05:00
Zack Cerza
974898597f Move teuthology-lock's arg parsing to scripts/
Signed-off-by: Zack Cerza <zack.cerza@inktank.com>
2013-10-10 19:09:34 -05:00
Zack Cerza
6b2f2780e0 PEP-8
Signed-off-by: Zack Cerza <zack.cerza@inktank.com>
2013-10-10 19:09:34 -05:00
Zack Cerza
db1231b467 Use config.lock_server 2013-09-20 14:34:53 -05:00
tamil
eb4c575f54 made help more readable
Signed-off-by: tamil <tamil.muthamizhan@inktank.com>
2013-09-12 15:03:10 -07:00
tamil
40d6c60f13 feature # 5942. Added examples to teuthology binaries help page
Signed-off-by: tamil <tamil.muthamizhan@inktank.com>
2013-09-11 17:13:22 -07:00
Warren Usui
a899b58095 Display error message when locking a vpm fails due to downburst errors.
When doing a lock-many, do not lock any of the vpms when downburst errors
occur.   Made error messages more accurate, and removed a destroy_if_vm call
because the destroy was alreadly called in unlock.  Changed some print
messages to be log.info displays.

Fix: 5957
Signed-off-by: Warren Usui <warren.usui@inktank.com>
2013-08-16 16:23:09 -07:00
Zack Cerza
ab2d2fad3c Default to log level INFO. 2013-08-15 08:29:09 -05:00
Warren Usui
2c88757882 Revert "Display error message when locking a vpm fails due to downburst errors."
This reverts commit 4681b35016.
2013-08-14 10:31:21 -07:00
Warren Usui
4681b35016 Display error message when locking a vpm fails due to downburst errors.
When doing a lock-many, do not lock any of the vpms when downburst errors
occur.   Do not display message on unlock with downburst error, because
slot is still freed (and can be locked by someone else).

Fix: 5957
Signed-off-by: Warren Usui <warren.usui@inktank.com>
2013-08-14 09:40:56 -07:00
Zack Cerza
7a14a93d91 Add a useful error message in case of an invalid hostname 2013-08-06 15:21:34 -05:00
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