Skip to contentSkip to conversation

'Immutable bit' on pools to prevent deletion

DISCUSSION Wido den Hollander 12 participants 25 messages Jan 15, 2015 – Jan 19, 2015 1 message not in the archive

lore
Share & tools
lore
#0 lore raw

Hi,

Although the userland tools like 'ceph' and 'rados' have a safeguard against fat fingers when it comes to removing a pool there is no such safeguard when using native librados.

The danger still exists that by accident you remove a pool which is then completely gone, no way to restore it.

This is still something I find quite dangerous, so I was thinking about a additional 'Immutable bit' which could be set on a pool before rados_pool_delete() allows this pool to be removed.

Is it a sane thing to look at 'features' which pools could have? Other features which might be set on a pool:

- Read Only (all write operations return -EPERM)
- Delete Protected

It's just that looking at a 20TB RBD pool and thinking that just one API call could remove this pool make me a bit scared.

Am I the only one or is this something worth looking in to?

Signature · 6 lines
Wido den Hollander
42on B.V.
Ceph trainer and consultant

Phone: +31 (0)20 700 9902
Skype: contact42on
#1 lore raw

Hi Wido,

+1 for safeguards.

Yeah that is scary: it's one api call to delete a pool, and perhaps even a client with w capability on a pool can delete it?? (I didn’t try...)

I can think of many ways that fat fingers can create crazy loads, deny client access, ...

1. changing pool size
2. setting pool quotas
3. unplanned PG splitting
4. creating an EC pool on a cluster with dumpling clients
5. reweight-by-utilization
6. changing crush rules/tunables

—yes-i-really-really-mean-it is nice when it’s there. But regardless it is probably not a good practice to work daily (or run librados cron jobs) in a shell that has access to the client.admin keyring. I’ve thought of using sudo to restrict our admin shell to subset of ceph admin commands. But even better would be a internal bit which locks out the API beneath “ceph osd pool …” and “ceph osd crush …”, even for client.admin.

Maybe this is already possible by creating a client.admin-readonly account for daily work and crons, and limit access to client.admin except when absolutely necessary ?

Cheers, Dan

Quoted 37 lines · Wido den Hollander

Hi,

Although the userland tools like 'ceph' and 'rados' have a safeguard against fat fingers when it comes to removing a pool there is no such safeguard when using native librados.

The danger still exists that by accident you remove a pool which is then completely gone, no way to restore it.

This is still something I find quite dangerous, so I was thinking about a additional 'Immutable bit' which could be set on a pool before rados_pool_delete() allows this pool to be removed.

Is it a sane thing to look at 'features' which pools could have? Other features which might be set on a pool:

- Read Only (all write operations return -EPERM)
- Delete Protected

It's just that looking at a 20TB RBD pool and thinking that just one API call could remove this pool make me a bit scared.

Am I the only one or is this something worth looking in to?

Signature · 10 lines
Wido den Hollander
42on B.V.
Ceph trainer and consultant

Phone: +31 (0)20 700 9902
Skype: contact42on
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#3 lore raw
In reply to Wido den Hollander

+1

Thanks,
Mike Dawson

Quoted 24 lines · Wido den Hollander

Hi,

Although the userland tools like 'ceph' and 'rados' have a safeguard against fat fingers when it comes to removing a pool there is no such safeguard when using native librados.

The danger still exists that by accident you remove a pool which is then completely gone, no way to restore it.

This is still something I find quite dangerous, so I was thinking about a additional 'Immutable bit' which could be set on a pool before rados_pool_delete() allows this pool to be removed.

Is it a sane thing to look at 'features' which pools could have? Other features which might be set on a pool:

- Read Only (all write operations return -EPERM)
- Delete Protected

It's just that looking at a 20TB RBD pool and thinking that just one API call could remove this pool make me a bit scared.

Am I the only one or is this something worth looking in to?

#2 lore raw
In reply to Dan Van Der Ster
Quoted 6 lines · Dan Van Der Ster

Hi Wido,

+1 for safeguards.

Yeah that is scary: it's one api call to delete a pool, and perhaps even a client with w capability on a pool can delete it?? (I didn’t try...)

Quick try, yes! Created a pool and user which only has access to that pool. I was able to remove that pool.

Quoted 2 lines

I can think of many ways that fat fingers can create crazy loads, deny client access, ...

Sure, but none of those actually make you loose your data.

I know that you should create backups, but by accident removing a pool is something that is very dangerous and it will take a lot of time to restore from backups.

Quoted 11 lines

1. changing pool size
2. setting pool quotas
3. unplanned PG splitting
4. creating an EC pool on a cluster with dumpling clients
5. reweight-by-utilization
6. changing crush rules/tunables

—yes-i-really-really-mean-it is nice when it’s there. But regardless it is probably not a good practice to work daily (or run librados cron jobs) in a shell that has access to the client.admin keyring. I’ve thought of using sudo to restrict our admin shell to subset of ceph admin commands. But even better would be a internal bit which locks out the API beneath “ceph osd pool …” and “ceph osd crush …”, even for client.admin.

Maybe this is already possible by creating a client.admin-readonly account for daily work and crons, and limit access to client.admin except when absolutely necessary ?

That would be great indeed. The client.admin key currently has all the capabilities and I would indeed like a RO account.

But still, another safeguard against deleting pools would be something I'd like to see.

Wido

Quoted 41 lines

Cheers, Dan

Quoted 37 lines · Wido den Hollander

Hi,

Although the userland tools like 'ceph' and 'rados' have a safeguard against fat fingers when it comes to removing a pool there is no such safeguard when using native librados.

The danger still exists that by accident you remove a pool which is then completely gone, no way to restore it.

This is still something I find quite dangerous, so I was thinking about a additional 'Immutable bit' which could be set on a pool before rados_pool_delete() allows this pool to be removed.

Is it a sane thing to look at 'features' which pools could have? Other features which might be set on a pool:

- Read Only (all write operations return -EPERM)
- Delete Protected

It's just that looking at a 20TB RBD pool and thinking that just one API call could remove this pool make me a bit scared.

Am I the only one or is this something worth looking in to?

Signature · 10 lines
Wido den Hollander
42on B.V.
Ceph trainer and consultant

Phone: +31 (0)20 700 9902
Skype: contact42on
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Signature · 10 lines
Wido den Hollander
42on B.V.
Ceph trainer and consultant

Phone: +31 (0)20 700 9902
Skype: contact42on
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#4 lore raw
In reply to Wido den Hollander
Quoted 16 lines · Wido den Hollander

Hi,

Although the userland tools like 'ceph' and 'rados' have a safeguard against fat fingers when it comes to removing a pool there is no such safeguard when using native librados.

The danger still exists that by accident you remove a pool which is then completely gone, no way to restore it.

This is still something I find quite dangerous, so I was thinking about a additional 'Immutable bit' which could be set on a pool before rados_pool_delete() allows this pool to be removed.

Is it a sane thing to look at 'features' which pools could have? Other features which might be set on a pool:

Quoted 7 lines

- Read Only (all write operations return -EPERM)
- Delete Protected

It's just that looking at a 20TB RBD pool and thinking that just one API call could remove this pool make me a bit scared.

Am I the only one or is this something worth looking in to?

I completely agree. A while back I opened an issue for that, #9792, with some suggestions:

- require a special key for this command
- pool removal doesn't apply immediately, but rather first switches pool to 'pending removal'
- pending removal state reflected in the cluster status
- operation can be cancelled when pending

Yehuda

#5 lore raw
Quoted 23 lines · Yehuda Sadeh
Quoted 22 lines · Wido den Hollander

Hi,

Although the userland tools like 'ceph' and 'rados' have a safeguard against fat fingers when it comes to removing a pool there is no such safeguard when using native librados.

The danger still exists that by accident you remove a pool which is then completely gone, no way to restore it.

This is still something I find quite dangerous, so I was thinking about a additional 'Immutable bit' which could be set on a pool before rados_pool_delete() allows this pool to be removed.

Is it a sane thing to look at 'features' which pools could have? Other features which might be set on a pool:

- Read Only (all write operations return -EPERM)
- Delete Protected

It's just that looking at a 20TB RBD pool and thinking that just one API call could remove this pool make me a bit scared.

Quoted 6 lines
Quoted 1 line

Am I the only one or is this something worth looking in to?

I completely agree. A while back I opened an issue for that, #9792, with some suggestions:

- require a special key for this command

The original version of the --yes-i-really-really-mean-it patch actually did something like this, but it was complicated and a huge pain to script all of the tests so we went with the simpler path (specify pool name twice and a scary option).

Quoted 4 lines

- pool removal doesn't apply immediately, but rather first switches pool to 'pending removal'
- pending removal state reflected in the cluster status
- operation can be cancelled when pending

This amounts of a two stage process, which I think makes a lot of sense. I see two reasonably simple options:

1) Add a 'nodelete' pool flag, so that you have to do

ceph osd pool set foo nodelete false
ceph osd pool delete foo foo --yes-i-swear-i-etc

Then the question is whether we implicitly set this flag on all existing pools.. meh. But we won't break any current users of the API that create and destroy pools.

2) Add a 'allow-delete' flag as Yehuda suggests, so you have

ceph osd pool set foo allow-delete true
ceph osd pool delete foo ...

Then secondary question is whether the cluster should implicitly clear the allow-delete after some time period (maybe 'pending-delete' would make more sense in that case), or whether we deny IO during that period. Seems perhaps too complicated.

The downside here is that there will be huge patchset that fixes all the tests to do this. Probably worth it though if it avoids a very bad day for some poor admin...

sage

#6 lore raw

In addition (or instead of) making the API harder to fat-finger, we could also add a mon config option like

mon allow pool deletion = false

that defaults off. Then, to delete any pool, you need to update ceph.conf and restart mons or inject the config option change (ceph daemon mon.hostname conig set ... on the leader) or the API will give you EPERM.

This offers some protection even for client.admin key users if we prevent injectargs for that option (maybe feasible) and they don't have access to the actual mon machine.

It also makes it easy to drop these protections for our QA because we can just stick that option in the teuthology and vstart.sh ceph.conf files.

sage

#7 lore raw
Quoted 5 lines · Sage Weil

In addition (or instead of) making the API harder to fat-finger, we could also add a mon config option like

mon allow pool deletion = false

Quoted 8 lines

that defaults off. Then, to delete any pool, you need to update ceph.conf and restart mons or inject the config option change (ceph daemon mon.hostname conig set ... on the leader) or the API will give you EPERM.

This offers some protection even for client.admin key users if we prevent injectargs for that option (maybe feasible) and they don't have access to the actual mon machine.

What would that buy us? Preventing injectargs on it would require mon restarts, which is unfortunate — and makes it sounds more like a security feature than a safety blanket.
-Greg
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#8 lore raw
Quoted 11 lines · Gregory Farnum
Quoted 10 lines · Sage Weil

In addition (or instead of) making the API harder to fat-finger, we could also add a mon config option like

mon allow pool deletion = false

that defaults off. Then, to delete any pool, you need to update ceph.conf and restart mons or inject the config option change (ceph daemon mon.hostname conig set ... on the leader) or the API will give you EPERM.

Quoted 7 lines
Quoted 3 lines

This offers some protection even for client.admin key users if we prevent injectargs for that option (maybe feasible) and they don't have access to the actual mon machine.

What would that buy us? Preventing injectargs on it would require mon restarts, which is unfortunate ? and makes it sounds more like a security feature than a safety blanket.

I meant 'ceph tell mon.* injectargs ...' as distinct from 'ceph daemon ... config set', which requires access to the host. But yeah, if we went to the effort to limit injectargs (maybe a blanket option that disables injectargs on mons?), it could double as a security feature.

But whether it may also useful for security doesn't change whether it is a good safety blanket. I like it because it's simple, easy to implement, and easy to disable for testing... :)

sage

#9 lore raw

Oh, I think it might be fine to require setting a config option before you delete stuff; I just don't want to prevent the option from being injectable. :)

Quoted 31 lines · Sage Weil
Quoted 11 lines · Gregory Farnum
Quoted 10 lines · Sage Weil

In addition (or instead of) making the API harder to fat-finger, we could also add a mon config option like

mon allow pool deletion = false

that defaults off. Then, to delete any pool, you need to update ceph.conf and restart mons or inject the config option change (ceph daemon mon.hostname conig set ... on the leader) or the API will give you EPERM.

Quoted 7 lines
Quoted 3 lines

This offers some protection even for client.admin key users if we prevent injectargs for that option (maybe feasible) and they don't have access to the actual mon machine.

What would that buy us? Preventing injectargs on it would require mon restarts, which is unfortunate ? and makes it sounds more like a security feature than a safety blanket.

I meant 'ceph tell mon.* injectargs ...' as distinct from 'ceph daemon ... config set', which requires access to the host. But yeah, if we went to the effort to limit injectargs (maybe a blanket option that disables injectargs on mons?), it could double as a security feature.

But whether it may also useful for security doesn't change whether it is a good safety blanket. I like it because it's simple, easy to implement, and easy to disable for testing... :)

sage

#10 lore raw
In reply to Sage Weil
Quoted 4 lines · Sage Weil
Quoted 3 lines

What would that buy us? Preventing injectargs on it would require mon restarts, which is unfortunate ? and makes it sounds more like a security feature than a safety blanket.

Quoted 8 lines

I meant 'ceph tell mon.* injectargs ...' as distinct from 'ceph daemon ... config set', which requires access to the host. But yeah, if we went to the effort to limit injectargs (maybe a blanket option that disables injectargs on mons?), it could double as a security feature.

But whether it may also useful for security doesn't change whether it is a good safety blanket. I like it because it's simple, easy to implement, and easy to disable for testing... :)

The trouble with this is admin socket part is that any tool that manages Ceph must use the admin socket interface as well as the normal over-the-network command interface, and by extension must be able to execute locally on a mon. We would no longer have a comprehensive remote management interface for the mon: management tools would have to run some code locally too.

I think it's sufficient to require two API calls (set the flag or config option, then do the delete) within the remote API, rather than requiring that anyone driving the interface knows how to speak two network protocols (usual mon remote command + SSH-to-asok).

John

#11 lore raw
Quoted 14 lines · John Spray
Quoted 4 lines · Sage Weil
Quoted 3 lines

What would that buy us? Preventing injectargs on it would require mon restarts, which is unfortunate ? and makes it sounds more like a security feature than a safety blanket.

Quoted 8 lines

I meant 'ceph tell mon.* injectargs ...' as distinct from 'ceph daemon ... config set', which requires access to the host. But yeah, if we went to the effort to limit injectargs (maybe a blanket option that disables injectargs on mons?), it could double as a security feature.

But whether it may also useful for security doesn't change whether it is a good safety blanket. I like it because it's simple, easy to implement, and easy to disable for testing... :)

Quoted 6 lines

The trouble with this is admin socket part is that any tool that manages Ceph must use the admin socket interface as well as the normal over-the-network command interface, and by extension must be able to execute locally on a mon. We would no longer have a comprehensive remote management interface for the mon: management tools would have to run some code locally too.

True.. if we make that option enabled by default. If we it's off by default them it's an opt-in layer of protection. Most clusters don't have ephemeral pools so I think lots of people would want this.

Quoted 4 lines

I think it's sufficient to require two API calls (set the flag or config option, then do the delete) within the remote API, rather than requiring that anyone driving the interface knows how to speak two network protocols (usual mon remote command + SSH-to-asok).

Yeah...

sage

#12 lore raw
Quoted 10 lines · Sage Weil
Quoted 6 lines

The trouble with this is admin socket part is that any tool that manages Ceph must use the admin socket interface as well as the normal over-the-network command interface, and by extension must be able to execute locally on a mon. We would no longer have a comprehensive remote management interface for the mon: management tools would have to run some code locally too.

True.. if we make that option enabled by default. If we it's off by default them it's an opt-in layer of protection. Most clusters don't have ephemeral pools so I think lots of people would want this.

+1, the problem goes away if it's opt-in, should be easy enough for API consumers to inspect the conf setting and give a nice informative error if the safety catch is engaged. I can imagine wanting to engage this ahead of plugging in a GUI or some config management recipes that you didn't quite trust yet.

John

#13 lore raw
In reply to Sage Weil
Quoted 22 lines · Sage Weil
Quoted 14 lines · John Spray
Quoted 4 lines · Sage Weil
Quoted 3 lines

What would that buy us? Preventing injectargs on it would require mon restarts, which is unfortunate ? and makes it sounds more like a security feature than a safety blanket.

Quoted 8 lines

I meant 'ceph tell mon.* injectargs ...' as distinct from 'ceph daemon ... config set', which requires access to the host. But yeah, if we went to the effort to limit injectargs (maybe a blanket option that disables injectargs on mons?), it could double as a security feature.

But whether it may also useful for security doesn't change whether it is a good safety blanket. I like it because it's simple, easy to implement, and easy to disable for testing... :)

Quoted 6 lines

The trouble with this is admin socket part is that any tool that manages Ceph must use the admin socket interface as well as the normal over-the-network command interface, and by extension must be able to execute locally on a mon. We would no longer have a comprehensive remote management interface for the mon: management tools would have to run some code locally too.

Quoted 4 lines

True.. if we make that option enabled by default. If we it's off by default them it's an opt-in layer of protection. Most clusters don't have ephemeral pools so I think lots of people would want this.

If this is the easiest route I'm +1 for that way.

I'd turn it off right away on the clusters I manage. Pools don't change that often and I simply want another safeguard against deleting them.

Quoted 9 lines
Quoted 4 lines

I think it's sufficient to require two API calls (set the flag or config option, then do the delete) within the remote API, rather than requiring that anyone driving the interface knows how to speak two network protocols (usual mon remote command + SSH-to-asok).

Yeah...

sage

Signature · 6 lines
Wido den Hollander
42on B.V.
Ceph trainer and consultant

Phone: +31 (0)20 700 9902
Skype: contact42on
#14 lore raw
In reply to Sage Weil

Hum if I understand correctly you’re all more in favour of a conf setting in the ceph.conf;
The problem for me is that this will apply to all the pools by default and I’ll have to inject an arg to change this.
Injecting the arg will remove this “lock" and then all of the sudden all the pools become deletable through the lib again (who knows what users can do simultaneously)

I’m more in favour of a new flag to set to the pool, something like:

ceph osd pool set foo protect true
ceph osd pool delete foo foo —yes….
ERROR: pool foo is protected against deletion

ceph osd pool delete foo protect false
ceph osd pool delete foo foo —yes….
Pool successfully deleted

The good thing with that is that owners of the pool (or admin), will be able to set this flag or remove it. We stick with the "ceph osd pool delete foo foo —yes….” command as well, so we don’t change too much things.

Moreover we can also make use of a config option to protect all new created pools by default:

mon protect pool default = true

This automatically set the protected flag to a new pool.

What do you think?

Quoted 6 lines · Sage Weil

Then secondary question is whether the cluster should implicitly clear the allow-delete after some time period (maybe 'pending-delete' would make more sense in that case), or whether we deny IO during that period. Seems perhaps too complicated.

Cheers.
––––
Sébastien Han
Cloud Architect

"Always give 100%. Unless you're giving blood."

Phone: +33 (0)1 49 70 99 72
Mail: [email protected]
Address : 11 bis, rue Roquépine - 75008 Paris
Web : www.enovance.com - Twitter : @enovance

--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#15 lore raw
Quoted 4 lines · Sebastien Han

Hum if I understand correctly you’re all more in favour of a conf setting in the ceph.conf;
The problem for me is that this will apply to all the pools by default and I’ll have to inject an arg to change this.
Injecting the arg will remove this “lock" and then all of the sudden all the pools become deletable through the lib again (who knows what users can do simultaneously)

No, from what I understand it's easier to implement, not the better way.

Quoted 10 lines

I’m more in favour of a new flag to set to the pool, something like:

ceph osd pool set foo protect true
ceph osd pool delete foo foo —yes….
ERROR: pool foo is protected against deletion

ceph osd pool delete foo protect false
ceph osd pool delete foo foo —yes….
Pool successfully deleted

Something like that per pool seems better to me as well. But I'd then opt for a 'feature' which can be set on a pool.

ceph osd pool set foo nodelete
ceph osd pool set foo nopgchange
ceph osd pool set foo nosizechange

Quoted 11 lines

The good thing with that is that owners of the pool (or admin), will be able to set this flag or remove it. We stick with the "ceph osd pool delete foo foo —yes….” command as well, so we don’t change too much things.

Moreover we can also make use of a config option to protect all new created pools by default:

mon protect pool default = true

This automatically set the protected flag to a new pool.

What do you think?

Setting a nodelete flag or something like that by default is fine with me. Like Sage mentioned earlier, almost nobody will have ephemeral pools in their cluster. You don't want to loose data because you accidentally removed a pool.

Wido

Quoted 20 lines
Quoted 6 lines · Sage Weil

Then secondary question is whether the cluster should implicitly clear the allow-delete after some time period (maybe 'pending-delete' would make more sense in that case), or whether we deny IO during that period. Seems perhaps too complicated.

Cheers.
––––
Sébastien Han
Cloud Architect

"Always give 100%. Unless you're giving blood."

Phone: +33 (0)1 49 70 99 72
Mail: [email protected]
Address : 11 bis, rue Roquépine - 75008 Paris
Web : www.enovance.com - Twitter : @enovance

Signature · 10 lines
Wido den Hollander
42on B.V.
Ceph trainer and consultant

Phone: +31 (0)20 700 9902
Skype: contact42on
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#16 lore raw
Quoted 7 lines · Wido den Hollander
Quoted 4 lines · Sebastien Han

Hum if I understand correctly you?re all more in favour of a conf setting in the ceph.conf;
The problem for me is that this will apply to all the pools by default and I?ll have to inject an arg to change this.
Injecting the arg will remove this ?lock" and then all of the sudden all the pools become deletable through the lib again (who knows what users can do simultaneously)

No, from what I understand it's easier to implement, not the better way.

I'd like to do both, actually. :)

Quoted 11 lines
Quoted 10 lines

I?m more in favour of a new flag to set to the pool, something like:

ceph osd pool set foo protect true
ceph osd pool delete foo foo ?yes?.
ERROR: pool foo is protected against deletion

ceph osd pool delete foo protect false
ceph osd pool delete foo foo ?yes?.
Pool successfully deleted

Quoted 6 lines

Something like that per pool seems better to me as well. But I'd then opt for a 'feature' which can be set on a pool.

ceph osd pool set foo nodelete
ceph osd pool set foo nopgchange
ceph osd pool set foo nosizechange

I like this since it fits into the current flags nicely. The downside is we don't grandfather existing pools on upgrade. Not sure if people think that's a good idea.

Quoted 9 lines
Quoted 9 lines

The good thing with that is that owners of the pool (or admin), will be able to set this flag or remove it. We stick with the "ceph osd pool delete foo foo ?yes?.? command as well, so we don?t change too much things.

Moreover we can also make use of a config option to protect all new created pools by default:

mon protect pool default = true

This automatically set the protected flag to a new pool.

Quoted 7 lines
Quoted 2 lines

What do you think?

Setting a nodelete flag or something like that by default is fine with me. Like Sage mentioned earlier, almost nobody will have ephemeral pools in their cluster. You don't want to loose data because you accidentally removed a pool.

We should mirror this option:

OPTION(osd_pool_default_flag_hashpspool, OPT_BOOL, true) // use new pg
hashing to prevent pool/pg overlap

So,

osd_pool_default_flag_nodelete = true
osd_pool_default_flag_nopgchange = true
osd_pool_default_flag_nosizechange = true

The big question for me is should we enable these by default in hammer?

sage

Quoted 34 lines

Wido

Quoted 20 lines
Quoted 6 lines · Sage Weil

Then secondary question is whether the cluster should implicitly clear the allow-delete after some time period (maybe 'pending-delete' would make more sense in that case), or whether we deny IO during that period. Seems perhaps too complicated.

Cheers.
????
S?bastien Han
Cloud Architect

"Always give 100%. Unless you're giving blood."

Phone: +33 (0)1 49 70 99 72
Mail: [email protected]
Address : 11 bis, rue Roqu?pine - 75008 Paris
Web : www.enovance.com - Twitter : @enovance

Signature · 6 lines
Wido den Hollander
42on B.V.
Ceph trainer and consultant

Phone: +31 (0)20 700 9902
Skype: contact42on
#20 lore raw
In reply to a message not in the archive
Quoted 7 lines

Op 16 jan. 2015 om 15:47 heeft Sage Weil <[email protected]> het volgende geschreven:

Quoted 1 line · Wido den Hollander
Quoted 9 lines
Quoted 6 lines
Quoted 4 lines · Sebastien Han

Hum if I understand correctly you?re all more in favour of a conf setting in the ceph.conf;
The problem for me is that this will apply to all the pools by default and I?ll have to inject an arg to change this.
Injecting the arg will remove this ?lock" and then all of the sudden all the pools become deletable through the lib again (who knows what users can do simultaneously)

No, from what I understand it's easier to implement, not the better way.

I'd like to do both, actually. :)

Sounds good!

Quoted 42 lines
Quoted 10 lines
Quoted 9 lines

I?m more in favour of a new flag to set to the pool, something like:

ceph osd pool set foo protect true
ceph osd pool delete foo foo ?yes?.
ERROR: pool foo is protected against deletion

ceph osd pool delete foo protect false
ceph osd pool delete foo foo ?yes?.
Pool successfully deleted

Quoted 6 lines

Something like that per pool seems better to me as well. But I'd then opt for a 'feature' which can be set on a pool.

ceph osd pool set foo nodelete
ceph osd pool set foo nopgchange
ceph osd pool set foo nosizechange

I like this since it fits into the current flags nicely. The downside is we don't grandfather existing pools on upgrade. Not sure if people think that's a good idea.

Quoted 7 lines
Quoted 7 lines

The good thing with that is that owners of the pool (or admin), will be able to set this flag or remove it. We stick with the "ceph osd pool delete foo foo ?yes?.? command as well, so we don?t change too much things.

Moreover we can also make use of a config option to protect all new created pools by default:

mon protect pool default = true

Quoted 8 lines
Quoted 3 lines

This automatically set the protected flag to a new pool.

What do you think?

Setting a nodelete flag or something like that by default is fine with me. Like Sage mentioned earlier, almost nobody will have ephemeral pools in their cluster. You don't want to loose data because you accidentally removed a pool.

We should mirror this option:

OPTION(osd_pool_default_flag_hashpspool, OPT_BOOL, true) // use new pg
hashing to prevent pool/pg overlap

Quoted 8 lines

So,

osd_pool_default_flag_nodelete = true
osd_pool_default_flag_nopgchange = true
osd_pool_default_flag_nosizechange = true

The big question for me is should we enable these by default in hammer?

I would say yes. We should probably protect users against something stupid which makes them loose data.

Data safety is prio #1

Wido

Quoted 39 lines

sage

Quoted 16 lines

Wido

Quoted 13 lines
Quoted 6 lines · Sage Weil

Then secondary question is whether the cluster should implicitly clear the allow-delete after some time period (maybe 'pending-delete' would make more sense in that case), or whether we deny IO during that period. Seems perhaps too complicated.

Cheers.
????
S?bastien Han
Cloud Architect

Quoted 15 lines
Quoted 6 lines

"Always give 100%. Unless you're giving blood."

Phone: +33 (0)1 49 70 99 72
Mail: [email protected]
Address : 11 bis, rue Roqu?pine - 75008 Paris
Web : www.enovance.com - Twitter : @enovance

Signature · 6 lines
Wido den Hollander
42on B.V.
Ceph trainer and consultant

Phone: +31 (0)20 700 9902
Skype: contact42on

--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#21 lore raw
In reply to Wido den Hollander

Wido den Hollander wrote:

<snip>

Quoted 5 lines

Is it a sane thing to look at 'features' which pools could have? Other features which might be set on a pool:

- Read Only (all write operations return -EPERM)
- Delete Protected

There's another pool feature I'd find very useful: a WORM flag, that permits only create & append (at the RADOS level, not the RBD level as was an Emperor blueprint).

In particular, I'd _love_ being able to make something that takes Postgres WAL logs and puts them in such a pool, providing real guarantees re:
consistency. Similarly, audit logs and such for compliance.

#22 lore raw
Quoted 6 lines · Alex Elsayed

Wido den Hollander wrote:

<snip>

Quoted 3 lines

Is it a sane thing to look at 'features' which pools could have? Other features which might be set on a pool:

Quoted 7 lines
Quoted 2 lines

- Read Only (all write operations return -EPERM)
- Delete Protected

There's another pool feature I'd find very useful: a WORM flag, that permits only create & append (at the RADOS level, not the RBD level as was an Emperor blueprint).

Yes, that seems like a good addition. If we introduce the system of 'flags' for pools such a flag could be implemented as well.

Quoted 9 lines

In particular, I'd _love_ being able to make something that takes Postgres WAL logs and puts them in such a pool, providing real guarantees re:
consistency. Similarly, audit logs and such for compliance.

--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

Signature · 6 lines
Wido den Hollander
42on B.V.
Ceph trainer and consultant

Phone: +31 (0)20 700 9902
Skype: contact42on
#23 lore raw
In reply to Alex Elsayed
Quoted 9 lines · Alex Elsayed

Wido den Hollander wrote:

<snip>

Quoted 5 lines

Is it a sane thing to look at 'features' which pools could have? Other features which might be set on a pool:

- Read Only (all write operations return -EPERM)
- Delete Protected

Quoted 7 lines

There's another pool feature I'd find very useful: a WORM flag, that permits only create & append (at the RADOS level, not the RBD level as was an Emperor blueprint).

In particular, I'd _love_ being able to make something that takes Postgres WAL logs and puts them in such a pool, providing real guarantees re:
consistency. Similarly, audit logs and such for compliance.

How would you want this to work?

- If the bit is set, object creates are allowed, but not deletes? What about append?

- Are you allowed to clear the bit with something like 'ceph osd pool set <pool> worm false' ?

sage

#24 lore raw
Quoted 18 lines · Sage Weil
Quoted 9 lines · Alex Elsayed

Wido den Hollander wrote:

<snip>

Quoted 5 lines

Is it a sane thing to look at 'features' which pools could have? Other features which might be set on a pool:

- Read Only (all write operations return -EPERM)
- Delete Protected

Quoted 7 lines

There's another pool feature I'd find very useful: a WORM flag, that permits only create & append (at the RADOS level, not the RBD level as was an Emperor blueprint).

In particular, I'd _love_ being able to make something that takes Postgres WAL logs and puts them in such a pool, providing real guarantees
re: consistency. Similarly, audit logs and such for compliance.

Quoted 7 lines

How would you want this to work?

- If the bit is set, object creates are allowed, but not deletes? What about append?

- Are you allowed to clear the bit with something like 'ceph osd pool set <pool> worm false' ?

I'd say that a WORM pool would allow 'create' and 'append' only - that fits well with the classic notions of WORM media, and would allow natural implementations of virtualized WORM tape libraries and such for people who need compatibility (if only object creation was supported, you get issues where either you have absurd tiny objects or risk data loss on failure to write a larger buffered chunk). Similarly, audit records (like selinux logs, that might be written by log daemons) don't really come in nice object-sized chunks. You want to always have the newest in the archive, so you really don't want to buffer up to that.

I'd also figure that WORM's main purpose is assurance/compliance - you want to _know_ that nobody could have turned the bit off, futzed with the data, and then turned it back on. Otherwise, you'd just write your clients to only use create/append, and have no need for WORM at the pool level. Because of that, if the flag can be cleared via commands, it should be possible for the admins to forbid it (by flat denying it in config, via some keying system, via the bits being a ratchet, whatever - I'm not especially concerned by how the guarantee is provided, so long as it can be).

Setting it should probably also be privileged, since it'd be trivial to cause a DOS by setting it on (say) a CephFS pool - although handling that concern is likely out-of-scope for now, since there are easier ways to ruin someone's day at the RADOS level.

#25 lore raw

The most secure way would be one in which you can only create pools with WORM set and can't ever change the WORM state of a pool. I like this simple/secure approach as a first cut.

David

Quoted 54 lines · Alex Elsayed
Quoted 16 lines · Sage Weil
Quoted 8 lines · Alex Elsayed

Wido den Hollander wrote:

<snip>

Quoted 5 lines

Is it a sane thing to look at 'features' which pools could have? Other features which might be set on a pool:

- Read Only (all write operations return -EPERM)
- Delete Protected

Quoted 7 lines

There's another pool feature I'd find very useful: a WORM flag, that permits only create & append (at the RADOS level, not the RBD level as was an Emperor blueprint).

In particular, I'd _love_ being able to make something that takes Postgres WAL logs and puts them in such a pool, providing real guarantees
re: consistency. Similarly, audit logs and such for compliance.

Quoted 7 lines

How would you want this to work?

- If the bit is set, object creates are allowed, but not deletes? What about append?

- Are you allowed to clear the bit with something like 'ceph osd pool set <pool> worm false' ?

I'd say that a WORM pool would allow 'create' and 'append' only - that fits well with the classic notions of WORM media, and would allow natural implementations of virtualized WORM tape libraries and such for people who need compatibility (if only object creation was supported, you get issues where either you have absurd tiny objects or risk data loss on failure to write a larger buffered chunk). Similarly, audit records (like selinux logs, that might be written by log daemons) don't really come in nice object-sized chunks. You want to always have the newest in the archive, so you really don't want to buffer up to that.

I'd also figure that WORM's main purpose is assurance/compliance - you want to _know_ that nobody could have turned the bit off, futzed with the data, and then turned it back on. Otherwise, you'd just write your clients to only use create/append, and have no need for WORM at the pool level. Because of that, if the flag can be cleared via commands, it should be possible for the admins to forbid it (by flat denying it in config, via some keying system, via the bits being a ratchet, whatever - I'm not especially concerned by how the guarantee is provided, so long as it can be).

Setting it should probably also be privileged, since it'd be trivial to cause a DOS by setting it on (say) a CephFS pool - although handling that concern is likely out-of-scope for now, since there are easier ways to ruin someone's day at the RADOS level.

--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#17 lore raw
In reply to Sage Weil
Quoted 35 lines · Sage Weil
Quoted 7 lines · Wido den Hollander

Something like that per pool seems better to me as well. But I'd then opt for a 'feature' which can be set on a pool.

ceph osd pool set foo nodelete
ceph osd pool set foo nopgchange
ceph osd pool set foo nosizechange

I like this since it fits into the current flags nicely. The downside is we don't grandfather existing pools on upgrade. Not sure if people think that's a good idea.

Quoted 9 lines
Quoted 9 lines

The good thing with that is that owners of the pool (or admin), will be able to set this flag or remove it. We stick with the "ceph osd pool delete foo foo ?yes?.? command as well, so we don?t change too much things.

Moreover we can also make use of a config option to protect all new created pools by default:

mon protect pool default = true

This automatically set the protected flag to a new pool.

Quoted 7 lines
Quoted 2 lines

What do you think?

Setting a nodelete flag or something like that by default is fine with me. Like Sage mentioned earlier, almost nobody will have ephemeral pools in their cluster. You don't want to loose data because you accidentally removed a pool.

We should mirror this option:

OPTION(osd_pool_default_flag_hashpspool, OPT_BOOL, true) // use new pg
hashing to prevent pool/pg overlap

Quoted 7 lines

So,

osd_pool_default_flag_nodelete = true
osd_pool_default_flag_nopgchange = true
osd_pool_default_flag_nosizechange = true

The big question for me is should we enable these by default in hammer?

Please see https://github.com/ceph/ceph/pull/3409

I have not enabled any by default.

Also, I have not mirrored CEPH_FEATURE_OSDHASHPSPOOL, should I?

Signature · 1 line
Mykola Golub
#18 lore raw
Quoted 42 lines · Mykola Golub
Quoted 41 lines · Sage Weil
Quoted 7 lines · Wido den Hollander

Something like that per pool seems better to me as well. But I'd then opt for a 'feature' which can be set on a pool.

ceph osd pool set foo nodelete
ceph osd pool set foo nopgchange
ceph osd pool set foo nosizechange

I like this since it fits into the current flags nicely. The downside is we don't grandfather existing pools on upgrade. Not sure if people think that's a good idea.

Quoted 9 lines
Quoted 9 lines

The good thing with that is that owners of the pool (or admin), will be able to set this flag or remove it. We stick with the "ceph osd pool delete foo foo ?yes?.? command as well, so we don?t change too much things.

Moreover we can also make use of a config option to protect all new created pools by default:

mon protect pool default = true

This automatically set the protected flag to a new pool.

Quoted 7 lines
Quoted 2 lines

What do you think?

Setting a nodelete flag or something like that by default is fine with me. Like Sage mentioned earlier, almost nobody will have ephemeral pools in their cluster. You don't want to loose data because you accidentally removed a pool.

We should mirror this option:

OPTION(osd_pool_default_flag_hashpspool, OPT_BOOL, true) // use new pg
hashing to prevent pool/pg overlap

So,

osd_pool_default_flag_nodelete = true
osd_pool_default_flag_nopgchange = true
osd_pool_default_flag_nosizechange = true

Quoted 5 lines
Quoted 1 line

The big question for me is should we enable these by default in hammer?

Please see https://github.com/ceph/ceph/pull/3409

I have not enabled any by default.

Looks great!

Quoted 1 line

Also, I have not mirrored CEPH_FEATURE_OSDHASHPSPOOL, should I?

No need... this is all in the mon and there are no compatibility issues that I can see.

Thanks!
sage