• Jose A. Lopes's avatar
    'LUClusterSetParams' creates the instance communication net · d6a7518a
    Jose A. Lopes authored
    Extend 'LUClusterSetParams' to create the user-supplied instance
    communication network in case this network does not exist.  Note that
    if the user-supplied network already exists, nothing needs to be done
    as 'CheckPrereq' already checks this network's configuration.
    With this patch, Ganeti will be able to create the instance
    communication network automatically.  The following example shows the
    command line options that instruct Ganeti to enable the instance
    communication network and, if this network does not exist, then Ganeti
    creates it.
      gnt-cluster modify --instance-communication-network=mynetwork
    The instance communication network can be disabled by setting the
    parameter to the empty string, for example:
      gnt-cluster modify --instance-communication-network=
    This will not destroy the network itself or modify any running
    instances.  This will have to be done manually.
    In this patch:
    * 'LUClusterSetParams._EnsureInstanceCommunicationNetwork' creates and
      connects to all groups the instance communication network by
      resorting the 'OpNetworkAdd' and 'OpNetworkConnect'.
    * 'LUClusterSetParams.ModifyInstanceCommunicationNetwork' compares the
      previous configured 'instance_communication_network' with the
      user-supplied one and determines whether the opcodes is changing the
      configuration, which might require creating the instance
      communication network.
    * Extend 'LUClusterSetParams.Exec' to call
      'ModifyInstanceCommunicationNetwork' and handle the user-supplied
    * Because 'ClusterSetParams' now may return a list of jobs, the type
      of the opcode must be updated in 'Ganeti.OpCodes'.
    * Add network related constants to 'Ganeti.Constants'.
    Signed-off-by: default avatarJose A. Lopes <jabolopes@google.com>
    Reviewed-by: default avatarHelga Velroyen <helgav@google.com>
Constants.hs 122 KB