Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

backport ceph-disk to dumpling #1232

Merged
merged 30 commits into from Feb 13, 2014
Merged

backport ceph-disk to dumpling #1232

merged 30 commits into from Feb 13, 2014

Conversation

alfredodeza
Copy link
Contributor

To get the fix for 7334 to dumpling it was safer to backport all the recent work on ceph-disk that makes it safer to run system commands regardless of the path.

This PR backports all the ceph-disk commits, syncing dumpling with current master.

There is only one commit that had to be bisected and is duly noted on the commit message with the hash of the original commit so that it can be backtracked.

git-harry and others added 30 commits February 12, 2014 16:05
get_fsid and find_cluster_by_uuid are modified so ceph-disk activate and
ceph-disk activate-all will work if the fsid uses uppercase characters.

Signed-off-by: Harry Harrington <git-harry@live.co.uk>
(cherry picked from commit 22f8325)
blkid -s TYPE /dev/fd0 has been verified to hang forever on a
H8DMR-82 supermicro motherboard running

3.8.0-33-generic #48~precise1-Ubuntu SMP Thu Oct 24 16:28:06 UTC 2013
x86_64

It is unlikely that ceph will ever be used on floppy disks, they
can be blacklisted.

http://tracker.ceph.com/issues/6827 fixes: #6827

Signed-off-by: Loic Dachary <loic@dachary.org>
(cherry picked from commit 6570197)
…PT table.

Signed-off-by: Jonathan Davies <jonathan.davies@canonical.com>
Reviewed-by: Sage Weil <sage@inktank.com>
Reviewed-by: Loic Dachary <loic@dachary.org>
(cherry picked from commit 35011e0)
Signed-off-by: Alfredo Deza <alfredo@deza.pe>
(cherry picked from commit e19e380)
Signed-off-by: Alfredo Deza <alfredo@deza.pe>
(cherry picked from commit 43561f7)
Signed-off-by: Alfredo Deza <alfredo@deza.pe>
(cherry picked from commit a9334a1)
Signed-off-by: Alfredo Deza <alfredo@deza.pe>
(cherry picked from commit 897dfc1)
If given no argument, ceph-disk zap should display the usage instead of
silently doing nothing. Silence can be confused with "I zapped all the
disks".

http://tracker.ceph.com/issues/6981 fixes #6981

Signed-off-by: Loic Dachary <loic@dachary.org>
(cherry picked from commit 07888ef)
ceph-disk does nothing when given a device that is already prepared. If
given a directory that already contains a successfully prepared OSD, it
will however override it.

Instead of overriding the files in the osd data directory, return
immediately if the magic file exists. Make it so the magic file is
created last to accurately reflect the success of the OSD preparation.

Signed-off-by: Loic Dachary <loic@dachary.org>
(cherry picked from commit 7dfe550)
Mainly using % instead of ,

Signed-off-by: Loic Dachary <loic@dachary.org>
(cherry picked from commit b82ccfb)
Signed-off-by: Loic Dachary <loic@dachary.org>
(cherry picked from commit de00505)
Signed-off-by: Loic Dachary <loic@dachary.org>
(cherry picked from commit 324804a)
Signed-off-by: Loic Dachary <loic@dachary.org>
(cherry picked from commit 55ca7bb)
Signed-off-by: Loic Dachary <loic@dachary.org>
(cherry picked from commit 908348b)
/usr/bin is hardcoded in front of some ceph programs which makes it
impossible to control where they are located via the PATH.

The hardcoded path cannot be removed altogether because it will most
likely lead to unexpected and difficult to diagnose problems for
existing installations where the PATH finds the program elsewhere.

The --prepend-to-path flag is added and defaults to /usr/bin : it prepends
to the PATH environment variable. The hardcoded path is removed
and the PATH will be used: since /usr/bin is searched first, the
legacy behavior will not change.

Signed-off-by: Loic Dachary <loic@dachary.org>
(cherry picked from commit ad6b4b4)
Instead of relying on a hardcoded set of if paths. Although this has the
potential of changing the location of the binary being used by ceph-disk
on an existing installation, it is currently only used for sgdisk. It
could be disruptive for someone using a modified version of sgdisk but
the odds of this happening are very low.

Signed-off-by: Loic Dachary <loic@dachary.org>
(cherry picked from commit 2b935bb)
The string form of a CalledProcessError instance does not include the
output datamember. Add it to the Error exception for debug purposes.

Signed-off-by: Loic Dachary <loic@dachary.org>
(cherry picked from commit d09af0f)
CalledProcessError has no errno data member

Signed-off-by: Loic Dachary <loic@dachary.org>
(cherry picked from commit 97f516a)
Use get_conf_with_default instead of get_conf because fsid is a known
ceph configuration option. It allows overriding via CEPH_ARGS which is
convenient for testing. Only options that are not found in config_opts.h
are fetch via get_conf.

Signed-off-by: Loic Dachary <loic@dachary.org>
(cherry picked from commit b65eb37)
It is meant to be used when preparing and activating a directory that is
not to be used with init. No file is created to identify the init
system, no symbolic link is made to the directory in /var/lib/ceph
and the init scripts are not called.

Signed-off-by: Loic Dachary <loic@dachary.org>
(cherry picked from commit e773b68)
Signed-off-by: Loic Dachary <loic@dachary.org>
(cherry picked from commit 0fcc081)
Instead of failing if the OSD data directory does not exist, create
it. Only do so if the data directory is not enforced to be a device via
the use of the --data-dev flag. The directory is not recursively created.

Signed-off-by: Loic Dachary <loic@dachary.org>
(cherry picked from commit 306b099)
Signed-off-by: Loic Dachary <loic@dachary.org>
(cherry picked from commit 51ee3c0)
Replace hardcoded /var/lib/ceph with the STATEDIR global variable and
implement the --statedir option to override the default value.

Signed-off-by: Loic Dachary <loic@dachary.org>
(cherry picked from commit ca713f4)
Replace hardcoded /etc/ceph with the SYSCONFDIR global variable and
implement the --sysconfdir option to override the default value.

Signed-off-by: Loic Dachary <loic@dachary.org>
(cherry picked from commit a71025d)
When run by the udev rules, PATH is not defined. Thus,
ceph-disk-activate relies on its which() function to locate the
correct executable.  The which() function used os.defpath if none was
set, and this worked for anything using it.

ad6b4b4 added a new default value to
PATH, so only /usr/bin was checked by callers that did not use
which(). This resulted in the mount command not being found when
ceph-disk-activate was run by udev, and thus osds failing to start
after being prepared by ceph-deploy.

Make ceph-disk consistently use the existing helpers (command() and
command_check_call()) that use which(), so lack of PATH does not
matter. Simplify _check_output() to use command(),
another wrapper around subprocess.Popen.

Fixes: #7258
Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
(cherry picked from commit d7b0c7f)
Signed-off-by: Alfredo Deza <alfredo@deza.pe>
(cherry picked from commit 42900ff)
Signed-off-by: Alfredo Deza <alfredo@deza.pe>
(cherry picked from commit 9bcc42a)
The ceph-osd will resize journal files up and properly fallocate() them
so that the blocks are preallocated and (hopefully) contiguous.  We
don't need to do it here too, and getting fallocate() to work from
python is a pain in the butt.

Fixes: #5981
Signed-off-by: Sage Weil <sage@inktank.com>
(cherry picked from commit a786ad7)
Note that this commit is actually bisecting the changes from
Loic Dachary that touch ceph-disk only (ad515bf). As that changeset
also touches other files it causes conflicts that are not resolvable
for backporting it to dumpling.

Signed-off-by: Alfredo Deza <alfredo@deza.pe>
@liewegas liewegas merged commit 1c42a6e into dumpling Feb 13, 2014
@liewegas liewegas deleted the dumpling-7334 branch February 13, 2014 14:55
liewegas added a commit that referenced this pull request Dec 14, 2016
tasks: use new generic objectstore_blackhole option
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
5 participants