1. 25 Nov, 2008 4 commits
    • 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
  2. 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
  3. 23 Nov, 2008 1 commit
  4. 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
  5. 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
  6. 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
  7. 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
  8. 05 Nov, 2008 1 commit
  9. 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
  10. 22 Oct, 2008 4 commits
    • Oleksiy Mishchenko's avatar
      RAPI: Export beparams as dict. The patch also enables LUQueryInstances to... · 1a05d855
      Oleksiy Mishchenko authored
      RAPI: Export beparams as dict. The patch also enables LUQueryInstances to accept beparams as valid field.
      
      Reviewed-by: iustinp
      
      1a05d855
    • Guido Trotter's avatar
      LUCreateInstance: import multiple disks · 09acf207
      Guido Trotter authored
      Previously we used to handle only one disk. Now we'll import all the
      ones present in the export, in order, on the instance's disks. Any disk
      which was present on the original instance but wasn't exported is just
      skipped in the target instance.
      
      Reviewed-by: iustinp
      09acf207
    • 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
    • Guido Trotter's avatar
      LUExportInstance: snapshot all disks · 19d7f90a
      Guido Trotter authored
      Rather than just snapshotting the "sda" disk, we'll snapshot all of the
      instance disks. If we can't snapshot a disk for any reason we'll log an
      error and proceed anyway: in this case the resulting export will miss a
      disk. This also changes all the warning messages to self.LogWarning().
      
      Reviewed-by: iustinp
      19d7f90a
  11. 21 Oct, 2008 1 commit
    • Iustin Pop's avatar
      Move some LU logging to use proc.Log* · 86d9d3bb
      Iustin Pop authored
      We change some messages which are obviously intended for the user to use
      the proc.Log* functions instead of (only) the logging ones.
      
      We also fix some wrong uses of feedback_fn.
      
      Reviewed-by: imsnah
      86d9d3bb
  12. 20 Oct, 2008 6 commits
    • Alexander Schreiber's avatar
      Set default hypervisor at cluster init · 02691904
      Alexander Schreiber authored
      During cluster init, set the default hypervisor to be used for instances.
      Ensure that the default hypervisor belongs to the set enabled hypervisors
      for this cluster. Also fix a small bug with setting the default enabled
      hypervisor list.
      
      Reviewed-by: imsnah
      
      02691904
    • Guido Trotter's avatar
      Use constants.VALUE_AUTO for ip comparison too · 6fde8221
      Guido Trotter authored
      Forward-port-of: r1889, Reviewed-by: imsnah
      
      Reviewed-by: imsnah
      6fde8221
    • Guido Trotter's avatar
      LUCreateInstance: reuse mac address on import · bc89efc3
      Guido Trotter authored
      When importing an instance with the same name as the exported one if the
      mac address is "auto" we try to reuse the previous mac address. One can
      still force generation of a new one with mac="generate".
      
      Forward-port-of: r1887, Reviewed-by: iustinp
      
      Reviewed-by: imsnah
      bc89efc3
    • Guido Trotter's avatar
      LUCreateInstance: accept mac = VALUE_GENERATE · c78995f0
      Guido Trotter authored
      VALUE_GENERATE is handled exactly the same as VALUE_AUTO and the mac
      address is generated randomly.
      
      Forward-port-of: r1886, Reviewed-by: iustinp
      
      Reviewed-by: imsnah
      c78995f0
    • Iustin Pop's avatar
      Convert cmdlib.py to use the logging module · 9a4f63d1
      Iustin Pop authored
      Note that many uses of logger.Error were used in 1.2 for their
      side-effect of logging to stderr, where the user will see the messages,
      and not for having the entry in the log. As such, we need to go over and
      review every use of logging.* and decide if it should use feedback_fn
      instead of being a logging call.
      
      Reviewed-by: imsnah
      9a4f63d1
    • Iustin Pop's avatar
      Fix gnt-instance modify with beparams · 61be6ba4
      Iustin Pop authored
      The gnt-instance modify didn't work correctly w.r.t the be parameters.
      There was also a typo in the corresponding LU.
      
      Reviewed-by: imsnah
      61be6ba4
  13. 17 Oct, 2008 1 commit
  14. 16 Oct, 2008 2 commits
    • Iustin Pop's avatar
      Enable gnt-cluster modify to hv/beparams · 779c15bb
      Iustin Pop authored
      This patch enables the cluster modify to change:
        - enabled hypervisor list
        - hvparams (per hypervisor)
        - beparams (only the default group)
      
      Syntax:
        gnt-cluster modify -B vcpus=3 -H xen-pvm:no_initrd_path
      
      Validation for parameters is somewhat missing - the individual
      hypervisors will be checked for syntax and validation, but beparams
      doesn't have validation yes (nowhere), it should be added here once we
      have a global method (will come soon).
      
      Reviewed-by: imsnah
      779c15bb
    • Iustin Pop's avatar
      Show the cluster parametrs in gnt-cluster info · 469f88e1
      Iustin Pop authored
      This is just a raw update without any special formatting.
      
      Reviewed-by: imsnah
      469f88e1