Project

General

Profile

Actions

Feature #2662

closed

crowbar: Make barclamp-ceph set mon initial members, monitor-secret, fsid

Added by Anonymous almost 12 years ago. Updated almost 12 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
Category:
-
Target version:
% Done:

0%

Source:
Tags:
Backport:
Reviewed:
Affected Versions:
Pull request ID:

Description

Without this, multi-mon bring-up is racy.

At proposal save time, the barclamp should inspect the roles, and assign the nodenames to the attribute in the environment. How to do this is highly crowbar specific. Also, Crowbar doesn't use Chef environments the usual way; make sure this is the right thing to do.

monitor-secret and fsid need to be randomly generated (though monitor-secret needs to be in specific format, and that format is currently only known by tools inside ceph.deb, which won't be available at this time; work on this elsewhere)

Actions #1

Updated by Anonymous almost 12 years ago

  • Subject changed from crowbar: Make barclamp-ceph set mon initial members to crowbar: Make barclamp-ceph set mon initial members, monitor-secret, fsid
  • Description updated (diff)
Actions #2

Updated by Anonymous almost 12 years ago

  • Category set to chef
Actions #3

Updated by Anonymous almost 12 years ago

This python snippet creates ceph keys in the right format (for now). Where it should live is still an open question.


#!/usr/bin/python

import base64
import struct

AES_128_KEY_TYPE = 1
AES_128_KEY_LEN = 16

def encode(created_nsec, entropy):
    NANO = 1000000000
    secs, nsecs = divmod(created_nsec, NANO)
    assert len(entropy) == AES_128_KEY_LEN
    s = struct.pack(
        '<HLLH16s',
        AES_128_KEY_TYPE,
        secs,
        nsecs,
        AES_128_KEY_LEN,
        entropy,
        )
    assert len(s) == 28
    return base64.b64encode(s)

if __name__ == '__main__':
    import random
    import time

    entropy = struct.pack(
        'QQ',
        random.getrandbits(64),
        random.getrandbits(64),
        )
    print encode(
        created_nsec=int(time.time() * 1e9),
        entropy=entropy,
        )
Actions #4

Updated by Anonymous almost 12 years ago

More on where that snippet should live:

- for standalone chef deployment, we want the admin run something similar, and put the JSON in the environment, so this is not just about the barclamp
- putting the script in the ceph cookbook would be enough for chef (the admin is likely to have the cookbook cloned and handy), not sure if the files in cookbook are easily accessible in crowbar at proposal creation time -- TRY THAT with ceph-cookbooks.git README.md

Actions #5

Updated by Sage Weil almost 12 years ago

  • Translation missing: en.field_position set to 3
Actions #6

Updated by Sage Weil almost 12 years ago

  • Project changed from Ceph to devops
  • Category deleted (chef)
Actions #7

Updated by Sage Weil almost 12 years ago

  • Translation missing: en.field_position deleted (4)
  • Translation missing: en.field_position set to 1
Actions #8

Updated by Anonymous almost 12 years ago

  • Target version set to v0.50
  • Translation missing: en.field_position deleted (1)
  • Translation missing: en.field_position set to 84
Actions #9

Updated by Anonymous almost 12 years ago

  • Translation missing: en.field_story_points set to 5
  • Translation missing: en.field_position deleted (83)
  • Translation missing: en.field_position set to 83
Actions #10

Updated by Anonymous almost 12 years ago

  • Status changed from New to In Progress
  • Assignee set to Tyler Brekke
Actions #11

Updated by Tyler Brekke almost 12 years ago

Currently have fsid generated via uuidgen, monitor is generated via the python script which is residing in barclamp-ceph/bin

initial is set based on the assigned roles.

https://github.com/concubidated/barclamp-ceph

Actions #12

Updated by Anonymous almost 12 years ago

  • Status changed from In Progress to Resolved

Done as of barclamp-ceph.git commit 36842bd3e3db9fea65e2921bb7b57e9088964621.

Actions

Also available in: Atom PDF