1. 02 Dec, 2008 10 commits
    • Guido Trotter's avatar
      Use the new utils.CheckBEParams function · d4b72030
      Guido Trotter authored
      Where we used/forgot to validate beparams we now use the new common function.
      
      Reviewed-by: imsnah
      d4b72030
    • Guido Trotter's avatar
      Handle default/none values in hv/be params · 8edcd611
      Guido Trotter authored
      When a value is set to constants.VALUE_DEFAULT we have to remove it from
      the specific instance dict, as this way it will be populated from the
      cluster before. If instead it's specified as constants.VALUE_NONE we'll
      explicitely set it to None, to override its presence with a different
      values in such defaults. However, currently, we handle None values only
      for hvparams, that have a real use case for them.
      
      Reviewed-by: imsnah
      8edcd611
    • Guido Trotter's avatar
      ImportExport: make src_node and src_path optional · b9322a9f
      Guido Trotter authored
      If src_node is not there we'll default to using the currently exported
      instance name as src_path. Also, if src_path is not absolute we'll look
      for it in EXPORT_DIR.
      
      Reviewed-by: iustinp
      b9322a9f
    • Guido Trotter's avatar
      LUCreateInstance: handle import without src_node · c0cbdc67
      Guido Trotter authored
      If we get called with no source node we'll thread src_path as an
      instance name exported in EXPORT_DIR in one of the nodes and look for
      it with the export_list rpc call.
      
      Reviewed-by: iustinp
      c0cbdc67
    • Guido Trotter's avatar
      LUCreateInstance: keep src node lock on import · 9c8971d7
      Guido Trotter authored
      Currently the node lock also guards against removing the import at the
      wrong time, so if we're importing an instance image we want to keep the
      source node locked. In the future we might want to put export locks at a
      different level than node locks.
      
      Reviewed-by: iustinp
      9c8971d7
    • Iustin Pop's avatar
      Adjust cluster-verify to check for candidate role · 112f18a5
      Iustin Pop authored
      Currently cluster verify checks all nodes for the same set of files,
      even if the nodes are not master candidates.
      
      This patch adds back checking of ssconf files for consistency and splits
      the checksum check into different error reporting messages based on
      candidate role.
      
      Reviewed-by: imsnah
      112f18a5
    • Iustin Pop's avatar
      Prevent demotion from candidate based on pool size · 3e83dd48
      Iustin Pop authored
      In gnt-cluster modify we prevent demotion from the candidate role if
      there are not enough master candidates left.
      
      Reviewed-by: imsnah
      3e83dd48
    • Iustin Pop's avatar
      Add cluster candidate pool size parameter · 4b7735f9
      Iustin Pop authored
      This patch adds a new cluster paramater "candidate_pool_size" which
      tracks the desired size of the list of nodes with the master_candidate
      flag set.
      
      Reviewed-by: imsnah
      4b7735f9
    • Iustin Pop's avatar
      Add a gnt-node modify operation · b31c8676
      Iustin Pop authored
      This patch adds the OpCode, LogicalUnit and gnt-node command for
      modifying node parameters, more specifically the master candidate flag
      for a node.
      
      Reviewed-by: imsnah
      b31c8676
    • Iustin Pop's avatar
      Add master/master_candidate fields to node list · 0e67cdbe
      Iustin Pop authored
      This patch adds listing of the master_candidate field (as Y/N) and of
      the master role (again Y/N) for nodes.
      
      Reviewed-by: imsnah
      0e67cdbe
  2. 01 Dec, 2008 1 commit
    • Iustin Pop's avatar
      Fix errors when the node info RPC is incomplete · d599d686
      Iustin Pop authored
      [Forward-port from the 1.2 branch]
      
      If ganeti starts before xend, the node information will not have all the
      fields filled in. The patch changes so that missing keys will be treated
      as unknown (this applies to other cases as well, not only xend not
      started).
      
      Reviewed-by: ultrotter
      d599d686
  3. 27 Nov, 2008 3 commits
    • Iustin Pop's avatar
      Fix gnt-backup export · 726d7d68
      Iustin Pop authored
      This patch fixes a bug in disk calculation for gnt-backup export, which
      completely broke one-disk instance export.
      
      The patch also corrects some error messages and style issues.
      
      Reviewed-by: ultrotter
      726d7d68
    • Iustin Pop's avatar
      Fix a message in LUExportInstance · 268b8e42
      Iustin Pop authored
      We never verified the node name before, so this is most likely not a
      non-retrieve but a wrong name case.
      
      Reviewed-by: ultrotter
      268b8e42
    • Iustin Pop's avatar
      Fix instance creation · 112050d9
      Iustin Pop authored
      This patch fixes the diskless and drbd/file based instances. Sorry :(
      
      Reviewed-by: ultrotter
      112050d9
  4. 25 Nov, 2008 5 commits
    • Iustin Pop's avatar
      Implement support for multi devices changes · 24991749
      Iustin Pop authored
      This big patch adds support for:
        - changing NIC/disks in the multi-device model
        - adding/removing NICs
        - adding/removing disks
      
      The patch is big and not very nice; the error checking paths are not
      very clear.
      
      The biggest problem is that from a simple instance.ATTR=VAL change
      (which didn't throw errors before) now we are creating and removing
      disks in this LU.
      
      Reviewed-by: imsnah
      24991749
    • Iustin Pop's avatar
      Slight change to the LU initialization code · 4be4691d
      Iustin Pop authored
      This patch adds support for a separate LU.CheckArguments() method which
      should do syntactic checks without holding locks and without polluting
      the ExpandNames which is a lock-related function. See for example the
      FIXME in LUSetInstanceParams.CheckPrereq.
      
      The patch also removes the REQ_MASTER and IsCluster checks since with
      the current architecture, inside LU code we are always in a valid
      cluster and we are always running on the master node.
      
      Reviewed-by: ultrotter
      4be4691d
    • Iustin Pop's avatar
      Fix a bug in LUSetInstanceParams · b637ae4d
      Iustin Pop authored
      The wrong names were reused in a copy-paste.
      
      Reviewed-by: imsnah
      b637ae4d
    • Iustin Pop's avatar
      Show disk access mode in gnt-instance info · b6fdf8b8
      Iustin Pop authored
      The mode parameter needs to be exported and shown in the info output.
      
      Reviewed-by: imsnah
      b6fdf8b8
    • Iustin Pop's avatar
      Change _GenerateDiskTemplate iv_name generation · e2a65344
      Iustin Pop authored
      Currently the _GenerateDiskTemplate assumes it does initial creation of
      disks (i.e. it starts with index 0).
      
      For dynamic disk adds, we need to pass an additional offset. This patch
      adds this offset and modifies its sole current caller.
      
      Reviewed-by: imsnah
      e2a65344
  5. 24 Nov, 2008 7 commits
    • Guido Trotter's avatar
      LUCreateInstance: Fix import mac AUTO mode · b4364a6b
      Guido Trotter authored
      Previously on import LUCreateInstance used to recycle the mac if the instance
      name was the same than the one used at export time. Now we do the same, but
      apply the setting separately for each nic.
      
      Reviewed-by: iustinp
      b4364a6b
    • Guido Trotter's avatar
      LUCreateInstance unlock all nodes mid-way · e36e96b4
      Guido Trotter authored
      When creating a new instance, after saving the instance data to the config file
      and creating the disks, but before waiting for sync and installing the OS, we
      release the node locks, to allow for more instance creations to proceed in
      parallel.
      
      Reviewed-by: iustinp
      e36e96b4
    • Guido Trotter's avatar
      IAllocator: subtract down instances from free mem · 18640d69
      Guido Trotter authored
      Currently free_memory just reports the amount of free ram, as seen by the
      hypervisor. We adjust this amount by subtracting the memory for any instance
      which is down, and the difference for any instance which is configured to have
      more memory than the amount it's currently running at.
      
      Reviewed-by: iustinp
      18640d69
    • Guido Trotter's avatar
      IAllocator: use the right hypervisor · 8cc7e742
      Guido Trotter authored
      Since the hypervisor is instance dependent we'll get one on instance creation,
      and use the one in the instance config on relocation.
      
      Reviewed-by: iustinp
      8cc7e742
    • Guido Trotter's avatar
      IAllocator: fill i_list in a more proper way · b57e9819
      Guido Trotter authored
      - reuse the previously called cluster_info, rather than calling it again
      - get all the instances from the config atomically, to prevent race conditions
      - use a list comprehension, for simplicity
      
      Reviewed-by: iustinp
      b57e9819
    • Guido Trotter's avatar
      Parallelize instance operations on the same node · 90a7547a
      Guido Trotter authored
      With static minors we don't have a race condition anymore when
      starting/stopping/rebooting/reinstalling more than one instance on the same
      node, so we'll drop node locking altogether.
      
      Reviewed-by: iustinp
      90a7547a
    • Guido Trotter's avatar
      Convert iallocator to the new _ComputeDiskSize · dafc7302
      Guido Trotter authored
      _ComputeDiskSize's API was changed for multidisk support in r2010, but
      iallocator's call to it were not fixed. Converting them now.
      
      Reviewed-by: iustinp
      dafc7302
  6. 23 Nov, 2008 1 commit
  7. 21 Nov, 2008 4 commits
    • Iustin Pop's avatar
      Move FieldSet class to utils.py · a2d2e1a7
      Iustin Pop authored
      Since we can use the FieldSet class in cli.py to nicely format disk
      sizes and such, we move it to utils.py and also move its associated
      unittest. I didn't remove the cmdlib.py unittest file as that's not the
      good direction :)
      
      Reviewed-by: ultrotter
      a2d2e1a7
    • Iustin Pop's avatar
      Change disk index validation to FindDisk · 3e0cea06
      Iustin Pop authored
      This patch replaces the hand validation of the disk index with the
      instance.FindDisk method (actually reverting to previous method, before
      the multi-disk, but now with indexes).
      
      Reviewed-by: ultrotter
      3e0cea06
    • Iustin Pop's avatar
      Change GrowDisk to work with multi-disk · ad24e046
      Iustin Pop authored
      This patch changes the instance.FindDisk method to take index arguments
      (instead of iv_names), and changes GrowDisk and list instances
      accordingly.
      
      Reviewed-by: ultrotter
      ad24e046
    • Iustin Pop's avatar
      Change replace secondary to work with multi-disk · d418ebfb
      Iustin Pop authored
      Also fix an error in the CheckPrereq.
      
      Reviewed-by: imsnah
      d418ebfb
  8. 20 Nov, 2008 3 commits
    • Iustin Pop's avatar
      Convert replace-disks (same nodes) to multi-disk · 54155f52
      Iustin Pop authored
      This patch changes the drbd8 replace disk only (no secondary change) to
      work in with multi-disk. This mode of replaces works correctly with
      replacing only a subset of disks.
      
      Reviewed-by: imsnah
      54155f52
    • Iustin Pop's avatar
      Initial multi-disk/multi-nic support · 08db7c5c
      Iustin Pop authored
      This patch adds support for mult-disk/multi-nic in:
        - instance add
        - burnin
      
      The start/stop/failover/cluster verify work as expected. Replace disk
      and grow disk are TODO.
      
      There's also a change gnt-job to allow dictionaries to be listed in
      gnt-job info.
      
      Reviewed-by: imsnah
      08db7c5c
    • Iustin Pop's avatar
      Add more disk/nic listing options in gnt-instance · 41a776da
      Iustin Pop authored
      This adds some more listing cases (useful for scripting/rapi):
        - disk.sizes for a list of all sizes
        - nic.(ips|macs|bridges)
      
      Reviewed-by: imsnah
      41a776da
  9. 18 Nov, 2008 3 commits
    • Iustin Pop's avatar
      Allow querying of variable number of parameters · 71c1af58
      Iustin Pop authored
      This patch adds support for querying in gnt-instance list of:
        - disk.count
        - nic.count
        - disk.size/$N
        - nic.(ip|mac|bridge)/$N
      
      The patch also disables the exception raised when the header description
      is missing, that should be fixed in the future (together with better
      handling of variable numeric fields).
      
      Reviewed-by: imsnah
      71c1af58
    • Iustin Pop's avatar
      Convert cmdlib.py to _FieldSet · 31bf511f
      Iustin Pop authored
      This patch converts the current usage of _CheckOutputFields to the
      FieldSet class, but it doesn't start to use its variable matching
      features.
      
      Reviewed-by: ultrotter
      31bf511f
    • Iustin Pop's avatar
      Add a FieldSet class for variable parameter sets · 6de7c41d
      Iustin Pop authored
      This patch adds a _FieldSet class that can be used for the new variable
      parameter sets: e.g. the sda_size will change to disk/0.size (or
      similar) and we need to both check validity and extract the index of the
      parameter easily.
      
      The patch also sorts the unittest list in Makefile.am.
      
      Reviewed-by: ultrotter
      6de7c41d
  10. 11 Nov, 2008 2 commits
    • Iustin Pop's avatar
      Fix instance rename · cb4e8387
      Iustin Pop authored
      As can be seen from the patch, we remove from the locking manager
      inst.name. However, we do this right after cfg.RenameInstance, which
      changes inst.name to the new name. So we need to remove old_name not
      the new name.
      
      The real question is why does the glm allow me to remove a not-existing
      instance name...
      
      The symptom before the patch was: run rename, then:
      $ gnt-instance list
      Unhandled protocol error while talking to the master daemon:
      Caught exception: 'NoneType' object has no attribute 'primary_node'
      
      Reviewed-by: imsnah
      cb4e8387
    • Iustin Pop's avatar
      Fix gnt-instance reinstall · bb2ee932
      Iustin Pop authored
      Commit 1881 changed a rpc call but didn't fix all its users. This should
      fix it (but I can't test as HTTP is broken).
      
      Reviewed-by: imsnah
      bb2ee932
  11. 05 Nov, 2008 1 commit