1. 10 Feb, 2009 1 commit
  2. 09 Feb, 2009 8 commits
    • Guido Trotter's avatar
      KVM: Add usb mouse type parameter · 11344a50
      Guido Trotter authored
      In some cases 'mouse' may work better than 'tablet', so we'll handle
      both by allowing the user to specify a parameter. By default no mouse is
      used.
      
      Reviewed-by: iustinp
      11344a50
    • Guido Trotter's avatar
      KVM: allow netboot · 8745c3d7
      Guido Trotter authored
      With this patch we allow KVM instances to be booted off the network.
      The only issue is that this is not compatible with virtio nics, so
      we disallow them, when booting from the net.
      
      Reviewed-by: iustinp
      8745c3d7
    • Guido Trotter's avatar
      KVM: actually support different nic types · 37f88dc6
      Guido Trotter authored
      When executing the KVM runtime we load the nic type from the runtime
      hvparams and use it to specify the nic model type. As for the disk we
      translate the DEV_PARAVIRTUAL type to 'virtio'.
      
      Reviewed-by: iustinp
      37f88dc6
    • Guido Trotter's avatar
      KVM: export hvparams in the runtime · c2672466
      Guido Trotter authored
      They'll be used to set the nic type when we execute the runtime, since
      the nics are processed later. We need to save the hvparams because we
      want to use the same one as when we saved the runtime, rather than use
      the current instance ones, to avoid applying only some changed
      parameters when the runtime is loaded.
      
      Reviewed-by: iustinp
      c2672466
    • Guido Trotter's avatar
      KVM: actually support different disk types · 1213604d
      Guido Trotter authored
      By passing the relevant if= value to the disk we support different disk
      types. The only change is that we'll translate "paravirtual" to
      "virtio" to keep only one "paravirtualized" value, around ganeti. The
      if= value is calculated outside the disks loop, as it's the same for all
      disks (as currently ganeti doesn't support per-disk params).
      
      Reviewed-by: iustinp
      1213604d
    • Guido Trotter's avatar
      KVM: parameters for different disk and nic types · 43440815
      Guido Trotter authored
      - Add a bunch of NICs and DISKs types
      - Specify which one are valid disks and nics for KVM (the new ones
        toghether with some of the old ones)
      - Add the default values (paravirtual)
      - Allow the disk and nic types as parameters and check their validity
      
      Reviewed-by: iustinp
      43440815
    • Guido Trotter's avatar
      s/HT_HVM_VNC_BASE_PORT/VNC_BASE_PORT/g · 377d74c9
      Guido Trotter authored
      The VNC base port has nothing to do with HVM itself, and is general to
      VNC itself, so we're removing the HT_HVM prefix to the constant.
      
      Reviewed-by: iustinp
      377d74c9
    • Iustin Pop's avatar
      Export the cpu nodes and sockets from Xen · 0105bad3
      Iustin Pop authored
      This is a hand-picked forward patch of commit 1755 on the 1.2 branch
      (hand-picked since the trees diverged too much since then):
      
          The patch changed the xen hypervisor to compute the number of cpu
          sockets/nodes and enables the command line and the RAPI to show this
          information (for RAPI is enabled by default in node details, for gnt-one
          one can use the new “cnodes” and “csockets” fields).
      
          Originally-Reviewed-by: ultrotter
      
      For the KVM and fake hypervisors, the patch just exports 1 for both
      nodes and sockets. This can be fixed, by looking at the
      /sys/devices/system/cpu/cpuN/topology directories, and computing the
      actual information, but that should be done in a separate patch.
      
      Reviewed-by: imsnah
      0105bad3
  3. 07 Feb, 2009 3 commits
  4. 05 Feb, 2009 2 commits
    • Guido Trotter's avatar
      KVM: add VNC TLS and X509 parameters · 8b2d1013
      Guido Trotter authored
      With this parameters VNC for KVM is able to be protected by tls,
      optionally with an x509 certificate, and optionally verifying the
      client as well. Additionally in this patch we limit the bind address to
      being a directory, rather than a file or a directory, for simplicity, as
      it allows for the same level of control anyway.
      
      Reviewed-by: iustinp
      8b2d1013
    • Guido Trotter's avatar
      KVM: allow binding vnc to a file · 8447f52b
      Guido Trotter authored
      Before we forced the VNC_BIND_ADDRESS to be an ip. Now we also accept a
      path, and bind the instance to it, or to a file in it if it's a
      directory.
      
      Reviewed-by: iustinp
      8447f52b
  5. 03 Feb, 2009 1 commit
    • Guido Trotter's avatar
      KVM: Make GetAllInstancesInfo concurrency-safe · 00ad5362
      Guido Trotter authored
      Or actually more so. If this function gets called while instances get
      shut down, it might try to report information on instances which don't
      exits. Try to fail gracefully if that happens, by just skipping an
      instance which has disappeared in the meantime.
      
      Reviewed-by: iustinp
      00ad5362
  6. 29 Jan, 2009 6 commits
  7. 28 Jan, 2009 1 commit
  8. 27 Jan, 2009 3 commits
    • Guido Trotter's avatar
      KVM and Xen: add the HV_ROOT_PATH parameter · 074ca009
      Guido Trotter authored
      This parameter allows a different path to be passed to the instance
      kernel. The new parameter is mandatory, and by default has the value of
      the old hardcoded value for both kvm and xen.
      
      Beta1 clusters will need to have this parameter added for their
      instances to be able to boot.
      
      Reviewed-by: iustinp
      074ca009
    • Guido Trotter's avatar
      KVM: implement GetShellCommandForConsole · 637ce7f9
      Guido Trotter authored
      This is a class method, because it calls _InstanceSerial, which is
      another class method. The patch changes it to classmethod for all the
      hypervisor classes.
      
      Reviewed-by: iustinp
      637ce7f9
    • Guido Trotter's avatar
      KVM: classify _Instance{Monitor,Serial,KVMRuntime} · 0df4d98a
      Guido Trotter authored
      Those methods need nothing from the instantiated class, and just
      manipulate strings, and fetch some class global variables, so they can
      be classmethods.
      
      Reviewed-by: iustinp
      0df4d98a
  9. 23 Jan, 2009 1 commit
  10. 21 Jan, 2009 8 commits
    • Guido Trotter's avatar
      KVM live migration: handle failure · c087266c
      Guido Trotter authored
      If the KVM live migration ends up in a 'failed' state it has been
      aborted at the kvm level, and the machine is still running locally.
      We support also the 'cancelled' state even though there should be no way
      of reaching it, without manual intervention.
      
      Reviewed-by: iustinp
      c087266c
    • Guido Trotter's avatar
      KVM: change a few IOError with EnvironmentError · 90c024f6
      Guido Trotter authored
      Reviewed-by: iustinp
      90c024f6
    • Guido Trotter's avatar
      KVM: instance migration · 30e42c4e
      Guido Trotter authored
      The tcp port used for migrating KVM instances is selectable at
      ./configure time. We use a single port as nodes are locked anyway during
      a migration, so no two migrations can happen at the same time to the
      same node.
      
      Reviewed-by: iustinp
      30e42c4e
    • Guido Trotter's avatar
      KVM: add the _InstancePidAlive function · 1f8b3a27
      Guido Trotter authored
      Throughout the kvm code we very often look for the instance pidfile
      name, read it, and check if the process is alive. Abstract this into a
      private function and use that one instead.
      
      This patch also changes RebootInstance to check whether the instance is
      alive before trying to reboot it.
      
      Reviewed-by: iustinp
      1f8b3a27
    • Guido Trotter's avatar
      KVM: fix RebootInstance · f02881e0
      Guido Trotter authored
      RebootInstance was broken, because it just used to call StartInstance
      with wrong parameters. With this patch we still stop the instance, but
      use the saved kvm runtime to start it again.
      
      Reviewed-by: iustinp
      f02881e0
    • Guido Trotter's avatar
      KVM: retry the instance shutdown command · 6567aff3
      Guido Trotter authored
      When we ask the instance to shutdown sometimes the command won't work,
      especially if the instance isn't fully booted up. We'll wait for a bit,
      and give it a few chances before giving up.
      
      Reviewed-by: iustinp
      6567aff3
    • Guido Trotter's avatar
      KVM: save and remove the KVM runtime · 38e250ba
      Guido Trotter authored
      At instance startup time we save the kvm runtime, and at stop time we
      delete it. This patch also includes a function to load the kvm runtime,
      which is unused yet.
      
      Reviewed-by: iustinp
      38e250ba
    • Guido Trotter's avatar
      KVM: split KVM runtime generation and startup · ee5f20b0
      Guido Trotter authored
      Before we used to generate the kvm command line and then just run it.
      With this patch we split the generation from the time it is run,
      allowing us to save it and replay it at reboot.
      
      We must take special care about instance nics:
        - We can't include them in the saved command line, as they point to
          temporary files
        - We can't just generate them at exec time, because we would apply
          those changes, but not all the other ones, to a running instance,
          thus making it inconsistent (for example if an instance had a memory
          increased and one more nic, in a soft reboot we would add the nic, but
          not the memory)
      So we'll just save the instance nic data at the time the kvm runtime
      data is generated, and transform it into actual parameters at execution
      time.
      
      Reviewed-by: iustinp
      ee5f20b0
  11. 20 Jan, 2009 3 commits
    • Guido Trotter's avatar
      KVM: add a _CONF_DIR · a1d79fc6
      Guido Trotter authored
      Currently we keep pid files and control files. In the conf dir we'll
      also keep the data to start the instance anew, and the network
      interface scripts. These will then be copied to a separate area (since
      _CONF_DIR could be mounted 'noexec') and used to start the instance.
      
      This patch also adds comments to state what the various directories are
      used for.
      
      Reviewed-by: iustinp
      a1d79fc6
    • Guido Trotter's avatar
      KVM: Remove sockets after shutdown · c4fbefc8
      Guido Trotter authored
      Abstract the monitor and serial socket naming in two functions, and
      reuse them to cleanup the files after shutdown.
      
      Reviewed-by: iustinp
      c4fbefc8
    • Guido Trotter's avatar
      KVM: fix class docstring · c4469f75
      Guido Trotter authored
      Reviewed-by: iustinp
      c4469f75
  12. 07 Jan, 2009 1 commit
    • Iustin Pop's avatar
      Simplify hypervisor block_devices structure · 069cfbf1
      Iustin Pop authored
      This is a partial forward-port of commit 1136 on the 1.2 branch:
      
        The hypervisor doesn't need to be passed the whole block device
        structure, so we'll just give it the block device name on the local
        node, and the name as seen by the instance. This will make it easier to
        manipulate it later without messing with the block devices (eg. by
        changing the system name to a symlink to the name itself).
      
        Since the HVM hypervisor changes the "virtual" name a note is added
        calling for a redesign that doesn't need this change, as different
        hypervisors and emulation types will anyway have different names for
        exported devices.
      
        Reviewed-by: iustinp
      
      The changes in this patch compared to the original are:
        - we keep passing the original disk object, not for its iv_name, but
          for it's physical_id which is needed by the file driver (this could
          be fixed maybe)
        - we don't use the iv_name anymore, since in 2.0 we already use the
          index of the device
      
      Original-Author: ultrotter
      069cfbf1
  13. 16 Dec, 2008 1 commit
    • Guido Trotter's avatar
      KVM: improve socat interface · 14aa53cb
      Guido Trotter authored
      Call socat with a full path specified at configure time, rather than
      just by its name, and check for the binary to exist at hypervisor
      verify.
      
      Reviewed-by: iustinp
      14aa53cb
  14. 14 Dec, 2008 1 commit