Skip to content
Snippets Groups Projects
  1. Feb 24, 2009
  2. Feb 19, 2009
  3. Feb 17, 2009
  4. Feb 16, 2009
    • Iustin Pop's avatar
      Fix some bugs in reboot · ae48ac32
      Iustin Pop authored
      There are two issues fixed in this patch:
        - first, the recent RPC changes caused loss of data in hard reboot
          type; we weren't reporting any results from the stop/start instance
          calls;
        - second, in soft or hard reboots, we didn't initialized the disk
          physical ID; based on the last state of the instance's disks, this
          can create a failure in identifying the disks
      
      After this patch, burnin works again with reboot, and reports errors
      correctly.
      
      Reviewed-by: imsnah
      ae48ac32
    • Iustin Pop's avatar
      Convert IOErrors for /proc/drbd into our errors · f6eaed12
      Iustin Pop authored
      If /proc/drbd can't be opened, this raises an IOError, but all the
      error-handling behaviour in backend treats only BlockDeviceErrors. This
      creates a plain failure in cluster verify and in other RPC calls.
      
      This patch simply converts EnvironmentErrors into BlockDeviceErrors, and
      also changes the RPC result for NV_DRBDLIST and its handling to be able
      to show the error. The other RPC calls work by default now, due the
      existing error handling.
      
      Reviewed-by: ultrotter
      f6eaed12
    • Guido Trotter's avatar
      Convert default root partition to msdos style · 1cd8141c
      Guido Trotter authored
      As discussed with 2.0 msdos partition style should be the default in the
      instance OS, so we're changing the default instance params accordingly.
      A followup patch will update the debootstrap os.
      
      Reviewed-by: iustinp
      1cd8141c
  5. Feb 13, 2009
    • Iustin Pop's avatar
      RAPI: documentation updates · bf4a90af
      Iustin Pop authored
      This patch fixes the version and does some update to the RAPI resources
      docs.
      
      Reviewed-by: imsnah
      bf4a90af
    • Iustin Pop's avatar
      RAPI: fixes related to write mode · 6e99c5a0
      Iustin Pop authored
      This patch fixes many small issues related to write functions:
        - update documentations w.r.t. how to add users
        - update the instance add function for latest API
        - add instance delete
        - fix addition of tags
        - update some error messages
      
      Reviewed-by: imsnah
      6e99c5a0
    • Iustin Pop's avatar
      Some small improvements to the fake hypervisor · bfc30ec0
      Iustin Pop authored
      This patch modifies the fake hypervisor to substract the memory “used”
      by “running” instances from the free memory, so the actual node
      information changes based on the running instances.
      
      Also some style changes and fixes are added.
      
      Reviewed-by: ultrotter
      bfc30ec0
    • Guido Trotter's avatar
      SetInstanceParams: export nic changes to hooks · d8dcf3c9
      Guido Trotter authored
      Currently we export the old instance "as is" and any nic changes get
      lost, so hooks won't know of a different ip, bridge, or mac address.
      This patch fixes it by putting the nics in the override dict, if any
      changes are done.
      
      Reviewed-by: iustinp
      d8dcf3c9
    • Guido Trotter's avatar
      Remove two fixed FIXME and convert one to TODO · ea5a5b74
      Guido Trotter authored
      The cli FIXME is not something broken, but rather some better handling
      feature we'd rather have, and the two backend FIXME are done (disks have
      their read only parameter set, and the error is raised and thus reaches
      the master).
      
      Reviewed-by: iustinp
      ea5a5b74
    • Iustin Pop's avatar
      RAPI: format error messages as JSON · 1f8588f6
      Iustin Pop authored
      This patch changes the format of the HTTP error messages from text/html, which
      is hard to parse from RAPI clients, to JSON which can be automatically parsed.
      
      The error message is an object, which contains always three keys:
        - code, an integer with the error code
        - message, a short description
        - explain, holding (if available) a description of the error
      
      In order to implement this, there is a bit of change to the http server
      and executor classes. I've tested and the error handling still works
      (but less optimal, no error message) in case the error formatting itself
      raises an exception.
      
      Reviewed-by: imsnah
      1f8588f6
    • Iustin Pop's avatar
      Make RAPI return 502/504 errors for luxi errors · 77e1d753
      Iustin Pop authored
      This changes the RAPI error codes for luxi errors; a timeout error is
      now reported properly as 504, while any other luxi error is reported as
      502.
      
      It would be good to convert even more errors into proper return codes in
      the future.
      
      Reviewed-by: imsnah
      77e1d753
  6. Feb 12, 2009
    • Iustin Pop's avatar
      job queue: log the opcode error too · 0f6be82a
      Iustin Pop authored
      Currently we only log "Error in opcode ...", but we don't log the error itself.
      This is not good for debugging.
      
      Reviewed-by: ultrotter
      0f6be82a
    • Guido Trotter's avatar
      LUSetInstanceParams: Fix nic handling · 5c44da6a
      Guido Trotter authored
      CheckArguments:
        Use constants.VALUE_NONE rather than hardcoding the string "none"
        If we're adding a nic fill the nic_dict with default values
        Check if the mac is syntactically valid, if we have one
        Don't allow the mac to be 'auto' when modifying a nic
      
      CheckPrereq:
        Check that bridge and mac if present in the dict are not None
          (before this wasn't handled at all)
        Generate the nic mac address here if demanded
      
      Exec:
        Do not generate nics and macs
      
      Reviewed-by: iustin
      5c44da6a
    • Guido Trotter's avatar
      ConfigWriter.AddInstance check instance mac · e4640214
      Guido Trotter authored
      There is a race condition in CreateInstance, since the mac address is
      generated early and only added to the config (and thus really assured to
      be unique) only at this point. Since it's possible that another instance
      gets the same mac address in the meantime with this check we'll make the
      instance creation fail before modifying the config data and thus having
      a wrong in-memory config (which is bad!!).
      
      Note that the same race condition exists, for example, in
      SetInstanceParams, and should be fully addressed by a way to revert
      config changes if writing them fails!
      
      Reviewed-by: iustin
      e4640214
    • Guido Trotter's avatar
      Instance Creation: generate nics earlier · 295728df
      Guido Trotter authored
      We want the real nic to be shown to the hooks and the allocators, so
      we'll generate them in CheckPrereq. We also write a comment about the
      race condition we generate. This race condition existed even before, so
      moving this generation will just lenghen it a bit. A separate patch
      mitigates its effects.
      
      This patch also adds an ENDIF comment for a very long if, and removes a
      double empty line inside the CheckPrereq function of LUCreateInstance.
      
      Reviewed-by: iustin
      295728df
    • Iustin Pop's avatar
      Handle better broken disks · fd965830
      Iustin Pop authored
      While running burnin:
        File "/usr/lib/python2.4/site-packages/ganeti/objects.py", line 497, in __str__
          val += ", size=%dm)>" % self.size
      TypeError: int argument required
      
      This happened while handling another error, so we lose the original
      error information.
      
      So we should try to handle this better.
      
      Reviewed-by: ultrotter
      fd965830
    • Iustin Pop's avatar
      Do not check 'None' disk IDs for duplicates · 25ae22e4
      Iustin Pop authored
      In case of 'None' logical or physical IDs, we don't need to check them
      for duplicates. This case can happen for DRBD devices in case of newly
      added disks, for example.
      
      Reviewed-by: imsnah
      25ae22e4
    • Iustin Pop's avatar
      Prevent race condition on MAC addresses · e7d81ba0
      Iustin Pop authored
      This patch adds a temporary set for MACs that have been requested but
      are not yet in the configuration (as part of an instance NIC). The MACs
      of an instance are automatically removed from this set when the instance
      is updated (or first added to the config).
      
      Reviewed-by: ultrotter
      e7d81ba0
    • Iustin Pop's avatar
      Some small fixes · 5b460366
      Iustin Pop authored
      This patch removes the admin_ram LUQueryInstances field (is broken
      anyway) and fixes the VNC address checks in the Xen Hypervisor.
      
      Reviewed-by: imsnah
      5b460366
    • Iustin Pop's avatar
      Fix LUQueryInstances fields. · 8aec325c
      Iustin Pop authored
      The query fields are now regular expressions. We need to quote the dots,
      otherwise invalid fields will be accepted but they will lose special
      formatting in the cli scripts.
      
      Reviewed-by: imsnah
      8aec325c
    • Guido Trotter's avatar
      Apply the right permissions to /etc/hosts · 9b977740
      Guido Trotter authored
      In the current Ganeti version when modifying /etc/hosts we mistakenly
      give it the permissions of the temporary file we create to define its
      content, which is by default 0600. This breaks most non-root
      applications, and thus must be corrected. This patch forces the mode to
      be 0644 (but we might decide to just use the mode of the previous
      /etc/hosts, if we want to be more polite against any eventual
      administrative choice). We also add a new assertFileMode() method for
      unit tests and actually check in the SetEtcHostsEntry and
      RemoveEtcHostsEntry tests that the mode is correct, to be sure not to
      reintroduce this bug again. Also, a FIXME is added in the original
      functions stating that it would be nice to use WriteFile+fn() rather
      than reimplementing its functionality again.
      
      Reviewed-by: iustinp
      9b977740
    • Iustin Pop's avatar
      Fix RPC result handling in _AssembleInstanceDisks · 1dff8e07
      Iustin Pop authored
      For (status, data)-style RPC calls, the result data is in the ‘payload’
      attribute. This was missed in the conversion patch, with the only side
      effect that gnt-instance activate-disks didn't show a nice output
      anymore.
      
      Reviewed-by: ultrotter
      1dff8e07
    • Iustin Pop's avatar
      ConfigWriter: add checks for duplicate disk IDs · 4b98ac29
      Iustin Pop authored
      This patch adds a safety check for duplicate disk logical/physical IDs,
      in order to prevent possible software bugs.
      
      Reviewed-by: imsnah
      4b98ac29
    • Iustin Pop's avatar
      Switch the instance_shutdown rpc to (status, data) · 1fae010f
      Iustin Pop authored
      This patch changes the return type from this RPC call to include status
      information and renames the backend method to match the RPC call name.
      
      The patch is a little bigger than the reboot one, since this call is
      used in more than one place. However, all the points of call have the
      same usage pattern, so the patch is trivial.
      
      Reviewed-by: ultrotter
      1fae010f
    • Iustin Pop's avatar
      Switch the instance_reboot rpc to (status, data) · 489fcbe9
      Iustin Pop authored
      This small patch changes the return type from this RPC call to include
      status information and renames the backend method to match the RPC call
      name.
      
      Reviewed-by: ultrotter
      489fcbe9
  7. Feb 11, 2009
    • Guido Trotter's avatar
      FileStorage: abort creating over an existing file · aed77cea
      Guido Trotter authored
      In FileStorage there is a TODO:
       decide whether we should check for existing files and
       abort or not
      After Ganeti ate my instance data I decided. Let's abort.
      In general there is no reason we should overwrite existing files, and
      doing it can be very harmful for preexisting files on the host.
      
      Reviewed-by: iustinp
      aed77cea
    • Guido Trotter's avatar
      _GenerateDiskTemplate: correct file disk index · 43e99cff
      Guido Trotter authored
      Currently when adding disks the base for the index is not taken into
      account, and disk 0 is added twice.
      
      Reviewed-by: iustinp
      43e99cff
    • Guido Trotter's avatar
      HTS_USE_VNC, rename and remove KVM · ccd905ac
      Guido Trotter authored
      Currently we use the HTS_USE_VNC constant only to copy the vnc password
      file. While KVM uses vnc it currently has no password support, nor we'll
      be on time making one for 2.0, so renaming the constant to
      HTS_COPY_VNC_PASSWORD and only putting Xen HVM in it. In the future
      (2.1) password handling will need to be reworked anyway.
      
      Reviewed-by: iustinp
      ccd905ac
  8. Feb 10, 2009
    • Iustin Pop's avatar
      Some fixes to node add and re-add · 82e12743
      Iustin Pop authored
      The patch changes the pre-checks in node-add and re-add:
        - if the node is not already in the cluster, refuse to re-add
        - when re-adding, reuse the secondary IP from the cluster
          configuration
        - when re-adding, reset the offline and drained flags, so that RPC
          calls work (and we can actually upload the keys)
      
      The patch also adds a missing log entry in LUSetNodeParams.
      
      Reviewed-by: imsnah
      82e12743
    • Guido Trotter's avatar
      Instance parameters: force typing · a5728081
      Guido Trotter authored
      We want all the hv/be parameters to have a known type, rather than a
      random mix of empty string, boolean values, and None, so we declare the
      type of each variable and we enforce/convert it.
      
      - Add some new constants for enforceable value types
      - Add new constants dicts HVS_PARAMETER_TYPES and BES_PARAMETER_TYPES
        holding not only the valid parameters but also their types
      - Drop the old HVS_PARAMETERS and BES_PARAMETERS constants and calculate
        the values from the type dict
      - Convert all the default parameters to a valid type value
      - Create a new ForceDictType utils function, to check/enforce a dict's
        element value types, with relevant unit tests
      - Drop a few custom functions to check/convert the BE param types in
        utils and cli, in favor of ForceDictType
      - Double-check the parameter types using ForceDictType in both scripts
        and LogicalUnits, when possible.
      
      As a bonus:
      - Remove some old commented-out code in gnt-instance
      - Remove some already fixed FIXME
      - Fix a bug which prevented VALUE_DEFAULT to be applied to BE parameters
        in SetInstanceParams because the value was checked for validity before
        that transformation was made
      - Fix a bug which prevented initing a cluster and passing hvparams to
        work at all
      - ForceDictType allows an allowed_values for exceptions, which makes us
        able to do the checking even when some values must not be
        converted/typechecked (for example the 'default' string in
        SetInstanceParameters)
      
      Reviewed-by: iustinp
      a5728081
    • Iustin Pop's avatar
      Implement modification of the drained flag · c9d443ea
      Iustin Pop authored
      This patch adds LU and cli-level support for modification of the node
      drained flag. It is similar to the offline changes.
      
      Reviewed-by: imsnah
      c9d443ea
    • Iustin Pop's avatar
      Prevent allocations on drained nodes · 733a2b6a
      Iustin Pop authored
      This patch adds checks for drained nodes in the logical units that
      allocate or move instances around. We also update an error message (not
      style-compliant).
      
      Reviewed-by: imsnah
      733a2b6a
    • Iustin Pop's avatar
      cluster verify: show correctly drained nodes · 22f0f71d
      Iustin Pop authored
      This patch changes slightly the output of gnt-cluster verify for drained
      nodes, and also adds a note with the total number of drained nodes
      (similar to the offline nodes note).
      
      Reviewed-by: imsnah
      22f0f71d
    • Iustin Pop's avatar
      ConfigWriter: handle the drained node flag · 5bf07049
      Iustin Pop authored
      This patch changes the master candidate pool computations in
      ConfigWriter to properly handle drained nodes. They are now excluded
      from counting towards the reachable number of candidates.
      
      The patch also adds verification of consistency for the node status.
      
      Reviewed-by: imsnah
      5bf07049
    • Iustin Pop's avatar
      Allow query of the drained node attribute · 0b2454b9
      Iustin Pop authored
      This patch exports the drained attribute:
        - LUQueryNodes accepts now the drained field
        - RAPI exports it for node objects
        - gnt-node info shows it now (along newly-added master_candidate and
          offline flags)
        - gnt-node list can list it (but not by default)
        - to the iallocator scripts
      
      Reviewed-by: imsnah
      0b2454b9
    • Iustin Pop's avatar
      Add a ‘drained’ attribute to node objects · af64c0ea
      Iustin Pop authored
      This attribute will be used to prevent any allocation on the node (any
      of replace-disks with new secondary this node, failover to the node,
      migration to the node).
      
      The patch adds the attribute and initializes it correctly in cluster
      init and for new nodes.
      
      Reviewed-by: imsnah
      af64c0ea
    • Iustin Pop's avatar
      Some error message cleanups · 33bc6f01
      Iustin Pop authored
      Reviewed-by: imsnah
      33bc6f01
    • Iustin Pop's avatar
      Cleanup of DRBD8._CheckMetaSize · 9c793cfb
      Iustin Pop authored
      This patch converts the _CheckMetaSize method to raise exceptions
      instead of logging and returning False. This fits now in the new rpc
      return types, so it's a cheap change.
      
      Reviewed-by: ultrotter
      9c793cfb
Loading