Statistics
| Branch: | Tag: | Revision:

root / lib / rpc.py @ b119bccb

History | View | Annotate | Download (33.1 kB)

# Date Author Comment
7c4d6c7b 07/07/2009 03:54 pm Michael Hanselmann

Fix pylint warnings

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

5bbd3f7f 07/07/2009 03:51 pm Michael Hanselmann

Fix some typos

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

a97da6b7 06/03/2009 03:17 pm Iustin Pop

Fix two issues with exports and snapshot errors

This patch fixes two issues related to failed snapshots during exports:
- first, the error messages used disk.logical_id1, which is a node
name for DRBD, and it resulted in strange error messages like...

0eca8e0c 05/19/2009 11:39 am Iustin Pop

call_instance_start: add optional hv/be parameters

This patch modifies the rpc.call_instance_start - the master side - to
take optional hv/be parameters. The noded side is unchanged and
oblivious to the change.

This will allow implementation of single-user capability and such on...

5fcc718f 02/27/2009 03:06 pm Iustin Pop

Fix some epydoc style issues

99% of the epydoc return tags are "@return:", but each of the modified files
had one "@returns:" line. We fix this for consistency.

Reviewed-by: imsnah

07813a9e 02/24/2009 05:25 pm Iustin Pop

Remove the extra_args parameter in instance start

This patch removes the extra_args parameter and instead switches the
instance to the HV_KERNEL_ARGS hypervisor option.

This is a big change, but it's a needed cleanup, this extra parameter on
all RPC calls is not generic and we also need to have a persistent value...

f2def43a 02/09/2009 11:24 am Iustin Pop

RpcResult: add a new payload field

For results which use the (status, payload) response type, it's easier
to define a ‘payload’ field on the result holding the payload than to
extract it using “data1” in the caller code.

Reviewed-by: ultrotter

84b45587 01/23/2009 12:15 pm Iustin Pop

Fill the 'call' attribute of offline rpc results

When creating ‘fake’ results for offline nodes, we currently don't pass
the call attribute. This complicates debugging, so even though this
should not matter in practice, it's better to fix it.

Reviewed-by: imsnah

1b8acf70 01/21/2009 12:48 pm Iustin Pop

Log the rpc call name in the RPC errors message

Currently the rpc module logs the error description and target node in
rpc calls logging, as such:

2009-01-21 00:50:01,456:  pid=1051/Thread-21 ERROR RPC error from node
node1.example.com: Connection failed (111: Connection...
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....

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

186ec53c 01/09/2009 02:52 pm Iustin Pop

Silence warning on node list for offline nodes

The warning in node list is meant for nodes that return wrong
information, but for offline nodes this case is normal.

Reviewed-by: imsnah

3247bbac 01/08/2009 06:05 pm Iustin Pop

rpc: Add a method for easy check of remote results

The patch adds a new method to the rpc.RpcResult class called
"RemoteFailMsg" which is useful for the RPC calls which return a
(status, payload) style result.

Reviewed-by: imsnah

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

dd875d32 12/18/2008 06:39 pm Michael Hanselmann

Job queue: Allow more than one file rename per RPC call

Reviewed-by: ultrotter

fab1e3a4 12/14/2008 02:01 pm Iustin Pop

cleanup: fix 'variable unused' warning

In the iteration we don't care about the node names, so we change the
for loop to be over the values (and not itervalues).

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

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

ed83f5cc 12/08/2008 11:10 am Iustin Pop

RPC: do not make calls to offline nodes

This patch changes the _MultNodeCall and _SingleNodeCall helpers to not
actually make calls to offline nodes, but instead generate fake
responses which have a parameter caller 'offline' set so that callers
can check for this value if they want (otherwise, it's just a failed RPC...

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

ae88ef45 12/04/2008 05:24 pm Michael Hanselmann

ganeti.rpc: Convert to new HTTP server

Reviewed-by: amishchenko

781de953 12/02/2008 02:58 pm Iustin Pop

Convert rpc results to a custom type

For a long time we had the problem that both RPC-layer errors and
results from the remote node share the same "valuespace". This is
because we shouldn't raise an exception when only one node failed
(and lose the results from the other nodes)....

3097c858 12/01/2008 10:52 pm Michael Hanselmann

Fix RpcRunner._StaticSingleNodeCall

Unfortunately, a rpc.Client object was passed as the first parameter,
causing the function to always fail.

Found during QA testing.

Reviewed-by: ultrotter

160e2921 11/26/2008 03:23 am Iustin Pop

Reduce duplication of work in rpc.Client

This patch removes the duplicate serialization and calls to
utils.GetNodeDaemonPort in rpc.Client, and instead moves them to calling
functions (the _*NodeCall ones recently introduced).

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

d57ae7f7 11/24/2008 03:38 pm Michael Hanselmann

ganeti.rpc: Read SSL certificate and key only once per request

There's no need to read the SSL certificate and key for every node
in a request. Also add a TODO for better error reporting.

Reviewed-by: amishchenko

eafd8762 11/21/2008 12:47 pm Michael Hanselmann

Use SSL for master/node RPC

This patch enables SSL between masterd and noded.

Reviewed-by: iustinp

ec17d09c 11/21/2008 12:46 pm Michael Hanselmann

Get rid of node daemon password

With the new SSL client certificate stuff it's no longer needed.

Reviewed-by: iustinp

4331f6cd 11/21/2008 12:45 pm Michael Hanselmann

Reuse HTTP client pool for RPC

ganeti-masterd: Add initialization and shutdown of RPC pool. It needs
to be shutdown before forking.

ganeti.cli: Add decorator function to initialize and shutdown RPC pool.

ganeti.rpc: Add functions to initialize and shutdown RPC pool. Throw...

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

Add RPC call to update ssconf files

Reviewed-by: iustinp

9a525d83 11/19/2008 03:18 pm Michael Hanselmann

ganeti.rpc: Use central functions for actual RPC calls

Before we had lots, lots and lots of code duplication. This patch
changes the code to use four central functions.

Reviewed-by: iustinp

4c7c81d7 11/12/2008 02:52 pm Michael Hanselmann

ganeti.rpc: Use utils.ReadFile instead of reading file directly

Reviewed-by: iustinp

7c28c575 11/12/2008 02:50 pm Michael Hanselmann

ganeti.rpc: Convert to ganeti.serializer

This is one of the last places where the simplejson module is
used directly.

Reviewed-by: iustinp

ecfe9491 11/12/2008 02:50 pm Michael Hanselmann

Convert RPC module to new HTTP client

Currently, HttpClientManager is instantiated for every RPC call. This
will be changed with another patch, as will the use of SSL. The “Run”
method is no longer needed.

Reviewed-by: iustinp

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

99aabbed 10/20/2008 05:47 pm Iustin Pop

Convert the job queue rpcs to address-based

The two main multi-node job queue RPC calls (jobqueue_update,
jobqueue_rename) are converted to address-based calls, in order to speed
up queue changes. For this, we need to change the _nodes attribute on
the jobqueue to be a dict {name: ip}, instead of a set....

6b294c53 10/20/2008 05:47 pm Iustin Pop

Convert rpc.call_upload_file to use addresses

This patch allows rpc.call_upload_file to use addresses (if passed), and
also converts the ConfigWriter._DistributeConfig to pass them, since
this is an often-done operation.

Reviewed-by: imsnah

25348212 10/20/2008 05:47 pm Iustin Pop

Convert non-static rpc calls to use addresses

This patch converts all non-staticmethods rpc calls to pass addresses to
the Client calls.

This is done via two new small helpers. These functions also deal with
nodes that are not (yet) in the configuration file, and pass None for...

bdf7d8c0 10/20/2008 05:46 pm Iustin Pop

Add infrastructure for using addresses in rpc.py

The patch adds support for passing node addresses to NodeController
objects, which should speed up the connect sequence.

The patch also adds another very small optimization of computing the
content-length header value in the parent Client class instead of each...

3ef3c771 10/20/2008 05:46 pm Iustin Pop

Improve conformance with the style guide for rpc.py

This patch renames some internal function to camel case, for compliance
with the style guide.

It also fixes the module docstring (how old was that?).

Reviewed-by: imsnah

58b311ca 10/20/2008 03:49 pm Iustin Pop

Convert rpc.py to use the logging module

Reviewed-by: imsnah

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

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

5b442704 10/14/2008 02:29 pm Iustin Pop

Correctly fill the beparams too over RPC

As for the hvparams, we need to replace the sent instance beparams.

Reviewed-by: ultrotter

26ba2bd8 10/14/2008 01:20 pm Iustin Pop

Implement FillHV for instance-related rpc calls

We fill the instance hvparams with cluster defaults, and send a modified
dict over the wire to the node methods - they don't know anything about
cluster defaults versus instance parameters.

Reviewed-by: ultrotter

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

16ad1a83 10/13/2008 04:49 pm Iustin Pop

Fix a few rpc-related errors

This fixes:
- whitespace change, double lines between methods
- duplication of call_upload_file, introduced by mistake in rev 1795
and which went undetected because of the many changes in that ref
(only diff -b shows it clearly)...

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

15396f60 10/10/2008 08:08 pm Michael Hanselmann

Mark call_node_leave_cluster as a static method

Reviewed-by: iustinp

72737a7f 10/10/2008 12:55 pm Iustin Pop

Convert rpc module to RpcRunner

This big patch changes the call model used in internode-rpc from
standalong function calls in the rpc module to via a RpcRunner class,
that holds all the methods. This can be used in the future to enable
smarter processing in the RPC layer itself (some quick examples are not...

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

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

Convert rpc.py

Replacing ssconf with utility functions.

Reviewed-by: iustinp

4e071d3b 09/09/2008 03:24 pm Iustin Pop

Export backend.GetMasterInfo over the rpc layer

We create a multi-node call so that querying all nodes for agreement
will be fast.

Reviewed-by: imsnah

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

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

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

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

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

4c8ba8b3 06/17/2008 09:50 am Iustin Pop

Implement block device grow at the rpc layer

This simple patch exposes the block device grow operation at the rpc
layer. It does not increase the protocol version as it has been recently
changed by the live failover rpc call.

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

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

5e04ed8b 04/05/2008 03:45 pm Manuel Franceschini

rpc directory functions for file backend

Reviewed-by: ultrotter

2d3e73c4 04/02/2008 05:15 pm Michael Hanselmann

Forcibly convert export data to str object

ConfigParser.SafeConfigParser doesn't support unicode string objects.
Unicode string objects are returned by simplejson.

Reviewed-by: iustinp

7c0d6283 03/05/2008 04:39 pm Michael Hanselmann

Codestyle fixes: adding a few empty lines

Reviewed-by: ultrotter

81010134 02/22/2008 02:39 pm Iustin Pop

Break trunk by removing twisted

This patch switches from the twisted usage for inter-node protocol to
simple BaseHTTPServer/httplib. The patch has more deletions because we
use no authentication, no encryption at all.

As such, this is just for trunk, and only for testing. What it brings is...

06009e27 02/05/2008 04:12 pm Iustin Pop

Add a test opcode that sleeps for a given duration

This can be used for testing purposes.

Reviewed-by: ultrotter,imsnah

dfa96ded 11/05/2007 02:43 am Guido Trotter

Convert os_get to use OS rather than InvalidOS

In order to do this for simplicity we leave the OSFromDisk function as-is and
we convert the eventual exception to an OS object in ganeti-noded. The
unmangling gets simplified and so does the code for checking whether the OS is...

4e679f11 11/05/2007 02:43 am Guido Trotter

Simplify diagnose mangling/unmangling functions

The functions in ganeti-noded and rpc.py still deal with the fact that an
InvalidOS error could be returned by DiagnoseOS. As this is not the case
anymore simplify their code for the current behavior.

Reviewed-By: iustinp

00fe9e38 11/04/2007 06:10 am Guido Trotter

Make call_os_get a single node function

call_os_get is never called with a real list of nodes, so there's no point in
it being multi-node. Making it single-node till a usage for multi-node call is
found.

Reviewed-By: iustinp

3f78eef2 11/02/2007 03:44 pm Iustin Pop

Implement device to instance mapping cache

Currently, troubleshooting DRBD problems involves a manual process of going
backwards from the DRBD device to the instance that owns it.

This patch adds a weak (i.e. not guaranteed to be correct or up-to-date)
cache of device to instance. The cache should be, in normal operation,...

f3e513ad 10/29/2007 05:44 pm Iustin Pop

Implement block device renaming

This patch add code for renaming a device; more precisely, for changing
the unique_id of the device. This means:
- logical volumes, rename the volume
- drbd8, change the remote peer

This is needed for the being able to replace disks for drbd8....

153d9724 10/25/2007 02:22 pm Iustin Pop

Modify two mirror-device related rpc calls

The two calls mirror_addchild and mirror_removechild take only one child
for addition/removal. While this is enough for our md usage, for local
disk replacement in drbd8, we need to be able to specify both the data...

007a2f3e 10/17/2007 06:00 pm Alexander Schreiber

Patch series for reboot feature, part 1

This patch series implements the reboot command for gnt-instance. It
supports three types of reboot: soft (hypervisor reboot), hard (instance
config rebuild and reboot) and full (full instance shutdown and startup
again)....

2f8598a5 10/15/2007 04:06 pm Alexander Schreiber

Trivial typing fixups.

Reviewed-by: iustinp

16abfbc2 10/10/2007 08:20 pm Alexander Schreiber

Remove fping as a dependency for Ganeti.

This patch completely gets rid of fping
- replace all fping invocations with TcpPing calls
- update documentation accordingly.
- associated cleanups (use constant for localhost IP, use more sensible
defaults for TcpPing and use those)...

2f31098c 10/10/2007 01:00 pm Iustin Pop

Remove the shebang from modules

Since modules are not directly executables, remove the shebang from
them. This helps with lintian warnings.

Also make the autogenerated _autoconf.py contain two comment lines at
the beginning, like the other modules.

Reviewed-by: ultrotter

305a7297 10/04/2007 02:51 pm Guido Trotter

Ship (and display) path for InvalidOS errors too.

- Document the expected change to errors.InvalidOS
- Always pass the additional argument
- Modify DiagnoseOS output to show the path

Reviewed-by: iustinp, imsnah

319856a9 10/04/2007 02:33 pm Michael Hanselmann

Change configuration storage format from Pickle to JSON.

- Add NEWS file with major changes between versions.
- Bump RPC version number
- No longer serialize in RPC, but just convert to dict

Old Pickle based configuration files can be converted using the cfgupgrade...

decd5f45 09/17/2007 02:52 pm Iustin Pop

Implement instance rename operation

This patch adds support for instance rename operation at all remaining
layers: RPC, OpCode/LU and CLI.

Reviewed-by: imsnah

31ee599c 08/21/2007 05:35 pm Michael Hanselmann

Fix typo.

Reviewed-by: iustin

3ecf6786 08/14/2007 06:17 pm Iustin Pop

Style changes for pep-8 and python-3000 compliance.

This changes the raising of exceptions from:
raise Exception, value
to
raise Exception(value)

as the first form will be removed in python-3000 and the second form is
preferred now.

The changes also involve a few cases of changing from raising standard...

a0c3fea1 08/03/2007 03:35 pm Michael Hanselmann

Add instance name to LVM volume as a tag.

Reviewed-by: iustinp

098c0958 07/26/2007 02:40 pm Michael Hanselmann

Comment formatting updates.

Reviewed-by: iustinp

cb91d46e 07/25/2007 02:46 pm Iustin Pop

Since the watcher can run on all nodes, let's get rid of the cron file
handling, as it can be static and outside of ganeti.

This also means we can get rid of a lot of infrastructure too:
- the master/node config files checkers
- one rpc function

dcb93971 07/24/2007 02:45 pm Michael Hanselmann

- Implement “gnt-node volumes”
- Create all --output options using a constant
- Put node checking code from opcodes into a single function
- Do the same for output fields

Reviewed-by: iustinp

a8083063 07/16/2007 04:39 pm Iustin Pop

Initial commit.