Commit Graph

107 Commits

Author SHA1 Message Date
Sandon Van Ness
88b7d02970 Fix for Debian wheezy (remove vda from block device list)
On debian wheezy its mount output uses device-by-label and makes
our normal method of checking if a device is mounted not work.
Since vm's will always be vda for their boot device we will just
remove it from devs if its in there so it doesn't attempt to zap
vda.

I also added a strip() to remove the last blank entry that was
always getting added to the devs list on all machines. Example:

devs=['/dev/sda', '/dev/sdb', '/dev/sdc', '/dev/sdd', '']

Signed-off-by: Sandon Van Ness <sandon@inktank.com>
Reviewed-by: Alfredo Deza <alfredo@deza.pe>
2013-08-01 12:33:11 -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
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
Josh Durgin
42b9ea95da misc: move system type checking to a generic location
Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
2013-07-09 18:52:00 -07:00
Sage Weil
13dbe9d1a5 enable-coredump -> adjust-ulimits
and set max_files to be big, too!
2013-06-23 09:15:28 -07:00
Sandon Van Ness
d39d648ead Merge remote-tracking branch 'remotes/origin/wip-sandon-cephdeploy' 2013-06-21 15:53:53 -07:00
Sandon Van Ness
f6270a7fb0 Wipe out existing id_rsa.pub and id_rsa before pushing ssh keys
A very simple change. Just touch a file first (to create it if it
doesn't yet exist so the delete doesn't error out) and then delete
it before pushing the keys to the file. This should avoid the
id_rsa.pub and id_rsa files from getting messed up due to previous
runs which were interrupted or failed (or if those files exist for
some reason). This appears to be what was causing breaking in the
ceph-deploy nightlies.

Signed-off-by: Sandon Van Ness <sandon@inktank.com>
2013-06-21 14:45:36 -07:00
Warren Usui
778d930d08 Fix to ignore ssh-key checking if running on virtual machines or
if a line that reads 'sshkey: ignore' is in the yaml file.

Fix #5364
Signed-off-by: Warren Usui <warren.usui@inktank.com>
2013-06-19 11:12:09 -07:00
Warren Usui
1441707222 Make reset of ssh key code conditional on being a virtual machine.
Add and use is_vm to determine if we are running on a virtual machine.

Fix #5364
Signed-off-by: Warren Usui <warren.usui@inktank.com>
2013-06-19 11:12:05 -07:00
Sage Weil
7887f84f9d misc: let clients use any pool
rados.py, for example, creates new pools for each instance.
2013-06-16 14:53:49 -07:00
Sage Weil
1ec8ba50fc no need for ceph --concise argument 2013-06-16 09:10:38 -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
Josh Durgin
8f76d2ee13 Merge remote branch 'origin/next' 2013-05-01 09:52:02 -07:00
Josh Durgin
52742fb072 fix some errors found by pyflakes
Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
2013-04-30 17:09:19 -07:00
Josh Durgin
4979df32c5 misc: move daemon stopping function to a generic place
This will be useful for other daemons, like radosgw, in the future.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
2013-04-30 16:35:11 -07:00
Sage Weil
4f70c898ef misc: default base_test_dir to /home/ubuntu/cephtest
This matches what the teuthworker is currently doing.
2013-04-30 09:15:37 -07:00
Sam Lang
a629e9eec4 Merge branch 'next'
Conflicts:
	teuthology/lock.py
	teuthology/lockstatus.py
	teuthology/misc.py
	teuthology/task/install.py
2013-04-17 18:09:39 -05:00
Sam Lang
77cf9f4b68 misc: Fix for case status['description'] == None
Skip the machine that has a description, but the
value is None.

Signed-off-by: Sam Lang <sam.lang@inktank.com>
Reviewed-by: Warren Usui <warren.usui@inktank.com>
2013-04-17 17:43:14 -05:00
Sam Lang
3f78cb0d3a misc: Check for 'None' string from yaml
The description attribute from the machines yaml returned by the
locker might be the string 'None'.  Need to explicitly check for
that to avoid using a test dir of /tmp/cephtest/None.

Signed-off-by: Sam Lang <sam.lang@inktank.com>
2013-04-17 10:36:42 -05:00
Sam Lang
750c69b08c misc: Check for 'None' string from yaml
The description attribute from the machines yaml returned by the
locker might be the string 'None'.  Need to explicitly check for
that to avoid using a test dir of /tmp/cephtest/None.

Signed-off-by: Sam Lang <sam.lang@inktank.com>
2013-04-17 10:30:57 -05:00
Sam Lang
1727d9b356 misc: Use pythonic 'is not None' for jobid case
The conditional 'if global_jobid:' evaluates to true
in some cases even when global_jobid is None.

Signed-off-by: Sam Lang <sam.lang@inktank.com>
2013-04-17 10:30:20 -05:00
Sam Lang
c1d47a2c63 misc: Fix name parsing
Use last two digits of year.

Signed-off-by: Sam Lang <sam.lang@inktank.com>
2013-04-17 10:30:02 -05:00
Sam Lang
b37f43db1b 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>

Conflicts:
	teuthology/lock.py
2013-04-17 10:28:55 -05:00
Sam Lang
72cbf1157a misc: Use job id and make short path for testdir
Nightlies run on teuthology currently use a testdir of
/home/ubuntu/cephtest, but this causes stale job errors occasionally
from the previous tests not getting properly cleaned up, which prevents
the nightlies from running successfully.

The misc.py get_testdir() function can specify a testdir that is
specific to the job, but previously the path was too long and would
cause separate job failures.

This patch does two things to resolve that.  First, it uses the job id
from the teuthology run if one exists.  This should be a relatively
short number that will identify the job run effectively.  Second,
if the job id isn't available, it creates a shortened form of the
job's name, for example the job name:

teuthology-2013-04-09_23:51:49-rgw-next-testing-basic

becomes:

te1304092351rntb

Signed-off-by: Sam Lang <sam.lang@inktank.com>
2013-04-17 10:24:16 -05:00
Sam Lang
90e2a2ef02 misc: Fix close() call to pass in fd
fd is an int, we need to use os.close().

Signed-off-by: Sam Lang <sam.lang@inktank.com>
2013-04-15 16:26:22 -05:00
Sam Lang
cde1429e13 misc: Fix bug in calling function remote_mktemp()
Changed the name of the function to get a remote temporary filename,
need to update all the locations where it gets called.

Signed-off-by: Sam Lang <sam.lang@inktank.com>
2013-04-15 16:16:34 -05:00
Sam Lang
fe513353c6 Merge pull request #11 from ceph/wip-4717
misc: Use tempfile.mkstemp() instead of tempnam
2013-04-15 11:44:59 -07:00
Sam Lang
3b0d91533e misc: Use tempfile.mkstemp() instead of tempnam
tempnam() is considered an unsafe security risk because the filename
generated is easy to guess and can be symlinked in advance.  Use
mkstemp() instead.

Signed-off-by: Sam Lang <sam.lang@inktank.com>
Reviewed-by: Joe Buck <jbbuck@gmail.com>
2013-04-15 13:43:20 -05:00
Sam Lang
50aaece463 misc: Use pythonic 'is not None' for jobid case
The conditional 'if global_jobid:' evaluates to true
in some cases even when global_jobid is None.

Signed-off-by: Sam Lang <sam.lang@inktank.com>
2013-04-13 10:12:45 -05:00
Sam Lang
715245e100 misc: Fix name parsing
Use last two digits of year.

Signed-off-by: Sam Lang <sam.lang@inktank.com>
2013-04-12 19:04:19 -05: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
Sam Lang
fa2049ffbb misc: Use job id and make short path for testdir
Nightlies run on teuthology currently use a testdir of
/home/ubuntu/cephtest, but this causes stale job errors occasionally
from the previous tests not getting properly cleaned up, which prevents
the nightlies from running successfully.

The misc.py get_testdir() function can specify a testdir that is
specific to the job, but previously the path was too long and would
cause separate job failures.

This patch does two things to resolve that.  First, it uses the job id
from the teuthology run if one exists.  This should be a relatively
short number that will identify the job run effectively.  Second,
if the job id isn't available, it creates a shortened form of the
job's name, for example the job name:

teuthology-2013-04-09_23:51:49-rgw-next-testing-basic

becomes:

te1304092351rntb

Signed-off-by: Sam Lang <sam.lang@inktank.com>
2013-04-11 13:53:38 -05:00
Joe Buck
4258807bfc teuthology: remove previous test ssh keys
Updated the ssh-keys task to cleanup
any left-over keys from previous tasks
(indicated by the user being 'ssh-keys-user').
Also, some of the functions in the ssh_keys task seem
like they could be useful in general.
This patch refactors them into misc.py.

Signed-off-by: Joe Buck <jbbuck@gmail.com>
Reviewd-by: Sam Lang <sam.lang@inktank.com>
2013-04-04 15:55:54 -07:00
Sam Lang
13d0d5ab96 task/ceph_manager: Only reconnect if powercycled
We don't need to reconnect for remotes
that haven't been powercycled.

Signed-off-by: Sam Lang <sam.lang@inktank.com>
2013-03-13 11:15:51 -05:00
Sage Weil
0ad55b3604 cfuse -> ceph-fuse 2013-02-18 13:39:05 -08:00
Sage Weil
88ebc27f16 ceph: store logs in normal location
We need to switch around how these are compressed and pulled, since they
aren't in the regular archive dir anymore.

Signed-off-by: Sage Weil <sage@inktank.com>
2013-02-18 13:39:05 -08:00
Sage Weil
d1d36241b7 ceph: use default data, keyring locations
This required reordering the cluster setup so that we do the ceph-osd
--mkfs --mkkey prior to gathering keys and initializing the monitors.

Also, run daemons as root.

Signed-off-by: Sage Weil <sage@inktank.com>
2013-02-18 13:39:05 -08:00
Sage Weil
c9d3dea320 avoid secretfile, except for kclient
Only mount.ceph needs the secret in a standalone file.  Remove other users,
and simplify that one.

Signed-off-by: Sage Weil <sage@inktank.com>
2013-02-18 13:39:05 -08:00
Sage Weil
eadefec8ff ceph: put client keyrings in /etc/ceph/ceph.$name.keyring
And make it world readable, for ubuntu's sake.

Signed-off-by: Sage Weil <sage@inktank.com>
2013-02-18 13:39:04 -08:00
Sander Pool
c525e1061b Install ceph debs and use installed debs
The ceph task installs ceph using the debian
packages now, and all invocations of binaries installed
in {tmpdir}/binary/usr/local/bin/ are replace with
the use of the binaries installed in standard locations
by the debs.

Author:    Sander Pool <sander.pool@inktank.com>
Signed-off-by: Sam Lang <sam.lang@inktank.com>
2013-02-18 13:39:03 -08:00
Sage Weil
7a5fd05edd misc: replace : with - in testdir name
The :'s break the list in $PATH.

Signed-off-by: Sage Weil <sage@inktank.com>
2013-02-17 22:13:45 -08:00
Sam Lang
100e9056ed misc: Close connections on reboot
When nodes are rebooted, the connections remain open
even after calling reconnect and setting up new ssh
sessions to the rebooted nodes.  This causes ECONNRESET
errors to show up in the teuthology output.

Close the existing connections before trying to reconnect.

Signed-off-by: Sam Lang <sam.lang@inktank.com>
2013-02-05 16:20:52 -06:00
Josh Durgin
2f41f81dfa misc: don't use colon in default run name
LD_LIBRARY_PATH does not work with colons (and backslash does not escape them.)
2013-02-04 10:39:40 -08:00
Sam Lang
150a3d7d9e misc: Don't include existing partitions in devs
We don't want to include /dev/sda1, etc. in the
list of devices to use.

Signed-off-by: Sam Lang <sam.lang@inktank.com>
2013-02-01 10:53:47 -06:00
Sam Lang
64e3966779 misc: get_wwn_id_map() needs to return dict
If we can't find device ids, we need to return
a dict, not a list.

Signed-off-by: Sam Lang <sam.lang@inktank.com>
2013-02-01 09:13:48 -06:00
Sam Lang
ac4ba69d8d misc: Fix get_wwn_id_map() to be optional
Not all plana nodes have symlinks setup when
we check /dev/disk/by-id/wwn-*.  Instead of failing
here, just use the /dev/disk/sd* devices.

Signed-off-by: Sam Lang <sam.lang@inktank.com>
2013-02-01 08:20:43 -06:00
Sam Lang
8f720454cb Assign devices to osds using the device wwn
Linux doesn't guarantee device names (/dev/sdb, etc.)
are always mapped to the same disk.  Instead of assigning
nominal devices to osds, we map devices by their wwn
(/dev/disk/by-id/wwn-*) to an osd (both data and journal).

Signed-off-by: Sam Lang <sam.lang@inktank.com>
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
2013-01-31 08:23:39 -06:00
Sam Lang
ace4cb07b2 Replace /tmp/cephtest/ with configurable path
Teuthology uses /tmp/cephtest/ as the scratch test directory for
a run.  This patch replaces /tmp/cephtest/ everywhere with a
per-run directory: {basedir}/{rundir} where {basedir} is a directory
configured in .teuthology.yaml (/tmp/cephtest if not specified),
and {rundir} is the name of the run, as given in --name.  If no name
is specified, {user}-{timestamp} is used.

To get the old behavior (/tmp/cephtest), set test_path: /tmp/cephtest
in .teuthology.yaml.

This change was modivated by #3782, which requires a test dir that
survives across reboots, but also resolves #3767.

Signed-off-by: Sam Lang <sam.lang@inktank.com>
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
2013-01-31 08:23:31 -06:00
Sam Lang
53f22d9493 task/mds_thrasher: New task for thrashing the mds
Signed-off-by: Sam Lang <sam.lang@inktank.com>
2013-01-18 15:48:52 -06:00