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.
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)
- 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)
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,
)
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
- Translation missing: en.field_position set to 3
- Project changed from Ceph to devops
- Category deleted (
chef)
- Translation missing: en.field_position deleted (
4)
- Translation missing: en.field_position set to 1
- Target version set to v0.50
- Translation missing: en.field_position deleted (
1)
- Translation missing: en.field_position set to 84
- Translation missing: en.field_story_points set to 5
- Translation missing: en.field_position deleted (
83)
- Translation missing: en.field_position set to 83
- Status changed from New to In Progress
- Assignee set to Tyler Brekke
- Status changed from In Progress to Resolved
Done as of barclamp-ceph.git commit 36842bd3e3db9fea65e2921bb7b57e9088964621.
Also available in: Atom
PDF