mon,osd: do not use crush_device_class file to initalize class for new osds
Reviewed-by: Alfredo Deza <adeza@redhat.com>
Reviewed-by: Kefu Chai <kchai@redhat.com>
Reviewed-by: Andrew Schoen <aschoen@redhat.com>
If provided, set the OSD device_class at OSD creation time. This is
simpler than writing a file that the OSD has to read in and use to
set its initial device class, and also avoids a bit of sticky state
at the OSD that will make it keep trying to reset its device class on
startup if it ever gets cleared.
Note that we now ignore json input fields we don't understand, so remove
a test case.
Signed-off-by: Sage Weil <sage@redhat.com>
rbd: unified way to map images using different drivers
Reviewed-by: Jason Dillaman <dillaman@redhat.com>
Reviewed-by: Ilya Dryomov <idryomov@redhat.com>
Reviewed-by: Willem Jan Withagen <wjw@digiware.nl>
It is difficult to make it work reliably in different environments.
Fixes: http://tracker.ceph.com/issues/22803
Signed-off-by: Mykola Golub <mgolub@suse.com>
* tweak create a cloned image when the source image is
a clone (or at least one of its snapshots is a clone).
Signed-off-by: songweibin <song.weibin@zte.com.cn>
Replaced the delay argument for the trash move
command with a string acceptable by /bin/date, e.g.:
$ rbd trash move --pool foo --image bar --expires-in "2 weeks"
Added a "rbd trash purge" command that deletes any expired
image from the trash, has also a command to alter the current
expiration date with the "--older-than" argument which accepts
again a valid argument for /bin/date, e.g.:
$rbd trash purge mypool --older-than "2017-08-20"
There is also the "threshold" argument which tries to remove the
oldest trashed images (by deferment end time) until the pool space
is freed up to a percentage point, e.g.:
$ rbd trash purge mypool --threshold 0.9
If mypool uses 1GB it will try to remove trashed images until the
pool usage becomes equal to or lower than 900MB.
Signed-off-by: Theofilos Mouratidis <t.mour@cern.ch>
in test_mon_osd_misc(), there is good chance that the cluster chooses
to use an unbalanced weight because of the data distribution at that moment.
but this setting could prevent the CRUSH from choosing enough number of
OSDs for test_mon_cephdf_commands(), where 32 PGs are to be created. so
it's more likely that the CRUSH fails to pick enough OSDs for all PGs.
that's why we have a curr_object_copies_rate = 0.5.
so, in this change, pg=pgp=1 is specified for the new pool.
Fixes: http://tracker.ceph.com/issues/22711
Signed-off-by: Kefu Chai <kchai@redhat.com>
mon/OSDMonitor.cc : set erasure-code-profile to "" when create replicated pools.
Reviewed-by: Joao Eduardo Luis <joao@suse.de>
Reviewed-by: Kefu Chai <kchai@redhat.com>
Defines asynchronous librados operations that satisfy all of the
"Requirements on asynchronous operations" imposed by the C++ Networking
TS [1] in section 13.2.7. These operations are implemented in terms of
boost::asio, but the interfaces themselves are free of boost types -
this makes the transition to std::net trivial when it's available.
These interfaces conform to the Extensible Asynchronous Model [2] that
originated in boost::asio. This model allows the last 'handler' argument
to either be a callback that gets the result, a coroutine yield_context
that will suspend until completion, or a 'use_future' tag to request the
result in a std::future (see the unit tests for examples of each). The
'Extensible' part also enables further integration with new frameworks.
For now, only async_read(), async_write(), and the read/write variants
of async_operate() are provided.
[1] Working Draft, C++ Extensions for Networking
http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/n4711.pdf
[2] "Library Foundations for Asynchronous Operations"
http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n3896.pdf
Signed-off-by: Casey Bodley <cbodley@redhat.com>
when we create a pool specify a rule, for example "ceph osd pool create foo replicated 10 rule_foo",
we will set pool foo erasure-code-profile to rule_foo,
if there has an erasure-code-profile names rule_foo, use "ceph osd erasure-code-profile rule_foo" will fail,
"Error EBUSY: foo pool(s) are using the erasure code profile 'rule_foo'", this is wrong.
we should do:
1. set erasure-code-profile to "" when create replicated pools
2. whether erasure-code-profile is used by pool not only judge pool erasure_code_profile property and also the pool is_erasure
Signed-off-by: zouaiguo <zou.aiguo@zte.com.cn>
100MB will be allocated for journal, and the remaining 100MB is for data
device. taking the inode into consideration, there will be approximately
87988 kB available for the activated OSD. and it will complain with a
"nearfull" state.
Fixes: http://tracker.ceph.com/issues/22136
Signed-off-by: Kefu Chai <kchai@redhat.com>
normally, if we care about the output of ceph-disk, we expect a json
string, and ceph-disk sends the output to stdout, and errors/warnings
to stderr. so everything works as expected. and the test should also
follow this tradition. for example, if deprecated warnings are printed,
the warning message should not be collected along with the json string.
see also: d44334f3
Signed-off-by: Kefu Chai <kchai@redhat.com>
ceph-disk now prints "depreacted" warning message when it starts. but
the tests parses its stdout and stderr for a json string. so we need to
silence the warnings for the tests.
Fixes: http://tracker.ceph.com/issues/22154
Signed-off-by: Kefu Chai <kchai@redhat.com>
"ceph osd create" is not idempotent, and is considered deprecated.
Fixes: http://tracker.ceph.com/issues/21993
Signed-off-by: Kefu Chai <kchai@redhat.com>
This test is incomplete and has been obsoleted by krbd_blkroset.t.
It's also not wired up, so it's not actually being run.
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
For the new read-based bench tests, flushing prior to the start of the test
will result in the exclusive lock being acquired and the object map being
utilized.
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
ceph osd pool create test 100
Error ERANGE: pg_num 100 size 3 would mean 648 total pgs, which exceeds max 600 (mon_max_pg_per_osd 200 * num_in_osds 3)
Signed-off-by: Mykola Golub <to.my.trociny@gmail.com>
when we do exporting/importing an image, we should export or import the image-meta of this image at the same time
Signed-off-by: PCzhangPC <pengcheng.zhang@easystack.cn>
We change ruleset -> crush back in dc7a2aaf7a.
If someone tries to use the old property, error out early, instead of
silently not doing the thing they thought they told us to do.
Signed-off-by: Sage Weil <sage@redhat.com>
We now set full flag if a pool is currently running out of space and
set both full and full_no_quota flags if it is running out of quota.
Therefore the full_no_quota flag should be instead used to uniquely
identify whether we are running out of quota or not.
Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
https://github.com/ceph/ceph/pull/17371 introduces support of
per-pool space-full flag, which turns out to set both
full and full_no_quota flags now if a pool is currently running out
of quota.
Actually this test is fragile as long as we keep appending new flags
at pool granularity, but let's not bother with that complexity now.
Fixes: http://tracker.ceph.com/issues/21409
Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
rbd pool should exist for many rbd tests to work properly, create
the pool right after install is successful.
Signed-off-by: Vasu Kulkarni <vasu@redhat.com>
So we can combine "crush add-bucket" with "crush move" command,
and hence avoid making two separate changes to the osdmap,
and hence slow down map-epoch generation.
Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
This command returns all crush rules that are currently
referencing the device class specified by user.
Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
It would be a pain if we have to call 'ceph osd dump --format=json-pretty'
to find out these each time...
Demo output:
(1) ceph osd pool application get
{
"cephfs_data_b": {
"cephfs": {}
},
"cephfs_metadata_a": {
"cephfs": {}
},
"test_pool": {
"rbd": {
"test": "me"
}
}
}
(2) ceph osd pool application get test_pool
{
"rbd": {
"test": "me"
}
}
(3) ceph osd pool application get test_pool rbd
{
"test": "me"
}
(4) ceph osd pool application get test_pool rbd test
me
Fixes: http://tracker.ceph.com/issues/20976
Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
User may specify a rule with the same name of the pool that it serves.
Since a pool can be renamed, so does the rule.
Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
The previous method to get the watcher admin socket was fragile
and had started to fail after the recent changes to vstart ceph.conf.
Fixes: http://tracker.ceph.com/issues/20954
Signed-off-by: Mykola Golub <mgolub@mirantis.com>
rbd-ggate spawns a process responsible for the creation of ggate
device and forwarding I/O requests between the GEOM Gate kernel
subsystem and RADOS.
On FreeBSD it provides functionality similar to rbd-nbd on Linux.
Signed-off-by: Mykola Golub <mgolub@mirantis.com>
This will pervent OSDMonitor from crashing on purging a very large
non-existent osd id as below:
osd e11 prepare_command_osd_purge purging osd.8
-1> 2017-08-05 18:59:44.994319 7f6076968700 10 mon.a@0(leader).osd e11 prepare_command_osd_destroy osd.8 does not exist.
0> 2017-08-05 18:59:45.002309 7f6076968700 -1 /home/xxg/build/ceph-dev/src/osd/OSDMap.h: In function 'int OSDMap::get_state(int) const'
thread 7f6076968700 time 2017-08-05 18:59:44.994336
/home/xxg/build/ceph-dev/src/osd/OSDMap.h: 690: FAILED assert(o < max_osd)
Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
This introduces a new "rbd/singleton-bluestore" suite because creating an rbd
on an EC-backed datapool will fail on filestore.
References: http://tracker.ceph.com/issues/20295
Signed-off-by: Nathan Cutler <ncutler@suse.com>
we cannot overwrite existing dev class, and "osd_class_update_on_start"
is true by default (see 0c885d6). so we should remove all device classes before
setting them.
Signed-off-by: Kefu Chai <kchai@redhat.com>
/bin/bash is a Linuxism. Other operating systems install bash to
different paths. Use /usr/bin/env in shebangs to find bash.
Signed-off-by: Alan Somers <asomers@gmail.com>
- stop running via make check
- add teuthology yamls to run them
- disable ceph_objecstore_tool.py for now (too slow for make check, and
we can't use vstart in teuthology via a package install)
- drop cephtool tests since those are already covered by other teuthology
tests
- leave a handful of (fast!) ceph-helpers tests for make check for minimal
integration tests.
Signed-off-by: Sage Weil <sage@redhat.com>