• Iustin Pop's avatar
    Add checks for tcp/udp port collisions · 48ce9fd9
    Iustin Pop authored
    In case the config file is manually modified, or in case of bugs, the
    tcp/udp ports could be reused, which will create various problems
    (instances not able to start, or drbd disks not able to communicate).
    This patch extends the ConfigWriter.VerifyConfig() method (which is used
    in cluster verify) to check for duplicates between:
      - the ports used for DRBD disks
      - the ports used for network console
      - the ports marked as free in the config file
    Also, if the cluster parameter ‘highest_used_port’ is actually lower
    than the computed highest used port, this is also flagged as an error.
    The output from gnt-cluster verify will show (output manually wrapped):
    node1 # gnt-cluster verify
    * Verifying global settings
      - ERROR: tcp/udp port 11006 has duplicates: instance3.example.com/network port,
    instance2.example.com/drbd disk sda
      - ERROR: tcp/udp port 11017 has duplicates: instance3.example.com/drbd disk sda,
    instance3.example.com/drbd disk sdb, cluster/port marked as free
      - ERROR: Highest used port mismatch, saved 11010, computed 11017
    * Gathering data (2 nodes)
    Reviewed-by: ultrotter
config.py 29.3 KB