1. 18 Dec, 2008 1 commit
  2. 14 Dec, 2008 1 commit
    • Iustin Pop's avatar
      cleanup: fix 'variable unused' warning · fab1e3a4
      Iustin Pop authored
      In the iteration we don't care about the node names, so we change the
      for loop to be over the values (and not itervalues).
      
      Reviewed-by: amishchenko
      fab1e3a4
  3. 11 Dec, 2008 1 commit
    • Iustin Pop's avatar
      Fix epydoc format warnings · c41eea6e
      Iustin Pop authored
      This patch should fix all outstanding epydoc parsing errors; as such, we
      switch epydoc into verbose mode so that any new errors will be visible.
      
      Reviewed-by: imsnah
      c41eea6e
  4. 09 Dec, 2008 1 commit
    • Michael Hanselmann's avatar
      RPC: Compress file upload data · 12bce260
      Michael Hanselmann authored
      Adding compression to larger amounts of data is more efficient than
      transferring it (len(nodes) - 1) times over the network without
      compression. We were able to compress a 800KB config file to about
      30 KB, which is about 40 KB with Base64 encoding (required due to
      the way SimpleJson handles strings).
      
      Reviewed-by: ultrotter
      12bce260
  5. 08 Dec, 2008 1 commit
    • Iustin Pop's avatar
      RPC: do not make calls to offline nodes · ed83f5cc
      Iustin Pop authored
      This patch changes the _MultNodeCall and _SingleNodeCall helpers to not
      actually make calls to offline nodes, but instead generate fake
      responses which have a parameter caller 'offline' set so that callers
      can check for this value if they want (otherwise, it's just a failed RPC
      call).
      
      Reviewed-by: ultrotter
      ed83f5cc
  6. 05 Dec, 2008 1 commit
    • Iustin Pop's avatar
      Cleanup the config file on demotion from candidate · 56aa9fd5
      Iustin Pop authored
      This patch adds a simple rpc which makes a backup of the config file and
      then removes it. This is done so that cluster verify doesn't complain
      immediately after demoting a node.
      
      Reviewed-by: imsnah
      56aa9fd5
  7. 04 Dec, 2008 1 commit
  8. 02 Dec, 2008 1 commit
    • Iustin Pop's avatar
      Convert rpc results to a custom type · 781de953
      Iustin Pop authored
      For a long time we had the problem that both RPC-layer errors and
      results from the remote node share the same "valuespace". This is
      because we shouldn't raise an exception when only one node failed
      (and lose the results from the other nodes).
      
      This patch attempts to address this problem by returning a special
      object from RPC calls, which separates the rpc-layer status and the
      remote results into different attributes.
      
      All the users of rpc (mainly cmdlib, but also bootstrap and the
      HooksMaster in mcpu) have been converted to this new model. The code has
      changed from, e.g. for boolean return types:
      
        if not self.rpc.call_...
      
      to
      
        result = self.rpc.call_
        if result.failed or not result.data:
           ^ rpc-layer error    |
                                - result payload
      
      While this is slightly more complicated, it will allow cleaner checks in
      the future; right now the code is just a plain port, without
      optimizations.
      
      There's also a "result.Raise()" which raises an OpExecError if the
      rpc-layer had errors.
      
      One side-effect of the patch is that now all return types from the
      rpc.call_ functions are of either RpcResult (single-node) or dicts of
      (node name, RpcResult); previously, some functions were returning
      different object types based on error status.
      
      The code passes burnin (after many retries :).
      
      Reviewed-by: imsnah
      781de953
  9. 01 Dec, 2008 1 commit
  10. 26 Nov, 2008 1 commit
    • Iustin Pop's avatar
      Reduce duplication of work in rpc.Client · 160e2921
      Iustin Pop authored
      This patch removes the duplicate serialization and calls to
      utils.GetNodeDaemonPort in rpc.Client, and instead moves them to calling
      functions (the _*NodeCall ones recently introduced).
      
      Reviewed-by: ultrotter
      160e2921
  11. 25 Nov, 2008 1 commit
  12. 24 Nov, 2008 1 commit
  13. 21 Nov, 2008 4 commits
  14. 19 Nov, 2008 1 commit
  15. 12 Nov, 2008 3 commits
  16. 23 Oct, 2008 1 commit
    • Iustin Pop's avatar
      Export the disk index in the import/export scripts · 74c47259
      Iustin Pop authored
      We want to export the disk index as some OSes will only want to export
      the first disk (or the second one, etc.), even if we have multiple
      disks.
      
      The patch also updates the backend.ExportSnapshot docstring.
      
      Reviewed-by: ultrotter
      74c47259
  17. 22 Oct, 2008 1 commit
    • Guido Trotter's avatar
      Convert ImportOSIntoInstance to OS API 10 · 6c0af70e
      Guido Trotter authored
      - Change ImportOSIntoInstance not to get any "os_disk" and "swap_disk"
        arguments but to accept multiple target images to import, and to
        return a list of booleans with the result of each import
      - Change the relevant rpc call and the only caller to conform
      - Pass arguments to the import script through the environment
      - Run one import os script for each disk image, passing an IMPORT_DEVICE
      
      Reviewed-by: iustinp
      6c0af70e
  18. 20 Oct, 2008 6 commits
    • Iustin Pop's avatar
      Convert the job queue rpcs to address-based · 99aabbed
      Iustin Pop authored
      The two main multi-node job queue RPC calls (jobqueue_update,
      jobqueue_rename) are converted to address-based calls, in order to speed
      up queue changes. For this, we need to change the _nodes attribute on
      the jobqueue to be a dict {name: ip}, instead of a set.
      
      Reviewed-by: imsnah
      99aabbed
    • Iustin Pop's avatar
      Convert rpc.call_upload_file to use addresses · 6b294c53
      Iustin Pop authored
      This patch allows rpc.call_upload_file to use addresses (if passed), and
      also converts the ConfigWriter._DistributeConfig to pass them, since
      this is an often-done operation.
      
      Reviewed-by: imsnah
      6b294c53
    • Iustin Pop's avatar
      Convert non-static rpc calls to use addresses · 25348212
      Iustin Pop authored
      This patch converts all non-staticmethods rpc calls to pass addresses to
      the Client calls.
      
      This is done via two new small helpers. These functions also deal with
      nodes that are not (yet) in the configuration file, and pass None for
      the address instead (which allow NodeControllers to do resolving).
      
      Reviewed-by: imsnah
      25348212
    • Iustin Pop's avatar
      Add infrastructure for using addresses in rpc.py · bdf7d8c0
      Iustin Pop authored
      The patch adds support for passing node addresses to NodeController
      objects, which should speed up the connect sequence.
      
      The patch also adds another very small optimization of computing the
      content-length header value in the parent Client class instead of each
      NodeController.
      
      Reviewed-by: imsnah
      bdf7d8c0
    • Iustin Pop's avatar
      Improve conformance with the style guide for rpc.py · 3ef3c771
      Iustin Pop authored
      This patch renames some internal function to camel case, for compliance
      with the style guide.
      
      It also fixes the module docstring (how old was that?).
      
      Reviewed-by: imsnah
      3ef3c771
    • Iustin Pop's avatar
      Convert rpc.py to use the logging module · 58b311ca
      Iustin Pop authored
      Reviewed-by: imsnah
      58b311ca
  19. 17 Oct, 2008 1 commit
  20. 15 Oct, 2008 1 commit
  21. 14 Oct, 2008 3 commits
    • Iustin Pop's avatar
      Correctly fill the beparams too over RPC · 5b442704
      Iustin Pop authored
      As for the hvparams, we need to replace the sent instance beparams.
      
      Reviewed-by: ultrotter
      5b442704
    • Iustin Pop's avatar
      Implement FillHV for instance-related rpc calls · 26ba2bd8
      Iustin Pop authored
      We fill the instance hvparams with cluster defaults, and send a modified
      dict over the wire to the node methods - they don't know anything about
      cluster defaults versus instance parameters.
      
      Reviewed-by: ultrotter
      26ba2bd8
    • Iustin Pop's avatar
      Export the hypervisor.ValidateParameters over RPC · 6217e295
      Iustin Pop authored
      The newly-added node-specific ValidateParams hypervisor method is
      exported over RPC, using the semi-standard (success, message) return
      value. Multi-node call, so that we call on both primary and secondary at
      once.
      
      Reviewed-by: ultrotter
      6217e295
  22. 13 Oct, 2008 1 commit
    • Iustin Pop's avatar
      Fix a few rpc-related errors · 16ad1a83
      Iustin Pop authored
      This fixes:
        - whitespace change, double lines between methods
        - duplication of call_upload_file, introduced by mistake in rev 1795
          and which went undetected because of the many changes in that ref
          (only diff -b shows it clearly)
        - call_instance_info didn't pass the hypervisor name parameter, but
          the backend requires it
      
      Reviewed-by: ultrotter
      16ad1a83
  23. 12 Oct, 2008 1 commit
    • Iustin Pop's avatar
      Abstract checking own address into a function · caad16e2
      Iustin Pop authored
      Currently, we check if we have a given ip address (i.e. it's alive on
      one of our interfaces) but manually calling TcpPing(source=localhost).
      This works, but having it spread all over the code makes it hard to
      change the implementation.
      
      The patch abstracts this into a separate utils.OwnIpAddress(addr)
      function. We add a rpc call for it, which we use instead of the
      (single-use of) call_node_tcp_ping. We leave node_tcp_ping in, as seems
      useful and eventually it should be removed in a separate patch.
      
      Reviewed-by: imsnah
      caad16e2
  24. 10 Oct, 2008 2 commits
    • Michael Hanselmann's avatar
      Mark call_node_leave_cluster as a static method · 15396f60
      Michael Hanselmann authored
      Reviewed-by: iustinp
      15396f60
    • Iustin Pop's avatar
      Convert rpc module to RpcRunner · 72737a7f
      Iustin Pop authored
      This big patch changes the call model used in internode-rpc from
      standalong function calls in the rpc module to via a RpcRunner class,
      that holds all the methods. This can be used in the future to enable
      smarter processing in the RPC layer itself (some quick examples are not
      setting the DiskID from cmdlib code, but only once in each rpc call,
      etc.).
      
      There are a few RPC calls that are made outside of the LU code, and
      these calls are left as staticmethods, so they can be used without a
      class instance (which requires a ConfigWriter instance).
      
      Reviewed-by: imsnah
      72737a7f
  25. 08 Oct, 2008 1 commit
    • Iustin Pop's avatar
      Move the hypervisor attribute to the instances · e69d05fd
      Iustin Pop authored
      This (big) patch moves the hypervisor type from the cluster to the
      instance level; the cluster attribute remains as the default hypervisor,
      and will be renamed accordingly in a next patch. The cluster also gains
      the ‘enable_hypervisors’ attribute, and instances can be created with
      any of the enabled ones (no provision yet for changing that attribute).
      
      The many many changes in the rpc/backend layer are due to the fact that
      all backend code read the hypervisor from the local copy of the config,
      and now we have to send it (either in the instance object, or as a
      separate parameter) for each function.
      
      The node list by default will list the node free/total memory for the
      default hypervisor, a new flag to it should exist to select another
      hypervisor. Instance list has a new field, hypervisor, that shows the
      instance hypervisor. Cluster verify runs for all enabled hypervisor
      types.
      
      The new FIXMEs are related to IAllocator, since now the node
      total/free/used memory counts are wrong (we can't reliably compute the
      free memory).
      
      Reviewed-by: imsnah
      e69d05fd
  26. 07 Oct, 2008 1 commit
    • Iustin Pop's avatar
      rpc.call_instance_migrate: pass the whole instance · 9f0e6b37
      Iustin Pop authored
      Currently the call_instance_migrate call only passes the instance name;
      we need to pass the whole object for the hypervisor_type changes (all
      the other individual instance rpc calls already pass the instance
      object).
      
      Reviewed-by: imsnah
      9f0e6b37
  27. 06 Oct, 2008 1 commit
    • Iustin Pop's avatar
      backend.py change to get cluster name from master · 62c9ec92
      Iustin Pop authored
      Currently there are three function in backend that need the cluster name
      in order to instantiate an SshRunner. The patch changes these to get the
      cluster name from the master in the rpc call; once the multi-hypervisor
      change is implemented, then very few places in which we need the SCR
      remain in the backend.
      
      Reviewed-by: killerfoxi, imsnah
      62c9ec92