Revision a721e23a
b/lib/bootstrap.py | ||
---|---|---|
39 | 39 |
from ganeti import ssconf |
40 | 40 |
from ganeti import serializer |
41 | 41 |
from ganeti import hypervisor |
42 |
from ganeti import bdev |
|
42 | 43 |
|
43 | 44 |
|
44 | 45 |
def _InitSSHSetup(): |
... | ... | |
210 | 211 |
return file_storage_dir |
211 | 212 |
|
212 | 213 |
|
214 |
#pylint: disable-msg=R0913 |
|
213 | 215 |
def InitCluster(cluster_name, mac_prefix, |
214 | 216 |
master_netdev, file_storage_dir, candidate_pool_size, |
215 | 217 |
secondary_ip=None, vg_name=None, beparams=None, |
216 | 218 |
nicparams=None, hvparams=None, enabled_hypervisors=None, |
217 | 219 |
modify_etc_hosts=True, modify_ssh_setup=True, |
218 |
maintain_node_health=False, |
|
220 |
maintain_node_health=False, drbd_helper=None,
|
|
219 | 221 |
uid_pool=None): |
220 | 222 |
"""Initialise the cluster. |
221 | 223 |
|
... | ... | |
279 | 281 |
" you are not using lvm" % vgstatus, |
280 | 282 |
errors.ECODE_INVAL) |
281 | 283 |
|
284 |
if drbd_helper is not None: |
|
285 |
try: |
|
286 |
curr_helper = bdev.BaseDRBD.GetUsermodeHelper() |
|
287 |
except errors.BlockDeviceError, err: |
|
288 |
raise errors.OpPrereqError("Error while checking drbd helper" |
|
289 |
" (specify --no-drbd-storage if you are not" |
|
290 |
" using drbd): %s" % str(err), |
|
291 |
errors.ECODE_ENVIRON) |
|
292 |
if drbd_helper != curr_helper: |
|
293 |
raise errors.OpPrereqError("Error: requiring %s as drbd helper but %s" |
|
294 |
" is the current helper" % (drbd_helper, |
|
295 |
curr_helper), |
|
296 |
errors.ECODE_INVAL) |
|
297 |
|
|
282 | 298 |
file_storage_dir = _InitFileStorage(file_storage_dir) |
283 | 299 |
|
284 | 300 |
if not re.match("^[0-9a-z]{2}:[0-9a-z]{2}:[0-9a-z]{2}$", mac_prefix): |
... | ... | |
344 | 360 |
mtime=now, |
345 | 361 |
uuid=utils.NewUUID(), |
346 | 362 |
maintain_node_health=maintain_node_health, |
363 |
drbd_usermode_helper=drbd_helper, |
|
347 | 364 |
) |
348 | 365 |
master_node_config = objects.Node(name=hostname.name, |
349 | 366 |
primary_ip=hostname.ip, |
Also available in: Unified diff