struct rbd_options {
void *pad;
+ char *cluster_name;
char *rbd_name;
char *pool_name;
char *client_name;
};
static struct fio_option options[] = {
+ {
+ .name = "clustername",
+ .lname = "ceph cluster name",
+ .type = FIO_OPT_STR_STORE,
+ .help = "Cluster name for ceph",
+ .off1 = offsetof(struct rbd_options, cluster_name),
+ .category = FIO_OPT_C_ENGINE,
+ .group = FIO_OPT_G_RBD,
+ },
{
.name = "rbdname",
.lname = "rbd engine rbdname",
struct rbd_options *o = td->eo;
int r;
- r = rados_create(&rbd->cluster, o->client_name);
+ if (o->cluster_name) {
+ char *client_name = NULL;
+
+ /*
+ * If we specify cluser name, the rados_creat2
+ * will not assume 'client.'. name is considered
+ * as a full type.id namestr
+ */
+ if (!index(o->client_name, '.')) {
+ client_name = calloc(1, strlen("client.") +
+ strlen(o->client_name) + 1);
+ strcat(client_name, "client.");
+ o->client_name = strcat(client_name, o->client_name);
+ }
+ r = rados_create2(&rbd->cluster, o->cluster_name,
+ o->client_name, 0);
+ } else
+ r = rados_create(&rbd->cluster, o->client_name);
+
if (r < 0) {
log_err("rados_create failed.\n");
goto failed_early;
.BI 1:
allocate space immediately inside defragment event, and free right after event
.RE
+.TP
+.BI (rbd)clustername \fR=\fPstr
+Specifies the name of the ceph cluster.
.TP
.BI (rbd)rbdname \fR=\fPstr
Specifies the name of the RBD.
Specifies the name of the Ceph pool containing the RBD.
.TP
.BI (rbd)clientname \fR=\fPstr
-Specifies the username (without the 'client.' prefix) used to access the Ceph cluster.
+Specifies the username (without the 'client.' prefix) used to access the Ceph
+cluster. If the clustername is specified, the clientname should be full type.id
+string. If no type. prefix, fio will add 'client.' by default for you.
.TP
.BI (mtd)skipbad \fR=\fPbool
Skip operations against known bad blocks.