Statistics
| Branch: | Tag: | Revision:

root / lib / backend.py @ fd4daa3a

History | View | Annotate | Download (78 kB)

# Date Author Comment
e9ce0a64 01/29/2009 05:09 pm Iustin Pop

Implement software release version checks too

Currently the LUVerifyCluster only reports the protocol version changes,
not software ones. This is useful to know/monitor, so we add this too as
a warning.

Reviewed-by: ultrotter

ca77edbc 01/21/2009 08:23 pm Guido Trotter

ShutdownInstance: log instance name, not object

When an instance fails to shut down we currently log its whole object,
rather than just the instance name.

Reviewed-by: iustinp

c979d253 01/21/2009 04:12 pm Iustin Pop

Fix some more pylint errors

Two are real errors (invalid names) and one is style error (overriding
name from outer scope).

Reviewed-by: ultrotter

cd42d0ad 01/21/2009 12:03 pm Guido Trotter

Implement the new live migration backend functions

MigrationInfo, AcceptInstance and AbortMigration are implemented as
hypervisor specific functions, and by default they do nothing (as
they're not always necessary).

This patch also converts hv_base.MigrateInstance docstring to epydoc,...

6906a9d8 01/21/2009 11:54 am Guido Trotter

Add calls in the intra-node migration protocol

Currently the hypervisor is expected to do all the migration from the
source side. With this patch we also add the option of passing some
information to the target side, and starting some operation there.

As a bonus, a function to cleanup any started operation is included....

920aae98 01/20/2009 07:50 pm Guido Trotter

ShutdownInstance: report hypervisor error

When StopInstance raises an HypervisorError, report it in the logged
message to ease with debugging.

Reviewed-by: iustinp

96841384 01/20/2009 06:26 pm Iustin Pop

Convert RenameInstance to (status, data)

This allows the rename failures to show the ouput of OS scripts.

Reviewed-by: ultrotter

6d2e83d5 01/20/2009 04:20 pm Iustin Pop

Make cluster-verify check the drbd minors space

This patch adds support for verification of drbd minors space in cluster
verify: minors which belong to running instances and should be online
but are not, and minors which do not belong to any instace but are in...

20e01edd 01/20/2009 12:11 pm Iustin Pop

Convert AddOSToInstance to (status, data)

This allows the install and reinstall instance to return (hopefully)
relevant log files from the OS create scripts.

Reviewed-by: ultrotter

dd279568 01/20/2009 12:11 pm Iustin Pop

Convert the start instance rpc to (status, data)

This will record the failure cause in starting up the instance in the
job log (and thus to the user).

Reviewed-by: ultrotter

dab69e97 01/19/2009 01:10 pm Iustin Pop

Switch call_blockdev_create call to (status, data)

This allows errors to be visible at the user level instead of just node
daemon logs.

Reviewed-by: ultrotter

6c626518 01/19/2009 01:10 pm Iustin Pop

Block device creation cleanup

Currently when creation LVM-based instances, we always get the
extremely-confusing message "ERROR Can't find LV /dev/xenvg/..." which
is actually expected. This behaviour was introduced before we had
UUID-style LV names, since at that point it was not a unexpected to have...

53c776b5 01/13/2009 05:21 pm Iustin Pop

Forward port the live migration from 1.2 branch

This is forward port via copy (and not individual patches cherry-pick)
of the latest code on the 1.2 branch related to the migration.

The changes compared to 1.2 are the fact that we don't need the
IdentifyDisks step anymore (the drbd rpc calls are independent now), and...

6b93ec9d 01/13/2009 05:20 pm Iustin Pop

Forward-port DrbdNetReconfig

This is a modified forward-port of DrbdNetReconfig and their associated
RPCs. In Ganeti 2.0, these functions will be used for two things:
- live migration (as in 1.2)
- and for other network reconfiguration tasks, since DRBD8.Attach()...

f96e3c4f 01/13/2009 05:20 pm Iustin Pop

backend: rename AttachOrAssemble to Assemble

Since now the Assemble function is different than Attach, we rename this
backend function to show that the intent is to fully assemble the device
(and it's always allowed to modify the device).

Reviewed-by: ultrotter

56e7640c 01/08/2009 04:16 pm Iustin Pop

Add an instance_migratable rpc call

This is a forward-port of commit 1194 on the 1.2 branch:

This call will check whether an instance is up on its primary, and that
it has been started with symlinks. We currently have no on-secondary
checks, nor any hypervisor specific call....
5282084b 01/07/2009 07:02 pm Iustin Pop

backend: Remove symlinks by disk name

This is a modified forward-port of commit 1184 on the 1.2 branch:

backend: Remove symlinks by disk name, not using a wildcard
Reviewed-by: ultrotter

The changes to the original patch are related to the docstring style and...

b2e7666a 01/07/2009 07:02 pm Iustin Pop

Pass instance name to rpc call blockdev_close

This is an extract of commit 1166 on the 1.2 branch (Add a rpc call for
drbd network reconfiguration), but only the blockdev_close part.

The patch changes the blockdev_close call to take the instance so that...

03dfa658 01/07/2009 07:02 pm Iustin Pop

Fix the _RemoveBlockDevLinks() function

This is a forward-port of commit 1163 on the 1.2 branch:
This fixes the removal of the instance symlinks (probably breakage from
the glob changes).

Reviewed-by: imsnah
3c9c571d 01/07/2009 07:01 pm Iustin Pop

Remove instance's symlinks

This is a forward-port of commits 1150 and 1151 on the 1.2 branch:
Add _RemoveBlockDevLinks auxiliary function, called when an instance
fails to start and when it is shut down.

Reviewed-by: iustinp

and:
Fix cut&paste error when removing symlinks...

ec596c24 01/07/2009 07:01 pm Iustin Pop

Catch BlockDeviceError when starting instance

This is a forward-port of commit 1149 on the 1.2 branch:
_GatherAndLinkBlockDevs used to raise the errors.BlockDeviceError
exception when it failed to create a block device, and with this patch
set it does so also when it fails to create a symlink to it....

9332fd8a 01/07/2009 07:01 pm Iustin Pop

Create symlinks to intances' block devices

This is a forward-port of commit 1148 on the 1.2 branch:
Change the _GatherBlockDevs private function, called only one time by
StartInstance, to _GatherAndLinkBlockDevs, and make it transform the
device returned even more by calling the new _SimlinkBlockDev auxiliary...

069cfbf1 01/07/2009 07:01 pm Iustin Pop

Simplify hypervisor block_devices structure

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...
58b22b6e 12/18/2008 06:23 pm Michael Hanselmann

Use subdirectories for job queue archive

As it turned out, having many files in a single directory can be
very painful. With this patch, only 10'000 files are stored in a
directory for the job queue archive. With 10'000 directries, this
allows for up to 100 million jobs be archived without having large...

95268cc3 12/14/2008 02:02 pm Iustin Pop

cleanup: fix export NIC count the same way as disk

For safety, we use the same algorithm as in disk count.

Reviewed-by: amishchenko

bca2e7f4 12/14/2008 02:02 pm Iustin Pop

cleanup: fix backend._RecursiveFindBD

_RecursiveFindBD takes a parameter that isn't used; moreover, nowhere in
the SVN history can I find a case that it has been used.

As such, remove this parameter and fix its callers.

Reviewed-by: amishchenko

9a4e6f41 12/14/2008 02:02 pm Iustin Pop

cleanup: more unused vars

Reviewed-by: amishchenko

3bc6be5c 12/14/2008 02:02 pm Iustin Pop

cleanup: sanitize a default parameter

Instead of relying that the usage of the parameter is ok with mutable
default parameters, let's just make it safer..

Reviewed-by: amishchenko

c41eea6e 12/11/2008 07:13 pm Iustin Pop

Fix epydoc format warnings

This patch should fix all outstanding epydoc parsing errors; as such, we
switch epydoc into verbose mode so that any new errors will be visible.

Reviewed-by: imsnah

52e2f66e 12/10/2008 02:11 pm Michael Hanselmann

ganeti.backend: Improve compression check

Reviewed-by: iustinp

12bce260 12/09/2008 03:24 pm Michael Hanselmann

RPC: Compress file upload data

Adding compression to larger amounts of data is more efficient than
transferring it (len(nodes) - 1) times over the network without
compression. We were able to compress a 800KB config file to about
30 KB, which is about 40 KB with Base64 encoding (required due to...

56aa9fd5 12/05/2008 05:01 am Iustin Pop

Cleanup the config file on demotion from candidate

This patch adds a simple rpc which makes a backup of the config file and
then removes it. This is done so that cluster verify doesn't complain
immediately after demoting a node.

Reviewed-by: imsnah

25361b9a 12/02/2008 04:35 pm Iustin Pop

Fix gnt-cluster verify w.r.t. rpc changes

This partially reorganizes the cluster verify LU:
- introduce constants for the node verify rpc call
- move from additional rpc calls to a single rpc call, the
call_node_info, which gaters all data needed...

89b14f05 12/02/2008 07:04 am Iustin Pop

Simplify a little the ssconf update

We have (again) the KeyToFilename function, so we move the writing of
the files to a method under SimpleStore.

Reviewed-by: imsnah

93384844 12/02/2008 07:03 am Iustin Pop

Revert "Get rid of ssconf"

This partially reverts the "Get rid of ssconf" patch.

It adds back a simpler version of the SimpleStore class, and drops the
WritableSimpleStore class. The new version of the class also has
node_list as a new key, and increases the size of the keys so that big...

726d7d68 11/27/2008 05:13 am Iustin Pop

Fix gnt-backup export

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

03d1dba2 11/25/2008 02:37 pm Michael Hanselmann

Pass ssconf values from master to node

Instead of parsing the configuration on the node, we pass the ssconf
values from the master.

Reviewed-by: iustinp

955db481 11/24/2008 11:46 am Guido Trotter

Correct GetAllInstancesInfo rtype

GetAllInstancesInfo, in the backend, returns just a dict, not a dict of dicts.

Reviewed-by: iustinp

6ddc95ec 11/21/2008 12:42 pm Michael Hanselmann

Add RPC call to update ssconf files

Reviewed-by: iustinp

d868edb4 11/11/2008 12:58 pm Iustin Pop

Convert trunk to posix-compatibility

We change two functions to use RunCmd without shell, and the other
(which needs a ssh command line) is changed to the '>... 2>&1' syntax.

Reviewed-by: imsnah

10c2650b 10/25/2008 03:37 am Iustin Pop

Update backend.py docstrings

This patch converts all of backend.py to epydoc formatting.

Reviewed-by: imsnah

3f5bd234 10/25/2008 03:37 am Iustin Pop

Fix another error handling case

The return from this error path is a dict, but the actual return value
(on the non-error handling) is a list of dicts. Change accordingly.

Reviewed-by: imsnah

0a70a72a 10/24/2008 07:14 pm Iustin Pop

Fix an error handling case

Found while reviewing documentation.

Reviewed-by: ultrotter

2e3d1946 10/24/2008 06:23 pm Guido Trotter

OSFromDisk remove superfluous empty line

Reviewed-by: iustinp

b1206984 10/24/2008 05:44 pm Iustin Pop

Some documentation updates

This fixes a few doc issues and converts a few docstrings to epydoc.

Reviewed-by: imsnah

74c47259 10/23/2008 05:19 pm Iustin Pop

Export the disk index in the import/export scripts

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....

6c0af70e 10/22/2008 05:09 pm Guido Trotter

Convert ImportOSIntoInstance to OS API 10

- 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...

0607699d 10/22/2008 05:09 pm Guido Trotter

Convert ExportSnapshot to OS API 10

We pass the data via the environment rather than on the command line, as
API 10 says. All the rest remains the same, and we export just one disk,
as the master calls this function for every snapshotted disk.

Reviewed-by: iustinp

19d7f90a 10/22/2008 05:08 pm Guido Trotter

LUExportInstance: snapshot all disks

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()....

e9e9263d 10/22/2008 05:08 pm Guido Trotter

Convert SnapshotBlockDevice's docstring to epydoc

Reviewed-by: iustinp

d15a9ad3 10/17/2008 05:37 pm Guido Trotter

Cleanup os_add/rename rpc for OS API 10

- remove now unused osdev and swapdev arguments from backend, noded,
rpc, cmdlib
- convert docstrings to epydoc

Reviewed-by: iustinp

d324e3fc 10/17/2008 05:36 pm Guido Trotter

Temporarily explicitely break import/export

Since they're not converted to API 10 yet, we temporarily disable the
import/export functions.

Reviewed-by: iustinp

58f6e5ca 10/17/2008 05:36 pm Guido Trotter

AddOSToInstance: convert to api10

Reviewed-by: iustinp

ff38b6c0 10/17/2008 05:36 pm Guido Trotter

RunRenameInstance: convert to api10

Reviewed-by: iustinp

2266edb2 10/17/2008 05:36 pm Guido Trotter

Add new OSEnvironment function

This function calculates the basic environment for OS scripts in API
version 10.

Reviewed-by: iustinp

62dbbe7e 10/17/2008 05:35 pm Guido Trotter

OSFromDisk: use script names from constants

Reviewed-by: iustinp

8ee4dc80 10/17/2008 05:35 pm Guido Trotter

Change OSFromDisk's docstring to epydoc

Plus update it with the real variable name

Reviewed-by: iustinp

5d672980 10/15/2008 04:13 pm Iustin Pop

Add a rpc call for changing the drain flag

A new multi-node call is added that sets/resets the drain flag.

Reviewed-by: imsnah

51de46bf 10/14/2008 02:29 pm Iustin Pop

Change the backend to use the beparams

The backend.FinalizeExport function is changed to use the beparams
instead of the instance attributes. Future enhancements should be done
in order to export and import/reuse the whole be/hv params.

Reviewed-by: ultrotter

f23b5ae8 10/14/2008 01:20 pm Iustin Pop

Temporary fix for dual hvm/pvm instances

We have a problem with the current model of combining instance lists
from multiple hypervisors: we don't allow duplicates, but "xm list"
gives the same output for both pvm and hvm. This is a lack in the actual
xen hypervisor implementation/split between pvm and hvm, but for now we...

6217e295 10/14/2008 01:19 pm Iustin Pop

Export the hypervisor.ValidateParameters over RPC

The newly-added node-specific ValidateParams hypervisor method is
exported over RPC, using the semi-standard (success, message) return
value. Multi-node call, so that we call on both primary and secondary at...

caad16e2 10/12/2008 11:40 pm Iustin Pop

Abstract checking own address into a function

Currently, we check if we have a given ip address (i.e. it's alive on
one of our interfaces) but manually calling TcpPing(source=localhost).
This works, but having it spread all over the code makes it hard to...

082a7f91 10/10/2008 07:04 pm Guido Trotter

OS API: support for multiple versions in an OS

Allow multiple api versions in an OS. This is according to the OS API
changes design doc, by which an OS can support multiple versions of the
Ganeti API and if one is supported by Ganeti it will work. Since up to...

e69d05fd 10/08/2008 01:36 pm Iustin Pop

Move the hypervisor attribute to the instances

This (big) patch moves the hypervisor type from the cluster to the
instance level; the cluster attribute remains as the default hypervisor,
and will be renamed accordingly in a next patch. The cluster also gains...

9f0e6b37 10/07/2008 02:39 pm Iustin Pop

rpc.call_instance_migrate: pass the whole instance

Currently the call_instance_migrate call only passes the instance name;
we need to pass the whole object for the hypervisor_type changes (all
the other individual instance rpc calls already pass the instance...

62c9ec92 10/06/2008 06:58 pm Iustin Pop

backend.py change to get cluster name from master

Currently there are three function in backend that need the cluster name
in order to instantiate an SshRunner. The patch changes these to get the
cluster name from the master in the rpc call; once the multi-hypervisor...

6b0469d2 10/06/2008 04:16 pm Iustin Pop

Fix SshRunner breakage from the changed API

More places actually use the SshRunner than just the gnt-cluster
commands.

Reviewed-by: ultrotter

7688d0d3 10/01/2008 08:35 pm Michael Hanselmann

Convert ssh.py

Get rid of ssconf and convert to configuration instead.

Reviewed-by: iustinp

3707f851 10/01/2008 08:34 pm Michael Hanselmann

Convert hypervisor

Replacing ssconf with configuration.

Reviewed-by: iustinp

c657dcc9 10/01/2008 08:34 pm Michael Hanselmann

Convert backend.py

Replacing ssconf with simpleconfig.

Reviewed-by: iustinp

1bc59f76 09/09/2008 03:47 pm Michael Hanselmann

Never remove job queue lock in node daemon

Otherwise, corruption could occur in some corner cases. E.g. when
LeaveNode is running in a child and is in the process of removing
queue files, the main process gets killed, started again and gets
a request to update the queue. This is rather extreme corner case,...

bd1e4562 09/09/2008 03:24 pm Iustin Pop

Change backend._GetMasterInfo to return more data

The _GetMasterInfo() function needs to export the master name too to be
useful in master safety checks. This patch makes it a public (no _)
function and adds a third element in the return tuple. Its callers are...

4f0afaf5 08/14/2008 01:27 pm Guido Trotter

Pass hypervisor type to the OS scripts

It's handy to make the os scripts know which hypervisor the instance is
going to run under. In order not to change the os API we pass this
information in the environment, where the os scripts can access it if
they're hypervisor-aware....

24fc781f 08/08/2008 02:23 pm Michael Hanselmann

Don't always remove queue lock when queue is purged

The lock should only be removed if ganeti-noded is going to quit.
Otherwise it needs to be kept to prevent another process from creating
it again while we're still holding the (removed) lock. This is due to...

76ab5558 08/08/2008 02:22 pm Michael Hanselmann

backend: Add optional exclusion list to _CleanDirectory

The code cleaning the queue will make use of it.

Reviewed-by: iustinp

af5ebcb1 08/08/2008 02:21 pm Michael Hanselmann

noded: Add RPC function to rename job queue files

This will be used to archive jobs.

Reviewed-by: iustinp

dc31eae3 08/08/2008 02:21 pm Michael Hanselmann

backend: Add function to check whether file is in queue dir

Another function will need to check whether its parameters
are job queue files.

Reviewed-by: iustinp

553f1c1d 08/08/2008 01:02 pm Michael Hanselmann

Disallow uploading job queue files through upload_file

The job queue is now updated through its own RPC functions.

Reviewed-by: iustinp

ca52cdeb 08/08/2008 01:01 pm Michael Hanselmann

Add job queue RPC functions

jobqueue_update: Uploads a job queue file's content to a node. The
most common operation is to upload something that we already have
in a string. Unlike in the upload_file function, the file is not
read again when distributing changes, but content has to be passed...

3956cee1 08/08/2008 01:00 pm Michael Hanselmann

Move function cleaning directory to module level

JobQueuePurge() will be used by an RPC function.

Reviewed-by: iustinp

f78346f5 08/06/2008 02:27 pm Michael Hanselmann

Clean job queue directories when leaving cluster

Old job files shouldn't be left on nodes removed from a cluster.

Reviewed-by: iustinp

afee8008 07/31/2008 05:42 pm Michael Hanselmann

Allow job queue files to be uploaded through ganeti-noded

This is needed for job queue replication.

Reviewed-by: iustinp

38206f3c 07/30/2008 05:04 pm Iustin Pop

Fix pylint-detected issues

This is mostly:
- whitespace fix (space at EOL in some files, not all, broken
indentation, etc)
- variable names overriding others (one is a real bug in there)
- too-long-lines
- cleanup of most unused imports (not all)...

3b9e6a30 07/30/2008 04:27 pm Iustin Pop

Fix some errors detected by pylint

Reviewed-by: imsnah

b1b6ea87 07/30/2008 11:43 am Iustin Pop

Rework master startup/shutdown/failover

This (big) patch reworks the master startup/shutdown and the fixes the
master failover.

What does the patch do?

For master start/stop:
- remove the old ganeti-master script and its associated man page
- moves the ip start/stop directly into the backend.(Start|Stop)Master...

1c65840b 07/30/2008 11:32 am Iustin Pop

Add a new parameter to backend.(Start|Stop)Master

This patch adds a new, unused for now, parameter to the start and stop
master operations in backend. The idea behind it is that we need to be
able to control whether the IP (de)activation is coupled with daemon...

c3f0a12f 07/23/2008 01:06 pm Iustin Pop

Distribute the queue serial file after each update

This patch adds distribution of the queue serial file after each write
to it (but before a new job is created and written with that ID, and
before a response is returned, so we should be safe from crashes in...

18682bca 07/11/2008 06:45 pm Iustin Pop

Convert backend.py to the logging module

The patch also switches some of the exception logs to use
logging.exception (and therefore the log message will have a diferent
format).

(Note that this might not be a good choice in all cases, though)

Reviewed-by: imsnah

a17a7623 07/11/2008 04:54 pm Iustin Pop

Fix backend.NodeVolumes handling of LVM output

This is the same fix as for GetVolumeList.

I've checked manually and all other places that call lvm commands are
already checking the output validity in terms of correct number of
fields.

Reviewed-by: ultrotter

df4c2628 07/11/2008 04:23 pm Iustin Pop

Fix backend.GetVolumeList handling of LVM output

Sometimes ‘lvs’ can spit error messages on stdout, even when one wants
to parse the output:
...
Inconsistent metadata copies found - updating to use version 2776
...

So we need to validate the output to guard against such cases....

90fae627 06/27/2008 05:27 pm Guido Trotter

Allow VNC_PASSWORD_FILE to be rpc-uploaded

What could possibly go wrong?

Reviewed-by: iustinp

6d8b6238 06/27/2008 05:27 pm Guido Trotter

raise QuitGanetiException in LeaveCluster

Reviewed-by: iustinp

d61cbe76 06/20/2008 02:04 pm Iustin Pop

Add a rpc call for BlockDev.Close()

This patch adds rpc layer calls (in rpc.py and the equivalent in
ganeti-noded) to close a list of block devices, and the wrapper in
backend.py that takes a list of Disk objects, identifies them and
returns correctly formatted results....

594609c0 06/16/2008 07:06 pm Iustin Pop

Expose block device grow in backend.py

This patch adds a wrapper over the block device grow operation that
converts the input and output parameters as needed for the rpc layer.

Reviewed-by: imsnah

2a10865c 06/16/2008 04:57 pm Iustin Pop

Add migration support at the rpc layer

This patch adds the migration rpc call and its implementation in the
backend. The patch does not deal with the correct activation of disks.

Because of the new RPC, the protocol version is increased.

Reviewed-by: imsnah

9d4bfc96 05/13/2008 05:33 pm Iustin Pop

Implement node daemon conectivity tests

This patch adds in gnt-cluster verify checks for inter-node tcp
communication checks on the node daemon port for both the primary and
(if defined) secondary networks.

The output looks like (4-node cluster, one with the secondary interface...

b544cfe0 05/13/2008 10:32 am Iustin Pop

Reduce chance of ssh failures in verify cluster

The cluster verify builds a sorted list of nodes and passes that to all
the nodes (in parallel) for ssh checks. This means that for a cluster
with N nodes, there will be approximately N simultaneous connections to...

7b7857ee 04/30/2008 12:29 pm Guido Trotter

Remove non-existing arguments from some docstrings

A fewdocstrings in the HooksRunner backend class list arguments the relevant
functions do not take. Clean them up.

Reviewed-by: iustinp

8d528b7c 04/28/2008 12:47 pm Iustin Pop

Move iallocator script execution to ganeti-noded

Currently the iallocator execution takes place in the master, which is a
violation of the current architecture, and will create problems with a
threaded master daemon.

This patch moves the execution to the backend, similar to the hooks...

66f93869 04/24/2008 06:56 pm Manuel Franceschini

backend.FinalizeExport: safely initialize some vars

This patch initializes nic_count and disk_count with 0. This prevents
some reference errors if the snap_disks block device list is empty.

Reviewed-by: ultrotter