Skip to content
Snippets Groups Projects
  1. Sep 27, 2007
  2. Sep 25, 2007
  3. Sep 24, 2007
    • Iustin Pop's avatar
      Implement to/from dict conversion for ConfigObject(s) · ff9c047c
      Iustin Pop authored
      This change allows instances of ConfigObject and its children to be
      converted to and from standard python types. This will allow easier
      upgrade of the configuration and use of any serialization protocol (not
      only pickle).
      
      The code is not very nice (a little too verbose, I think) but it works.
      Tested on a 2-node, 3-instance cluster by doing repeated conversions and
      checking consistency of results.
      
      Reviewed-by: imsnah
      ff9c047c
  4. Sep 21, 2007
    • Iustin Pop's avatar
      Change class hierarchy in objects.py · ec29fe40
      Iustin Pop authored
      It makes sense to make the TaggableObject a child of the ConfigObject,
      since in this case we can derive the Instance, Node and Cluster objects
      only from the TaggableObject and have a cleaner hierarchy.
      
      For consistency child classes will have to declare their slots by adding
      their parents on top.
      
      Reviewed-by: imsnah,ultrotter
      ec29fe40
    • Iustin Pop's avatar
      Remove requirement that host names are FQDN · 89e1fc26
      Iustin Pop authored
      We currently require that hostnames are FQDN not short names
      (node1.example.com instead of node1). We can allow short names as long
      as:
        - we always resolve the names as returned by socket.gethostname()
        - we rely on having a working resolver
      
      These issues are not as big as may seem, as we only did gethostname() in
      a few places in order to check for the master; we already required
      working resolver all over the code for the other nodes names (and thus
      requiring the same for the current node name is normal).  The patch
      moves some resolver calls from within execution path to the checking
      path (which can abort without any problems). It is important that after
      this patch is applied, no name resolving is called from the execution
      path (LU.Exec() or other code that is called from within those methods)
      as in this case we get much better code flow.
      
      This patch also changes the functions for doing name lookups and
      encapsulates all functionality in a single class.
      
      The final change is that, by requiring working resolver at all times, we
      can change the 'return None' into an exception and thus we don't have to
      check manually each time; only some special cases will check
      (ganeti-daemon and ganeti-watcher which are not covered by the
      generalized exception handling in cli.py). The code is cleaner this way.
      
      Reviewed-by: imsnah
      89e1fc26
    • Iustin Pop's avatar
      Move a constant from ganeti-master to constants.py · 619fdc8e
      Iustin Pop authored
      The EXIT_NODESETUP_ERROR is a useful constant and ganeti-watcher could
      use it too. This patch moves it to constants.py and modifed the
      ganeti-master script to use it from there.
      
      Reviewed-by: imsnah
      619fdc8e
    • Iustin Pop's avatar
      Add __slots__ on TaggableObject · 2057f6c7
      Iustin Pop authored
      Unless we use __slots__ on all parents, we don't get the benefits that
      __slots__ bring. This patch adds this attribute to the TaggableObject so
      that Instances, Nodes and the Clusters behave as intended.
      
      Reviewed-by: schreiberal,imsnah
      2057f6c7
  5. Sep 19, 2007
    • Iustin Pop's avatar
      Improve the cli.AskUser() function · 47988778
      Iustin Pop authored
      This patch improves the AskUser function by allowing it to:
       - choose from multiple choices (instead of only y/n)
       - give help to the user
       - preserve line breaks and whitespace formatting in the message
      
      With this patch, an instance removal looks like this:
      root@xen-test1-4:~# gnt-instance remove tsetest1
      This will remove the volumes of the instance tsetest1 (including
      mirrors), thus removing all the data of the instance. Continue?
      y/[n]/?: ?
       y - Perform the operation
       n - Do not perform the operation
      
      This will remove the volumes of the instance tsetest1 (including
      mirrors), thus removing all the data of the instance. Continue?
      y/[n]/?: y
      
      The patch also removed the _ask_user member of the opts argument, since
      external code was using it (and thus it makes no sense for it to be a
      private member); now gnt-* scripts are using the AskUser function
      directly.
      
      Reviewed-by: ultrotter
      47988778
    • Iustin Pop's avatar
      Allow 'add instance' to not start the new instance · bdd55f71
      Iustin Pop authored
      This patch allows 'gnt-instance add' to not start the newly-created
      instance. It also allow 'gnt-instance add' and 'gnt-backup import' to
      not check for IP conflicts (only when not starting the instance).
      
      Reviewed-by: ultrotter
      bdd55f71
    • Iustin Pop's avatar
      Change resolved hostname from dict to a class · bcf043c9
      Iustin Pop authored
      The current result of utils.LookupHostname() is a dict, but this does
      not allow static checkers to check the correctness of the code. This
      patch introduces a new class names HostInfo and changes LookupHostname
      to return an instance of this class; this allows better checking of the
      code (and also the code is cleaner).
      
      Reviewed-by: ultrotter
      bcf043c9
  6. Sep 18, 2007
    • Iustin Pop's avatar
      Implement cluster rename operation · 07bd8a51
      Iustin Pop authored
      This patch adds a new OpCode (and corresponding LU) that implements the
      cluster rename functionality.
      
      This is done by shutting down the master role, making the needed sstore
      modifications and distributing the changed files to all nodes, and then
      re-enabling the master role.
      
      The modification to the man page of gnt-cluster also moves the section
      on gnt-cluster destroy in order to correct alphabetical ordering.
      
      Reviewed-by: imsnah
      07bd8a51
  7. Sep 17, 2007
  8. Sep 14, 2007
    • Iustin Pop's avatar
      Change OpQueryNodes nodes attribute to names · 246e180a
      Iustin Pop authored
      Change this to have the exact same parameters as OpQueryInstances.
      
      Also fix burnin which is broken since r146.
      
      Reviewed-by: imsnah
      246e180a
    • Iustin Pop's avatar
      Enable LUQueryInstances to work with a given list of instances · 069dcc86
      Iustin Pop authored
      As per the changes to LUQueryNodes, the QueryInstances LU is modified to
      accept a list of instances for which to compute and return information.
      
      Reviewed-by: imsnah
      069dcc86
    • Iustin Pop's avatar
      Remove OpQueryNodeData and LUQueryNodeData · 4a72cc75
      Iustin Pop authored
      Now that LUQueryNodes supports all the functionality of LUQueryNodeData,
      let's migrate gnt-node.ShowNodeConfig to use it and remove all traces of
      OpQueryNodeData and LUQueryNodeData.
      
      Reviewed-by: imsnah
      4a72cc75
    • Iustin Pop's avatar
      Change LUQueryNodes to return raw values and support selective listing · ec223efb
      Iustin Pop authored
      LUQueryNodes it's very similar to LUQueryNodeData, but it lacks two
      features:
        - instance list (it has count though), both primary and secondary
        - selective node listing
      
      In order to support these features, we change it to return raw values
      instead of stringified ones (like the recent change to LUQueryInstances)
      and to support query-ing of a restricted set of nodes.
      
      This CL also modifies the gnt-node script to conform to the new protocol
      and the opcode OpQueryNodes to support the new "nodes" attribute.
      
      Reviewed-by: imsnah
      ec223efb
    • Iustin Pop's avatar
      Change _GetWanted* to return names instead of objects · a7ba5e53
      Iustin Pop authored
      On closer look, all except one of the current users of _GetWantedNodes are
      using only the name of the nodes and throw away the other attributes. It makes
      sense to make this function return only the name list (as in the future this
      might be faster than computing all attributes).
      
      Reviewed-by: imsnah
      a7ba5e53
  9. Sep 13, 2007
    • Iustin Pop's avatar
      Move string formatting out of LUQueryInstances · 8a23d2d3
      Iustin Pop authored
      Currently, LUQueryInstances will provide strings for its results. This makes it
      hard for other consumers than "gnt-instance list" to use the OpQueryInstances
      opcode for whatever they wish to.
      
      The change moves the formatting in five of the six cases where this happens to
      the actual gnt-instance.ListInstances procedure and removes the unconditional
      convert to string in LUQueryInstances.Exec()
      
      Reviewed-by: imsnah
      8a23d2d3
    • Iustin Pop's avatar
      Fix the ssh change which breaks remote ssh commands · 72f0f7fd
      Iustin Pop authored
      Explanation: since we use lists and not a string, every argument we give
      is passed unchanged to the remote shell. So, for example, passing
      '/etc/init.d/ganeti restart' to the remote shell, it will try to run the
      path /etc/init.d/ganeti\ restart. With the s space included. This
      breaks, for example, gnt-node add and gnt-cluster command.
      
      The original problem with the backup routines that led to the "'" change
      is that they use a plain " ".join(list), but we don't need to quote the
      whole ssh remote command for this. We can simply use the existing
      utils.ShellQuoteCmd(list) which does the proper quoting of the ';' or
      '&&' metacharacters.
      
      With this change, both gnt-node add, gnt-cluster command and
      export/import work.
      
      This also improves the error-handling behaviour of one cat command by
      making it conditional on the preceding mkdir.
      
      Reviewed-by: ultrotter
      72f0f7fd
  10. Sep 12, 2007
  11. Sep 11, 2007
  12. Sep 07, 2007
    • Guido Trotter's avatar
      Make import/export use the auxiliary ssh library to build the remote commands. · 00003458
      Guido Trotter authored
      This avoids forgetting some parameters, as it's happening right now 
      (the correct known host file is not being passed)
      
      In order to do so we split SSHCall into an auxiliary BuildSSHCmd which builds
      the command but doesn't actually call it, and SSHCall itself which runs RunCmd
      on top of BuildSSHCmd's result. BuildSSHCmd is then explicitely called by 
      import/export who has to build a more complex command to be run later.
      00003458
  13. Sep 05, 2007
  14. Sep 04, 2007
  15. Sep 03, 2007
    • Michael Hanselmann's avatar
      - Generic automake cleanup · 7c18ef8e
      Michael Hanselmann authored
      - Bump version number to 1.2b2
      - Add version.py file generated from version.py.in by autoconf
      
      Reviewed-by: schreiberal
      7c18ef8e
    • Iustin Pop's avatar
      Switch utils.RunCmd from popen2 to subprocess · 113b55aa
      Iustin Pop authored
      This changes the implementation of RunCmd from using the popen2 module
      to using the (new in 2.4) subprocess module.
      
      This is helpful because the subprocess module has more advanced features
      than popen2, the most important ones being the ability to run code in the
      child process before the exec and ability to launch with modified
      environment.
      
      Reviewed-by: imsnah
      113b55aa
  16. Aug 30, 2007
Loading