Revision 66a37e7a
b/lib/cmdlib/instance.py | ||
---|---|---|
3242 | 3242 |
self.cfg.GetNodeName(node_uuid), msg) |
3243 | 3243 |
|
3244 | 3244 |
# if this is a DRBD disk, return its port to the pool |
3245 |
if root.dev_type in constants.LDS_DRBD:
|
|
3245 |
if root.dev_type in constants.DTS_DRBD:
|
|
3246 | 3246 |
self.cfg.AddTcpUdpPort(root.logical_id[2]) |
3247 | 3247 |
|
3248 | 3248 |
def _CreateNewNic(self, idx, params, private): |
b/lib/cmdlib/instance_query.py | ||
---|---|---|
341 | 341 |
|
342 | 342 |
""" |
343 | 343 |
drbd_info = None |
344 |
if dev.dev_type in constants.LDS_DRBD:
|
|
344 |
if dev.dev_type in constants.DTS_DRBD:
|
|
345 | 345 |
# we change the snode then (otherwise we use the one passed in) |
346 | 346 |
if dev.logical_id[0] == instance.primary_node: |
347 | 347 |
snode_uuid = dev.logical_id[1] |
b/lib/cmdlib/instance_utils.py | ||
---|---|---|
281 | 281 |
all_result = False |
282 | 282 |
|
283 | 283 |
# if this is a DRBD disk, return its port to the pool |
284 |
if device.dev_type in constants.LDS_DRBD:
|
|
284 |
if device.dev_type in constants.DTS_DRBD:
|
|
285 | 285 |
ports_to_release.add(device.logical_id[2]) |
286 | 286 |
|
287 | 287 |
if all_result or ignore_failures: |
b/lib/config.py | ||
---|---|---|
713 | 713 |
|
714 | 714 |
# gather the drbd ports for duplicate checks |
715 | 715 |
for (idx, dsk) in enumerate(instance.disks): |
716 |
if dsk.dev_type in constants.LDS_DRBD:
|
|
716 |
if dsk.dev_type in constants.DTS_DRBD:
|
|
717 | 717 |
tcp_port = dsk.logical_id[2] |
718 | 718 |
if tcp_port not in ports: |
719 | 719 |
ports[tcp_port] = [] |
b/lib/constants.py | ||
---|---|---|
572 | 572 |
DT_EXT, |
573 | 573 |
]) |
574 | 574 |
|
575 |
# the set of drbd-like disk types |
|
576 |
DTS_DRBD = compat.UniqueFrozenset([DT_DRBD8]) |
|
577 |
|
|
575 | 578 |
# drbd constants |
576 | 579 |
DRBD_HMAC_ALG = "md5" |
577 | 580 |
DRBD_DEFAULT_NET_PROTOCOL = "C" |
... | ... | |
606 | 609 |
FD_LOOP = "loop" |
607 | 610 |
FD_BLKTAP = "blktap" |
608 | 611 |
|
609 |
# the set of drbd-like disk types |
|
610 |
LDS_DRBD = compat.UniqueFrozenset([DT_DRBD8]) |
|
611 |
|
|
612 | 612 |
# disk access mode |
613 | 613 |
DISK_RDONLY = "ro" |
614 | 614 |
DISK_RDWR = "rw" |
b/lib/objects.py | ||
---|---|---|
584 | 584 |
constants.DT_BLOCK, constants.DT_RBD, |
585 | 585 |
constants.DT_EXT, constants.DT_SHARED_FILE]: |
586 | 586 |
result = [node_uuid] |
587 |
elif self.dev_type in constants.LDS_DRBD:
|
|
587 |
elif self.dev_type in constants.DTS_DRBD:
|
|
588 | 588 |
result = [self.logical_id[0], self.logical_id[1]] |
589 | 589 |
if node_uuid not in result: |
590 | 590 |
raise errors.ConfigurationError("DRBD device passed unknown node") |
... | ... | |
719 | 719 |
|
720 | 720 |
if self.logical_id is None and self.physical_id is not None: |
721 | 721 |
return |
722 |
if self.dev_type in constants.LDS_DRBD:
|
|
722 |
if self.dev_type in constants.DTS_DRBD:
|
|
723 | 723 |
pnode_uuid, snode_uuid, port, pminor, sminor, secret = self.logical_id |
724 | 724 |
if target_node_uuid not in (pnode_uuid, snode_uuid): |
725 | 725 |
raise errors.ConfigurationError("DRBD device not knowing node %s" % |
... | ... | |
766 | 766 |
obj.logical_id = tuple(obj.logical_id) |
767 | 767 |
if obj.physical_id and isinstance(obj.physical_id, list): |
768 | 768 |
obj.physical_id = tuple(obj.physical_id) |
769 |
if obj.dev_type in constants.LDS_DRBD:
|
|
769 |
if obj.dev_type in constants.DTS_DRBD:
|
|
770 | 770 |
# we need a tuple of length six here |
771 | 771 |
if len(obj.logical_id) < 6: |
772 | 772 |
obj.logical_id += (None,) * (6 - len(obj.logical_id)) |
... | ... | |
778 | 778 |
""" |
779 | 779 |
if self.dev_type == constants.DT_PLAIN: |
780 | 780 |
val = "<LogicalVolume(/dev/%s/%s" % self.logical_id |
781 |
elif self.dev_type in constants.LDS_DRBD:
|
|
781 |
elif self.dev_type in constants.DTS_DRBD:
|
|
782 | 782 |
node_a, node_b, port, minor_a, minor_b = self.logical_id[:5] |
783 | 783 |
val = "<DRBD8(" |
784 | 784 |
if self.physical_id is None: |
... | ... | |
1092 | 1092 |
""" |
1093 | 1093 |
def _Helper(nodes, device): |
1094 | 1094 |
"""Recursively computes nodes given a top device.""" |
1095 |
if device.dev_type in constants.LDS_DRBD:
|
|
1095 |
if device.dev_type in constants.DTS_DRBD:
|
|
1096 | 1096 |
nodea, nodeb = device.logical_id[:2] |
1097 | 1097 |
nodes.add(nodea) |
1098 | 1098 |
nodes.add(nodeb) |
... | ... | |
1150 | 1150 |
if dev.dev_type == constants.DT_PLAIN: |
1151 | 1151 |
lvmap[node_uuid].append(dev.logical_id[0] + "/" + dev.logical_id[1]) |
1152 | 1152 |
|
1153 |
elif dev.dev_type in constants.LDS_DRBD:
|
|
1153 |
elif dev.dev_type in constants.DTS_DRBD:
|
|
1154 | 1154 |
if dev.children: |
1155 | 1155 |
self.MapLVsByNode(lvmap, dev.children, dev.logical_id[0]) |
1156 | 1156 |
self.MapLVsByNode(lvmap, dev.children, dev.logical_id[1]) |
b/tools/cluster-merge | ||
---|---|---|
393 | 393 |
# Update the DRBD port assignments |
394 | 394 |
# This is a little bit hackish |
395 | 395 |
for dsk in instance_info.disks: |
396 |
if dsk.dev_type in constants.LDS_DRBD:
|
|
396 |
if dsk.dev_type in constants.DTS_DRBD:
|
|
397 | 397 |
port = my_config.AllocatePort() |
398 | 398 |
|
399 | 399 |
logical_id = list(dsk.logical_id) |
Also available in: Unified diff