crowbar: Make barclamp-ceph set mon initial members, monitor-secret, fsid
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)
#3 Updated by Anonymous over 11 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, )
#4 Updated by Anonymous over 11 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