ceph / ceph-cookbook

Chef cookbooks for Ceph
Apache License 2.0
100 stars 108 forks source link

Pool LWRP and auto create user-defined pools #198

Closed scarvalhojr closed 9 years ago

scarvalhojr commented 9 years ago

This change introduces a pool LWRP that allows Ceph user pools to be created and/or deleted by simply specifying their name and number of placement groups.

It also allows users to define their own pools in Chef attributes or environments that are then created automatically when nodes are provisioned.

guilhem commented 9 years ago

I don't test it. But code is really nice, it's a pleasure to see PR like this! :)

As it doesn't change anything existing (only add), I'm quite confident about adding this soon. @hufman ?

hufman commented 9 years ago

Do you want to add the osd_secret business to allow this LWRP to run on any node on the cluster, instead of just the MONs? I could see the benefit of this only being available on MON nodes, though. Otherwise it's very cool!

scarvalhojr commented 9 years ago

I thought about adding osd_secret but decided against it because it isn't safe (secret potentially exposed on Chef logs). I was tinkering with the idea of adding attributes for user-id/name and key/keyring files to the LWRP but this isn't my priority right now. I left the code in a way that it can easily be extended in that way though.

guilhem commented 9 years ago

@scarvalhojr can you add an options string attribute to add any other option to command ceph osd pool create. Can be useful for erasure for example.

scarvalhojr commented 9 years ago

I've added a create_options attribute for ceph osd pool create

guilhem commented 9 years ago

For me all is OK. @hufman ? Nice work

hufman commented 9 years ago

Looks good to me!