1. 13 Feb, 2014 11 commits
    • Jose A. Lopes's avatar
      Instance communication mechanism QA (for cluster only) · f985ecbd
      Jose A. Lopes authored
      Extend QA with tests for the instance communication mechanism.  These
      tests cover only the cluster creating the instance communication
      network and connecting it to the existing node group, and also if new
      groups are added they are also connected to the instance communication
      network.
      Signed-off-by: default avatarJose A. Lopes <jabolopes@google.com>
      Reviewed-by: default avatarHelga Velroyen <helgav@google.com>
      f985ecbd
    • Jose A. Lopes's avatar
      Connect new groups to the instance communication network · 39e27230
      Jose A. Lopes authored
      When a new group is added, if the instance communication network is
      enabled, then this group must also be connected to this network.
      
      * 'LUGroupAdd._AddInstanceCommunicationNetwork' connects the newly
        added group to the instance communication network by resorting to
        the 'OpNetworkConnect' opcode.
      
      * As a result of the previous change, the type of 'OpGroupAdd' changed
        and may optionally return a list of jobs.  Therefore, it is
        necessary to update the type of the opcode (in 'Ganeti.OpCodes') and
        the CLI for 'gnt-group add' must also be changed.
      Signed-off-by: default avatarJose A. Lopes <jabolopes@google.com>
      Reviewed-by: default avatarHelga Velroyen <helgav@google.com>
      39e27230
    • Jose A. Lopes's avatar
      'gnt-cluster modify' with '--instance-communication-network' · 0fcb3314
      Jose A. Lopes authored
      Extend CLI 'gnt-cluster modify' with
      '--instance-communication-network'.  Given that the return type for
      'OpClusterSetParams' changed to optionally return a list of jobs, it
      is also necessary to handle the result of this opcode accordingly.
      Signed-off-by: default avatarJose A. Lopes <jabolopes@google.com>
      Reviewed-by: default avatarHelga Velroyen <helgav@google.com>
      0fcb3314
    • 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
        'instance_communication_network'.
      
      * 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>
      d6a7518a
    • Jose A. Lopes's avatar
      Check prereq instance communication network in 'SetParams' · 11eeb1b9
      Jose A. Lopes authored
      Later, the logical unit for 'OpClusterSetParams' will be responsible
      for creating the instance communication network in case it does not
      exist.  For now, it is important to check whether the network the user
      is requesting to become assigned to instance communication has the
      right configuration and otherwise warn about potential security risks.
      
      * Add a new static method
        'LUClusterSetParams._CheckInstanceCommunicationNetwork' which checks
        if the user-supplied network is configured correctly and issues
        security warnings otherwise.  A correctly configured instance
        communication network is link-local (i.e., 169.254.0.0/16 for IPv4
        and fe80::/64 for IPv6), has no gateways, and has a specific MAC
        prefix.
      
      * Extend 'LUClusterSetParams.CheckPrereq' to call the above method to
        check whether the user supplied network matches the intended
        configuration.
      Signed-off-by: default avatarJose A. Lopes <jabolopes@google.com>
      Reviewed-by: default avatarHelga Velroyen <helgav@google.com>
      11eeb1b9
    • Jose A. Lopes's avatar
      Add 'instance_communication_network' to 'OpClusterSetParams' · 42fda604
      Jose A. Lopes authored
      ... and update the unit tests.
      Signed-off-by: default avatarJose A. Lopes <jabolopes@google.com>
      Reviewed-by: default avatarHelga Velroyen <helgav@google.com>
      42fda604
    • Jose A. Lopes's avatar
      Add helper to handle CLIs that optionally spawn several jobs · fcafd191
      Jose A. Lopes authored
      This helper function detects whether an opcode returned a list of jobs
      (i.e., a result of the type ht.TJobIdListOnly) and in this case it
      uses 'ganeti.cli.JobExecutor' to wait for the jobs and determine the
      return code which is based on the return codes of all jobs.
      Signed-off-by: default avatarJose A. Lopes <jabolopes@google.com>
      Reviewed-by: default avatarHelga Velroyen <helgav@google.com>
      fcafd191
    • Jose A. Lopes's avatar
      Instance comm network from config instead of predefined · 9a94cee3
      Jose A. Lopes authored
      * Add 'ganeti.objects.Cluster.instance_communication_network' to the
        config so the logical unit for 'OpInstanceCreate' can access the
        instance communication network which is stored in the cluster
        configuration.
      
      * Change logical unit for 'OpInstanceCreate' to use the instance
        communication network parameter defined in the cluster configuration
        instead of using a predefined one.
      Signed-off-by: default avatarJose A. Lopes <jabolopes@google.com>
      Reviewed-by: default avatarHelga Velroyen <helgav@google.com>
      9a94cee3
    • Jose A. Lopes's avatar
      Add 'instance_communication_parameter' to 'Cluster' · 8a5d326f
      Jose A. Lopes authored
      * Add parameter 'instance_communication_parameter' to the Python
        'ganeti.objects.Cluster' and the Haskell 'Ganeti.Objects.Cluster'.
      
      * Update Haskell 'QueryClusterInfo' to return also the
        'instance_communication_network' parameter.
      
      * Update Python 'LUClusterQuery' to return also the
        'instance_communication_network' parameter.
      
      * Update Python 'ShowClusterConfig' to include information about the
        'instance_commuication_network' parameter
      
      * Update 'ganeti.objects.Cluster.UpgradeConfig' to ugprade also
        'instance_communication_network' parameter to the empty string, if
        unspecified.
      
      * Update the configuration upgrade tool (i.e., 'tools/cfgupgrade') to
        handle upgrading of the 'instance_communication_network' parameter
        as well as downgrading.
      Signed-off-by: default avatarJose A. Lopes <jabolopes@google.com>
      Reviewed-by: default avatarHelga Velroyen <helgav@google.com>
      8a5d326f
    • Jose A. Lopes's avatar
      Fix indentation · a987c040
      Jose A. Lopes authored
      Signed-off-by: default avatarJose A. Lopes <jabolopes@google.com>
      Reviewed-by: default avatarHelga Velroyen <helgav@google.com>
      a987c040
    • Helga Velroyen's avatar
      Correct test for existance of instances · a21440d8
      Helga Velroyen authored
      Since python interprets an empty dictionary as 'False',
      testing for the existance of the 'instances' field in
      the configuration has to be done by explicitely testing
      for 'None'.
      Signed-off-by: default avatarHelga Velroyen <helgav@google.com>
      Reviewed-by: default avatarKlaus Aehlig <aehlig@google.com>
      a21440d8
  2. 12 Feb, 2014 13 commits
  3. 11 Feb, 2014 3 commits
  4. 10 Feb, 2014 13 commits