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

Add various bits of setup automation #61

Closed
wants to merge 14 commits into from

Conversation

odyssey4me
Copy link
Contributor

Add ceph-setup role
Add automated osd preparation and configuration
Add mds setup automation

Resolves #56 and #48

Note: My testing is being done with dumpling. I can't guarantee this will work with anything more than an n-1 version.

Add ceph-setup role
Add automated osd preparation
Fix role search bug
@odyssey4me
Copy link
Contributor Author

@alram @guilhem Any comments on this pull request? The intention is to make it a whole lot more automated to setup a new cluster.


if node['ceph']['config']['fsid'].nil?
Log.info("ceph-setup: ceph fsid not set - generating a new fsid")
fsid = Mixlib::ShellOut.new("uuidgen").run_command.stdout.strip
Copy link
Contributor

Choose a reason for hiding this comment

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

You can use pure-ruby instead (cleaner I think):

fsid = SecureRandom.uuid

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good feedback, thanks. Done!

if node["ceph"]["osd_autoprepare"] and !node["ceph"]["osd_devices"].nil?
node["ceph"]["osd_devices"].each do |osd_device|
Log.info("ceph-osd: Erasing #{osd_device['device']} to prepare it as an osd")
system 'sgdisk', '-oZ', "#{osd_device['device']}"
Copy link
Contributor

Choose a reason for hiding this comment

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

Mixlib::ShellOut

Is better than "system". ;)

.error!

raise an exception :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks, good tip - I've pushed an update.

@guilhem
Copy link
Contributor

guilhem commented Aug 14, 2013

This patches are good for me.

Maybe (but that can not be true), there is too many "Log.info", "Log.debug" can be good sometimes.
But I prefer too many log than nothing :)

pgp_num pool["pgp_num"]
min_size pool["min_size"]
action :create
not_if "ceph osd lspools | grep #{pool["name"]}"
Copy link
Member

Choose a reason for hiding this comment

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

With grep, you may have false positive, for instance if a pool foobar exist and you want to create foo.

Re-running ceph osd pool create is safe, or you could test if the pool exists with, for instance, ceph osd pool name get size. If this doesn't return ENOENT, the pool exists.

@guilhem
Copy link
Contributor

guilhem commented Feb 19, 2014

Is this PR always good for you (regard of current master)?
If yes, can you rebase it?

@odyssey4me
Copy link
Contributor Author

@guilhem I'll have to refactor a lot of it to bring it in line with the current changes. There's a lot of work there which was duplicated here. I think it's best that I close this PR and do some new ones, focusing on only doing small changes per PR and making use of the new LWRP's.

@guilhem
Copy link
Contributor

guilhem commented Feb 19, 2014

@odyssey4me ok for me. :)

@guilhem guilhem closed this Feb 19, 2014
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.

Automated OSD HDD setup
3 participants