This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
root@node1:~# linstor resource toggle-disk node1 my_ssd_res --diskless | |
SUCCESS: | |
... | |
root@node1:~# linstor resource list | |
╭─────────────────────────────────────────────────────────────────────────────────────────╮ | |
┊ ResourceName ┊ Node ┊ Port ┊ Usage ┊ Conns ┊ State ┊ CreatedOn ┊ | |
╞═════════════════════════════════════════════════════════════════════════════════════════╡ | |
┊ my_ssd_res ┊ node1 ┊ 7000 ┊ Unused ┊ Ok ┊ Diskless ┊ 2020-11-04 12:26:50 ┊ | |
┊ my_ssd_res ┊ node2 ┊ 7000 ┊ Unused ┊ Ok ┊ UpToDate ┊ 2020-11-04 12:26:50 ┊ | |
┊ my_ssd_res ┊ node3 ┊ 7000 ┊ Unused ┊ Ok ┊ SyncTarget(43.95%) ┊ 2020-11-04 12:26:50 ┊ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
root@node1:~# linstor resource list | |
╭───────────────────────────────────────────────────────────────────────────────╮ | |
┊ ResourceName ┊ Node ┊ Port ┊ Usage ┊ Conns ┊ State ┊ CreatedOn ┊ | |
╞═══════════════════════════════════════════════════════════════════════════════╡ | |
┊ my_ssd_res ┊ node1 ┊ 7000 ┊ Unused ┊ Ok ┊ UpToDate ┊ 2020-11-04 12:26:50 ┊ | |
┊ my_ssd_res ┊ node2 ┊ 7000 ┊ Unused ┊ Ok ┊ UpToDate ┊ 2020-11-04 12:26:50 ┊ | |
┊ my_ssd_res ┊ node3 ┊ 7000 ┊ Unused ┊ Ok ┊ Diskless ┊ 2020-11-04 12:26:50 ┊ | |
┊ my_ssd_res ┊ node4 ┊ 7000 ┊ Unused ┊ Ok ┊ Diskless ┊ 2020-11-04 12:46:37 ┊ | |
╰───────────────────────────────────────────────────────────────────────────────╯ | |
root@node1:~# linstor resource toggle-disk node3 my_ssd_res --storage-pool pool_ssd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
root@node1:~# linstor resource list | |
╭───────────────────────────────────────────────────────────────────────────────╮ | |
┊ ResourceName ┊ Node ┊ Port ┊ Usage ┊ Conns ┊ State ┊ CreatedOn ┊ | |
╞═══════════════════════════════════════════════════════════════════════════════╡ | |
┊ my_ssd_res ┊ node1 ┊ 7000 ┊ Unused ┊ Ok ┊ UpToDate ┊ 2020-11-04 12:26:50 ┊ | |
┊ my_ssd_res ┊ node2 ┊ 7000 ┊ Unused ┊ Ok ┊ UpToDate ┊ 2020-11-04 12:26:50 ┊ | |
┊ my_ssd_res ┊ node3 ┊ 7000 ┊ Unused ┊ Ok ┊ Diskless ┊ 2020-11-04 12:26:50 ┊ | |
╰───────────────────────────────────────────────────────────────────────────────╯ | |
root@node1:~# linstor resource create node4 my_ssd_res --drbd-diskless | |
SUCCESS: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
root@node1:~# ls -l /dev/drbd* | |
brw-rw---- 1 root disk 147, 1000 Nov 4 12:26 /dev/drbd1000 | |
/dev/drbd: | |
total 0 | |
drwxr-xr-x 3 root root 60 Nov 4 12:26 by-disk | |
drwxr-xr-x 3 root root 60 Nov 4 12:26 by-res | |
root@node1:~# lvs | |
LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
root@node1:~# linstor resource list | |
╭────────────────────────────────────────────────────────────────────────────────────────╮ | |
┊ ResourceName ┊ Node ┊ Port ┊ Usage ┊ Conns ┊ State ┊ CreatedOn ┊ | |
╞════════════════════════════════════════════════════════════════════════════════════════╡ | |
┊ my_ssd_res ┊ node1 ┊ 7000 ┊ Unused ┊ Ok ┊ SyncTarget(1.81%) ┊ 2020-11-04 12:26:50 ┊ | |
┊ my_ssd_res ┊ node2 ┊ 7000 ┊ Unused ┊ Ok ┊ UpToDate ┊ 2020-11-04 12:26:50 ┊ | |
╰────────────────────────────────────────────────────────────────────────────────────────╯ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
nfacctd_port: 2055 | |
plugins: memory[inbound], memory[outbound] | |
imt_path[inbound]: /tmp/inbound.pipe | |
aggregate_filter[inbound]: dst net 10.0.0.0/8 or dst net 192.0.2.0/24 or dst net 2001:db8::/32 | |
aggregate[inbound]: dst_host, src_net | |
imt_mem_pools_number[inbound]: 64 | |
imt_mem_pools_size[inbound]: 65536 | |
imt_path[outbound]: /tmp/outbound.pipe |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python3 | |
import json | |
import subprocess | |
LABELS={} # add any static labels here, eg hostname | |
def export(metric, labels, value): | |
lstr = ",".join(("%s=\"%s\"" % (k,v) for k,v in labels.items())) | |
print("%s{%s} %d" % (metric, lstr, value)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ValueAndLog: | |
def __init__(self, value, log): | |
self.value = value | |
self.log = log | |
def __rshift__(self, func): | |
result = func(self.value) | |
return ValueAndLog(result.value, self.log + result.log) | |
@staticmethod |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ValueAndLog: | |
def __init__(self, value, log): | |
self.value = value | |
self.log = log | |
def __rshift__(self, func): | |
result = func(self.value) | |
return ValueAndLog(result.value, self.log + result.log) | |
@staticmethod |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ValueAndLog: | |
def __init__(self, value, log): | |
self.value = value | |
self.log = log | |
def __rshift__(self, func): | |
result = func(self.value) | |
return ValueAndLog(result.value, self.log + result.log) | |
@staticmethod |