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

LWRP for Pools and RBD #41

Closed
wants to merge 4 commits into from
Closed

LWRP for Pools and RBD #41

wants to merge 4 commits into from

Conversation

hunter
Copy link
Contributor

@hunter hunter commented Jul 5, 2013

I thought I'd get a discussion going about LWRPs. I've created a few basic ones to assist with our work, is this something we want to include in the official cookbook?

@guilhem
Copy link
Contributor

guilhem commented Jul 8, 2013

You don't follow FC017 rule :)

You must use

new_resource.updated_by_last_action(true)

or better "why-run" mode:
http://dougireton.com/blog/2013/01/07/creating-an-lwrp-part-2/

@alram
Copy link
Member

alram commented Jul 9, 2013

I'm not sure we want/need to do that in the cookbooks. The Management API coming with Dumpling will do that nicely.

From http://www.inktank.com/about-inktank/roadmap/,
Ceph Cluster Management API
All of the functions currently available via the ceph command line tool will be available via a RESTful API endpoint, making it easier to integrate common monitoring and management tools with Ceph.

@hunter
Copy link
Contributor Author

hunter commented Jul 10, 2013

Is Management API going to land in time? I thought Dumpling just went feature freeze

Anyway, just thought I would present an implementation if we wanted to go this approach. We have a definite need for it since we need Chef to act on created Pools/Blocks but we'll keep it in our repo.

@guilhem thanks for the suggestion. This is my first time creating an LWRP so good to get an idea of best practice.

@guilhem
Copy link
Contributor

guilhem commented Jul 10, 2013

@hunter you are welcome. I can help you if you have some problem with it.

IMPOV, I think LWRP is really a good things to this cookbook.
API and LWRP aren't incompatible. This first cmd implementation can be superseded by an API one later.
LWRP will not change that much (for user).

@odyssey4me
Copy link
Contributor

+1 for this - what's holding up the merge?


action :delete do

converge_by("Deleting pool '#{new_resource.name}'") do
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

converge_by is useless here because your are only using only chef resources :)

It's the same for action :create

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok forget it, It can be better to keep it :)

@odyssey4me
Copy link
Contributor

Hmm, I see now that my work in #61 is starting to repeat some of the work you've done. I have some more LWRP work that I plan to do in the next week (maybe in the next few days). I'm sure that we can merge it at some point, but I'll do what I can to not conflict with your implementation.

converge_by("Creating pool '#{new_resource.name}'") do
execute "create pool" do
not_if "rados lspools | grep #{new_resource.name}"
command("rados mkpool #{new_resource.name}")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We'd rather use ceph osd pool create pool pg_num and ceph osd lspools.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll update. Is there a difference in how the pools are created by the two different commands?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not to my knowledge, it's just that the rados command is starting to get deprecated in favor of the ceph one.

@alram
Copy link
Member

alram commented Aug 23, 2013

Sorry I lacked of time lately to look at pull request. Made some comments.

@guilhem
Copy link
Contributor

guilhem commented Feb 19, 2014

@hunter Is this PR always good for you (regard of current master)?

@scarvalhojr
Copy link
Contributor

I'd love to see this merged. It seems that this hasn't gone anywhere in almost 2 years though.

If there's any interest I'd be up for addressing the comments above and submit a new pull request. Just let me know. I'm mostly interested in the pool LWRP

@djdefi
Copy link

djdefi commented May 28, 2015

+1

@scarvalhojr
Copy link
Contributor

@rtrauntvein, I've added a pool LWRP with this PR: #198

@hufman hufman closed this Aug 5, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants