Statistics
| Branch: | Tag: | Revision:

root / lib / hypervisor @ 84a12e40

# Date Author Comment
e3ed5316 07/16/2010 12:48 pm Balazs Lecz

LXC: Add cpu_mask hypervisor parameter

Also implement syntax checking.

Signed-off-by: Balazs Lecz <>
Reviewed-by: Iustin Pop <>

e71b9ef4 07/16/2010 10:46 am Iustin Pop

Add a migration type global hypervisor parameter

Since migration live/non-live is more stable (e.g.) for Xen-PVM versus
Xen-HVM, we introduce a new parameter for what mode we should use by
default (if not overridden by the user, in the opcode).

The meaning of the opcode 'live' field changes from boolean to either...

748e4b5a 07/15/2010 05:38 pm Michael Hanselmann

KVM hypervisor: Use utils.ShellWriter for network script

This patch converts hv_kvm to use utils.ShellWriter for writing
the network script. It also adds a few unittests (the first
for any hypervisor modules).

Signed-off-by: Michael Hanselmann <>...

13c564e7 07/09/2010 06:17 pm Balazs Lecz

LXC: Create per-instance log files

This replaces the single global log file with per-instance logs.
The instance log file is not truncated when the instance is started.

Signed-off-by: Balazs Lecz <>
Reviewed-by: Iustin Pop <>

c83864fe 07/09/2010 06:17 pm Balazs Lecz

LXC: Fix wording of error messages

Signed-off-by: Balazs Lecz <>
Reviewed-by: Iustin Pop <>

b8aa46ed 07/09/2010 06:17 pm Balazs Lecz

LXC: Fix GetInstanceInfo()

Don't try to get cgroups info if instance is not running.

Signed-off-by: Balazs Lecz <>
Reviewed-by: Iustin Pop <>

a744b676 07/09/2010 04:37 pm Manuel Franceschini

Introduce lib/netutils.py

This patch moves network utility functions to a dedicated module.

Signed-off-by: Manuel Franceschini <>
Reviewed-by: Iustin Pop <>

63cef6c3 07/08/2010 06:57 pm Balazs Lecz

LXC: Fix GetAllInstancesInfo()

Signed-off-by: Balazs Lecz <>
Reviewed-by: Iustin Pop <>

c4d3e57f 07/07/2010 09:07 pm Balazs Lecz

LXC: Report actual number of CPUs

Signed-off-by: Balazs Lecz <>
Reviewed-by: Iustin Pop <>

637c8ab8 07/07/2010 04:36 pm Balazs Lecz

LXC: add lxc.console to the generated lxc.conf file

Signed-off-by: Balazs Lecz <>
Reviewed-by: Iustin Pop <>

d01baf53 07/07/2010 04:36 pm Balazs Lecz

LXC: Use lxc-info to get instance info

Signed-off-by: Balazs Lecz <>
Reviewed-by: Iustin Pop <>

a188f1ef 07/06/2010 05:10 pm Balazs Lecz

LXC: use utils.GetMounts()

Signed-off-by: Balazs Lecz <>
Reviewed-by: Iustin Pop <>

e8cd390d 07/06/2010 05:10 pm Balazs Lecz

hv_chroot: use utils.GetMounts()

Signed-off-by: Balazs Lecz <>
Reviewed-by: Iustin Pop <>

4b5e40a5 06/30/2010 04:46 pm Iustin Pop

Barebones LXC hypervisor

This needs lots of work, but it can successfully launch an LXC-based
instance. See the docstring for the limitations/work to be done.

Signed-off-by: Iustin Pop <>
Reviewed-by: Balazs Lecz <>

c0c3fa27 06/30/2010 02:32 pm Manuel Franceschini

Introduce utils.IsValidIP{4,6}()

This patch introduces functions to check for valid IPv4 and IPv6
addresses and converts IsValidIP() to return True if it is either a IPv4
or a IPv6 address.

For now we do not change the functional behavior and replace IsValidIP...

14f5f1b6 06/30/2010 01:42 pm Manuel Franceschini

Replace '0.0.0.0' with constant

Signed-off-by: Manuel Franceschini <>
Reviewed-by: Guido Trotter <>

6df291d4 06/10/2010 10:57 pm Iustin Pop

Move fake hypervisor run dir under ganeti

This makes it uniform with the other hypervisors.

Signed-off-by: Iustin Pop <>
Reviewed-by: Balazs Lecz <>

297e6e53 06/04/2010 04:22 pm Guido Trotter

_ExecuteKVMRuntime: fix hv parameter fun

When executing the kvm runtime we were currently accessing a mix of the
parameters as configured currently on the instance and the ones it was
started with. We were doing it without a precise criteria, but quite by...

fea922fa 06/04/2010 04:22 pm Guido Trotter

Update FinalizeMigration docstring

This is used not only for aborted migrations, so the docstring should
reflect that.

Signed-off-by: Guido Trotter <>
Reviewed-by: Iustin Pop <>

547a63b7 06/01/2010 08:18 pm Balazs Lecz

Add KVM chroot feature

This patch adds a new boolean hypervisor parameter to the KVM hypervisor,
named 'use_chroot'.
If it's turned on for an instance, than KVM is started in "chroot mode":
Ganeti creates an empty directory for the instance and passes the path...

e43d4f9f 05/31/2010 03:16 pm Apollon Oikonomopoulos

KVM: Migration bandwidth and downtime control

Introduce 2 new hypervisor options, migration_bandwidth and migration_downtime
and implement KVM migration bandwidth and downtime control.

migration_bandwidth controls KVM's maximal bandwidth during migration, in...

e0561198 05/27/2010 02:43 pm Iustin Pop

Fix two race conditions in reboot instance

If the instance crashes between backend.InstanceReboot checks the list
of running instances and the execution of hv_xen.RebootInstance,
ini_info will be None. And if the instance doesn't reboot fast enough,
new_info will be None. Both cases lead to “TypeError: unsubscriptable...

fbe27e2b 05/18/2010 02:08 pm Guido Trotter

KVM: vhost net acceleration support

This will only work on patched or newer (>= 2.6.34) kernels and with a
patched version of qemu-kvm.

Signed-off-by: Guido Trotter <>
Reviewed-by: Iustin Pop <>

682f7601 05/12/2010 02:10 pm Guido Trotter

Convert some ReadFile calls to ReadOneLineFile

For passwords we require strict oneliners, we're a bit more lax with pid
and uid files.

Signed-off-by: Guido Trotter <>
Reviewed-by: Iustin Pop <>

036c7f68 05/07/2010 05:25 pm Guido Trotter

Merge branch 'stable-2.1' into devel-2.1

  • stable-2.1:
    Bump version for 2.1.2.1 release
    Update NEWS for Ganeti 2.1.2.1
    KVM: only export instance tags if present

Signed-off-by: Guido Trotter <>
Reviewed-by: Iustin Pop <>

1cc831ea 05/07/2010 04:14 pm Guido Trotter

KVM: only export instance tags if present

Currently non-tagged instances fail starting with a TypeError.

Signed-off-by: Guido Trotter <>
Reviewed-by: Iustin Pop <>
Reviewed-by: Balazs Lecz <>

98c98ab9 05/07/2010 02:34 pm Guido Trotter

Hypervisors: use utils.EnsureDirs

Swap a few os.mkdir calls with utils.EnsureDirs

Signed-off-by: Guido Trotter <>
Reviewed-by: Balazs Lecz <>

87e510fd 04/28/2010 02:57 pm Apollon Oikonomopoulos

KVM: make tags available in KVM_NET_SCRIPT

Make instance tags available as a space-separated list during the execution of
the network setup script. This allows tag-based control of things like firewall
rules and/or networking setup.

Signed-off-by: Guido Trotter <>...

14b3f969 04/22/2010 02:32 pm Iustin Pop

Fix broken commit 9e302a8

Commit 9e302a8 split the StopInstance function in two without properly
duplicating the local variables.

Signed-off-by: Iustin Pop <>
Reviewed-by: René Nussbaumer <>

9e302a8c 04/21/2010 08:22 pm Iustin Pop

hv_chroot: move unmount to CleanupInstance()

This allows cleanup to be done properly if the "instance" wasn't running
at all (based on the CleanupInstance framework, instead of the retry in
hypervisor).

Signed-off-by: Iustin Pop <>
Reviewed-by: Guido Trotter <>

d271c6fd 04/21/2010 08:22 pm Iustin Pop

Add a hypervisor constant for migration support

This variable can be used by other tools to determine in a generic way
whether a given hypervisor supports migration or not.

Signed-off-by: Iustin Pop <>
Reviewed-by: Michael Hanselmann <>

74a4c11b 04/21/2010 08:01 pm Guido Trotter

Fix indentation error

Commit 9cf4321fc39ec36359d9c90b22b36d33b6adc2f4 indented some lines by
4 spaces rather than 2, and was git-amed without noticing. Fixing.

Signed-off-by: Guido Trotter <>
Reviewed-by: Iustin Pop <>

5b062a58 04/21/2010 05:48 pm Apollon Oikonomopoulos

Add -usbdevice tablet to KVM when using vnc

When using VNC, it is recommended to use a tablet-style
input device instead of a mouse. This allows most VNC viewers
to send proper mouse coordinates to the virtual machine's desktop
resulting in perfectly aligned guest and host mouse pointers....

9cf4321f 04/21/2010 05:48 pm Apollon Oikonomopoulos

Only use boot=on on non-ide disks only (KVM)

boot=on implies that KVM boots using extboot. This is only required
to boot non-IDE disks and has the side-effect that there is at most
one bootable device. This behaviour breaks some operating systems,
most notably the windows installer that tries to chainload the hard-disk...

aa0b600b 04/21/2010 05:48 pm Guido Trotter

KVM: fix a bug in _TryReadUidFile

If the uid pool is not in use _TryReadUidFile will try to return "uid"
even if it hasn't tried to read it at all.

Signed-off-by: Guido Trotter <>
Reviewed-by: Iustin Pop <>

76431533 04/20/2010 06:45 pm Guido Trotter

KVM: implement the HT_SM_POOL security model

In order not to complicate to much the _ExecuteKVMRuntime function with
nested try/except/finally/else constructs we move the actual
runcmd+check call in a separate _RunKVMCmd function.

Signed-off-by: Guido Trotter <>...

7548396c 04/20/2010 06:45 pm Guido Trotter

KVM: add an instance uid file concept

If this file exists, for an instance, we release the uid contained
inside back to the uid pool, at instance shutdown.

Signed-off-by: Guido Trotter <>
Reviewed-by: Iustin Pop <>

8904b35c 04/20/2010 06:45 pm Guido Trotter

KVM: move post-shutdown cleanup operations

Currently putting the cleanup just after the actual shutdown ensures
that it never gets called, due to how the retry/shutdown cycle works.
So we move those cleanups to their new dedicated place.

Signed-off-by: Guido Trotter <>...

f28ec899 04/20/2010 01:24 pm Guido Trotter

Add CleanupInstance hypervisor call

Currently some hypervisors (namely kvm) need to do some cleanup after
making sure an instance is stopped. With the moving of the retry cycle
in backend those cleanups were never done. In order to solve this we add
a new optional hypervisor function, CleanupInstance, which gets called...

7ba594c0 03/31/2010 06:51 pm Guido Trotter

kvm_flag hypervisor parameter

Signed-off-by: Guido Trotter <>
Reviewed-by: Iustin Pop <>

cef34868 03/31/2010 05:59 pm Guido Trotter

Move the runas user at execution time

Everything still works the same way, but the user is calculated each
time we start kvm, rather than stored in the config file. This makes it
easier to implement the "pool" security model.

Signed-off-by: Guido Trotter <>...

bbcf7ad0 03/23/2010 12:21 pm Iustin Pop

Extend the hypervisor API with name-only shutdown

Currently the ShutdownInstance method of the hypervisors takes a full
instance object. However, when doing instance shutdowns from the node
only, we don't have a full object, just the name.

To handle this use case, we add a new ‘name’ argument to the method,...

3a488770 03/23/2010 10:35 am Iustin Pop

Some epydoc fixes

Signed-off-by: Iustin Pop <>
Reviewed-by: Guido Trotter <>

263b8de6 03/22/2010 08:06 pm Guido Trotter

KVM: Check instances for actual liveness

Currently if we find a live process with the pid we saved we assume kvm
is alive. What could happen, though, is that the pidfile has been
reused.

In order to avoid that we change the check to make sure, everywhere,...

4fbb3c60 03/22/2010 08:06 pm Guido Trotter

KVM: improve GetInstanceInfo docstring

Signed-off-by: Guido Trotter <>
Reviewed-by: Iustin Pop <>

1feb39ec 03/11/2010 01:16 pm Guido Trotter

KVM: remove unused variable

We don't need the pwentry when checking if a username exists, just to be
sure the KeyError is not returned. Remove the variable, and thus shut up
lint.

Signed-off-by: Guido Trotter <>
Reviewed-by: Iustin Pop <>

d19d94db 03/10/2010 08:07 pm Guido Trotter

KVM: add security model and domain parameters

Initially we only support the "user" model (in which the user running
the virtual machine can be specified as an additional parameter).

We use usernames rather than uids in this mode, because the kvm -runas
flag doesn't support uids anyway, and we check the passed username for...

84e0863d 03/10/2010 02:09 pm Guido Trotter

KVM: Remove boot restriction for paravirtual nics

Newer virtio can boot from the network perfectly well, so there's no
point in keeping this restriction in place. This will still fail on
older kernels.

Signed-off-by: Guido Trotter <>...

c6a39fc2 03/10/2010 02:09 pm Guido Trotter

KVM: pass the instance name as the first kvm flag

This makes it the first argument show, for example under "ps".

Signed-off-by: Guido Trotter <>
Reviewed-by: Iustin Pop <>

760570a8 03/08/2010 05:50 pm Timothy Kuhlman

KVM: Fix unintended qemu-level bridging of nics

Each nic should be connected to its own qemu vlan, to avoid them all
bridging together.

Signed-off-by: Timothy Kuhlman <>
Reviewed-by: Guido Trotter <>
Signed-off-by: Guido Trotter <>...

30786fc9 03/08/2010 03:52 pm Iustin Pop

hv_kvm: remove hard-coded path constructs

This switches hv_kvm to PathJoin. There are still a few cases of direct
path construction, but those should be safe.

Signed-off-by: Iustin Pop <>
Reviewed-by: Michael Hanselmann <>

3b80eb2c 03/08/2010 03:51 pm Iustin Pop

hv_fake: remove hard-coded path constructs

This changes to hv_fake to PathJoin.

Signed-off-by: Iustin Pop <>
Reviewed-by: Michael Hanselmann <>

6b0391b3 03/08/2010 03:51 pm Iustin Pop

hv_chroot: remove hard-coded path constructs

This patch abstract the computation of an instance's root directory into
a separate function (that uses PathJoin instead of "%s/%s").

Signed-off-by: Iustin Pop <>
Reviewed-by: Michael Hanselmann <>

c4feafe8 03/08/2010 03:48 pm Iustin Pop

Switch from os.path.join to utils.PathJoin

This passes a full burnin with lots of instances, and should be safe as
we mostly to join a known root (various constants) to a run-time
variable.

Signed-off-by: Iustin Pop <>
Reviewed-by: Michael Hanselmann <>

e8022bef 03/02/2010 05:56 pm Vitaly Kuznetsov

Avoid absolute path for privileged commands

Using absolute path for a privileged command is a bad idea as this path may vary.
For example /usr/sbin/brctl in Debian and /sbin/brctl in ALTLinux. Using $PATH is
a better idea.

Signed-off-by: Vitaly Kuznetsov <>...

9f53d9ce 02/01/2010 02:55 pm Michael Hanselmann

Merge remote branch 'origin/stable-2.1' into devel-2.1

  • origin/stable-2.1:
    Bump version to 2.1.0~rc5
    Fix missing bridge for xen instances
    Fix flipping MC flag bug
    ganeti-watcher: ensure confd is running as well
0183a697 01/29/2010 01:58 pm Alessandro Cincaglini

Fix missing bridge for xen instances

Xen instances nic definitions miss the target bridge.

This bug was introduced in commit 503b97a9.

Signed-off-by: Alessandro Cincaglini <>
Reviewed-by: Iustin Pop <>
Reviewed-by: Guido Trotter <>...

4c1a504b 01/26/2010 02:58 pm Iustin Pop

Merge branch 'devel-2.0' into devel-2.1

  • devel-2.0:
    Fix the mocks.py for 2.0 unittests
    LURemoveNode safety in face of wrong node list
    Fix an unsafe formatting bug
    Ensure all int/float conversions are handled right

Conflicts:
lib/backend.py - trivial merge...

691744c4 01/25/2010 06:16 pm Iustin Pop

Ensure all int/float conversions are handled right

int()/float() can raise either ValueError (in case of int("a")), or
TypeError (in case of int(None)). We had many bugs over time due to
this, and a recent one was just diagnosed, so we go over the codebase...

e4dd2299 01/22/2010 03:45 pm Guido Trotter

KVM: fix pylint warning

Specify string format arguments as logging function parameters

Signed-off-by: Guido Trotter <>

c4e388a5 01/22/2010 03:05 pm Guido Trotter

KVM: be more resilient on broken migration answers

Before, when doing kvm live migrations we use to accept an "unknown
status" but to reject anything that didn't match our regexp. Since we've
seen "info migrate" return a completely empty answer, we'll be more...

30e4e741 01/04/2010 11:20 am Iustin Pop

Fix unused imports or add silences where needed

In some cases pylint doesn't parse the import correctly, so we add
silences; but there are also many cases of unused imports, which we
simply remove.

Signed-off-by: Iustin Pop <>
Reviewed-by: Olivier Tharan <>

7ed85ffe 01/04/2010 11:16 am Iustin Pop

hv_xen/_GetConfigFileDiskData: remove unused arg

The disk template is not needed, all that's used is the disk data. As
such, remove this parameter from the function.

Signed-off-by: Iustin Pop <>
Reviewed-by: Olivier Tharan <>

7260cfbe 01/04/2010 11:15 am Iustin Pop

Add targeted pylint disables

This patch should have only:

- pylint disables
- docstring changes
- whitespace changes

Signed-off-by: Iustin Pop <>
Reviewed-by: Olivier Tharan <>

94fed7da 01/04/2010 11:15 am Iustin Pop

Implement all hv functions in hv_chroot/hv_fake

The chroot and fake hypervisors were missing:

- the powercycle node functionality
- proper handling of migration requests

The powercycle was just used as in the other hypervisors (use the
standard linux powercycle). The migration for chroot was disabled...

5905901c 01/04/2010 11:11 am Iustin Pop

KVM: Abstract/rework instance up checks

This patch abstract the check "is instance stopped" into a separate
function, and thus simplifies a couple of higher-level functions. It
also moves from manual read of the pidfile to use the (correct
abstraction of) _InstancePidAlive....

98ec75d6 01/04/2010 11:10 am Iustin Pop

KVM: Split out the pidfile computation

In some cases we only need the pidfile, but not the pid or the alive
status.

Signed-off-by: Iustin Pop <>
Reviewed-by: Olivier Tharan <>

1122eb25 01/04/2010 11:10 am Iustin Pop

Remove many 'Unused variable' warnings

Note there are some cases left which need extra cleanup.

Signed-off-by: Iustin Pop <>
Reviewed-by: Olivier Tharan <>

07b8a2b5 01/04/2010 10:42 am Iustin Pop

Fix use of the logging functions

The logging functions expand the arguments themselves, thus it's safer
to let them do it rather than manual string formatting.

Also re-wraps one comment.

Signed-off-by: Iustin Pop <>
Reviewed-by: Olivier Tharan <>

d984846d 12/28/2009 02:05 pm Iustin Pop

Merge branch 'devel-2.0' into devel-2.1

  • devel-2.0:
    Fix indentation in hv_kvm
    Implement BuildHooksEnv for NoHooksLU
    Clarifiy some more wide pylint disables
    Fix two bugs in seldom-used codepaths
    Update pylintrc
    Add targetted pylint disables
    Partial cherry-pick of 6c881c5 from the 2.1 branch...
4c4b5058 12/28/2009 12:43 pm Iustin Pop

Fix two bugs in seldom-used codepaths

New version of pylint, new bugs found!

Signed-off-by: Iustin Pop <>
Reviewed-by: Olivier Tharan <>

146afafb 12/28/2009 12:43 pm Iustin Pop

Fix indentation in hv_kvm

Per pylint warnings.

Signed-off-by: Iustin Pop <>
Reviewed-by: Olivier Tharan <>

19572932 12/10/2009 04:45 pm Iustin Pop

Add disk cache control parameter for KVM

This patch adds the 'cache' parameter for KVM; currently this is only
customisable at the hypervisor level, so it's the same for all drives
(except any CDROM image, which gets the default).

Signed-off-by: Iustin Pop <>...

94c2ed34 11/26/2009 07:28 pm Guido Trotter

KVM: fail when a routed nic has no ip

This shouldn't happen, but if it does it's better to fail at this level,
rather than create a broken NIC script, which is hard to debug.

Signed-off-by: Guido Trotter <>
Reviewed-by: Iustin Pop <>

ab3e6da8 11/25/2009 01:45 pm Iustin Pop

Revert "Get rid of utils.CommaJoin"

This reverts commit 6915bc28fe053e92aa16cf2d974d205f1140219c based on thread on
ganeti-devel.

Conflicts:

lib/cmdlib.py (due to the error code classification, trivial)

Signed-off-by: Iustin Pop <>
Reviewed-by: Michael Hanselmann <>

9044275a 11/13/2009 05:59 pm Michael Hanselmann

Fix epydoc error

Signed-off-by: Michael Hanselmann <>
Reviewed-by: Guido Trotter <>

fe5b0c42 11/11/2009 03:30 pm Michael Hanselmann

Fix and simplify socat escape detection

- Program paths should not be --with-… options (see
Autoconf docs)
- Simplify checks for escape functionality
- Make SOCAT_USE_ESCAPE variable a bool

Signed-off-by: Michael Hanselmann <>
Reviewed-by: Guido Trotter <>

88df4f39 11/10/2009 04:59 pm Guido Trotter

KVMHypervisor: fix broken error format string

Signed-off-by: Guido Trotter <>
Reviewed-by: Iustin Pop <>

6b970cef 11/06/2009 02:06 pm Jun Futagawa

Add use_localtime parameter for xen-hvm and kvm

Currently xen-hvm and kvm use different real time clock by default. To
reduce confusion, this patch adds an optional use_localtime parameter.

If the real time clock on the instance is set to local time, the...

86d6bc2a 11/05/2009 03:22 pm Guido Trotter

kvm console: use socat raw mode with escape

If this is enabled at configure time, we pass in different parameters to
the socat console, making it a lot more manageable.

Signed-off-by: Guido Trotter <>
Reviewed-by: Iustin Pop <>

50716be0 11/04/2009 05:35 pm Iustin Pop

Migration: add check for listening target

This patch adds a check for listening on the remote port in Xen and KVM
migrations. This will be generating a single “load of migration failed”
message for KVM, but otherwise not prevent the migration. For Xen (which...

641ae041 11/04/2009 05:35 pm Iustin Pop

hypervisors: switch to using HV_MIGRATION_PORT

This changes KVM to use HV_MIGRATION_PORT instead of KVM_MIGRATION_PORT
and enables passing the port for Xen migrations.

Since KVM_MIGRATION_PORT is not used anymore, we stop exporting it from
constants.py....

78411c60 11/04/2009 05:34 pm Iustin Pop

Introduce HV_MIGRATION_PORT hypervisor parameter

This parameter will replace the direct use of KVM_MIGRATION_PORT and the
implicit use of the Xen migration port.

While it doesn't make sense to change this at instance level, we don't
have any other infrastructure for cluster-wide hypervisor parameters, so...

58d38b02 11/04/2009 05:34 pm Iustin Pop

hypervisors: change MigrateInstance API

Currently the $hypervisor.MigrateInstance takes the instance name. This
patch changes it to take the instance object, such that other instance
properties (especially hvparams) are available to it.

Signed-off-by: Iustin Pop <>...

1b48f7af 11/03/2009 03:42 pm Iustin Pop

Revert "kvm console: use socat raw mode with escape"

This reverts commit ce0eb6694e3fb2510035501539c7acc92a0f174e, since it depends
on 37fc2cf5ba8919cef407199ee540aad4b1a9a2b6 which will be reverted too.

Signed-off-by: Iustin Pop <>
Reviewed-by: Michael Hanselmann <>

ce0eb669 11/03/2009 03:14 pm Guido Trotter

kvm console: use socat raw mode with escape

If this is enabled at configure time, we pass in different parameters to
the socat console, making it a lot more manageable.

Signed-off-by: Guido Trotter <>
Reviewed-by: Iustin Pop <>

06b78e8b 11/03/2009 12:51 pm Michael Hanselmann

hv_xen: Convert to utils.Retry

Signed-off-by: Michael Hanselmann <>
Reviewed-by: Iustin Pop <>

8866ec86 10/22/2009 06:15 pm Guido Trotter

KVM netscript: add static routes, with no suffix

The /32 suffix is useless, since the kernel already assumes single-host,
if no suffix is specified. Moreover we prefer these routes to be
"static" so that routing daemons, if present, won't mess with them....

2c5afffb 10/22/2009 04:40 pm Guido Trotter

KVMHypervisor: implement instance policy routing

Until now we relied on traffic from instances being policy routed via a
rule based on the instance network. With this change we can enforce it
on the instance interfaces. Since the ip rules survive interface...

e014f1d0 10/22/2009 04:40 pm Guido Trotter

KVMHypervisor: configure v6 parameters on nic

In routing mode we are tweaking a few parameters on the interface. With
this patch we'll tweak both the v4 and v6 ones.

Signed-off-by: Guido Trotter <>
Reviewed-by: Michael Hanselmann <>

0cf11e68 10/22/2009 12:15 pm Iustin Pop

Xen: Ignore the retry argument in stop instance

Commit 4ad4511 changed the KVM hypervisor to send multiple shutdown
requests to the monitor, but it didn't change this for the Xen
hypervisor. We simply remove the return on retry model, since we do want
to send multiple shutdown signals for both Xen and KVM (even if the...

69b99987 10/12/2009 01:48 pm Michael Hanselmann

Code and docstring style fixes

Found using pylint and epydoc.

Signed-off-by: Michael Hanselmann <>
Reviewed-by: Guido Trotter <>

a2771c83 10/09/2009 06:02 pm Guido Trotter

ChrootManager: clean StopInstance

Currently it has lots for duplicated code, and internal retries.
Clean it up with the following assumptions:

We'll probably be called more than once.
It is ok to fail to stop, unless we're called with force=True.
If we're called only once, and with force=True it's ok not to run the...

4ad45119 10/09/2009 06:02 pm Guido Trotter

KVMHypervisor: use the StopInstance retry feature

Since we know StopInstance is going to be called more than once (at
least twice, once with force and once without, but normally quite a lot
more) we don't need our own sleep/loop, and we can just send one monitor...

07b49e41 10/09/2009 06:01 pm Guido Trotter

Hypervisors: Add retry= to StopInstance

Currently some hypervisors need the stop operations to be retried more
than once, while other ones only do it in one pass. With this change
we'll handle retries outside the hypervisor code, but telling whether
this is the first try or not....

6915bc28 10/09/2009 05:28 pm Guido Trotter

Get rid of utils.CommaJoin

- We never remember to use it (5 uses vs 21 " ,".join())
- It's longer to write than " ,".join()
- The added value of the apostrophe in the string is not very much

Signed-off-by: Guido Trotter <>
Reviewed-by: Michael Hanselmann <>

6e6bb8d5 10/06/2009 03:35 pm Guido Trotter

VNC password: move to hv param and use in kvm

Signed-off-by: Guido Trotter <>
Reviewed-by: Olivier Tharan <>

2f2dbb4b 10/05/2009 12:31 pm Jun Futagawa

Add support for using the bootloader in xen-pvm

This patch adds three optional parameters:
- 'use_bootloader', whether use or not the bootloader
- 'bootloader_path', absolute path to the bootloader
- 'bootloader_args', extra arguments to the bootloader...

d63218ce 09/24/2009 04:06 pm Guido Trotter

KVMHypervisor: wrap long line

Signed-off-by: Guido Trotter <>
Reviewed-by: Iustin Pop <>

0a3c881e 09/24/2009 01:04 pm Guido Trotter

KVM nic script: enable interface forwarding

If forwarding is enabled globally this is a no-op. If instead it's
enabled only for some special interfaces where instance traffic has to
go to/comes from (for example a gre tunnel) then it's useful to
explicitely enable it for the instances interfaces as well....