1. 14 Feb, 2014 32 commits
  2. 13 Feb, 2014 8 commits
    • Jose A. Lopes's avatar
      Fix watcher tampering with instance userdown QA · f398c9b9
      Jose A. Lopes authored
      
      
      The watcher was tampering with the instance user down QA because, when
      the watcher sees an instance marked an 'USER_down', it will cleanup
      the instance, that is it will stop the instance, thus marking it as
      'ADMIN_down'.  The change in instance status was causing the instance
      user down QA to fail sporadically.  This patch pauses the watcher
      during this test.
      Signed-off-by: default avatarJose A. Lopes <jabolopes@google.com>
      Reviewed-by: default avatarReviewed-by: Helga Velroyen <helgav@google.com>
      f398c9b9
    • Jose A. Lopes's avatar
      Rename some functions not to collide with opcode names · 4b75f8a4
      Jose A. Lopes authored
      
      
      Rename some functions related to instance communication not to collide
      with the naming convention used in the opcodes.
      Signed-off-by: default avatarJose A. Lopes <jabolopes@google.com>
      Reviewed-by: default avatarHelga Velroyen <helgav@google.com>
      4b75f8a4
    • Jose A. Lopes's avatar
      Refactor instance communication network add and connect · 2ff6426b
      Jose A. Lopes authored
      
      
      Factor out the opcodes 'OpNetworkAdd' and 'OpNetworkConnect' used in
      'LUClusterSetParams' and 'LUGroupAdd' in order to reduce code
      duplication and keep the configuration of the instance communication
      in one place.
      Signed-off-by: default avatarJose A. Lopes <jabolopes@google.com>
      Reviewed-by: default avatarHelga Velroyen <helgav@google.com>
      2ff6426b
    • 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