workerpool: Move waiting for new tasks for a worker to the pool
This way fewer private variables of the pool are accesssed by the worker.
Signed-off-by: Michael Hanselmann <hansmi@google.com>Reviewed-by: Iustin Pop <iustin@google.com>
workerpool: Remove unused worker method
HasRunningTask is never used except for an assertion, where wedon't really need the lock.
workerpool: Additional check in BaseWorker.ShouldTerminate
Document that it should only be called from within RunTask andadd an assertion for this. This means we can no longer use amethod on the pool and hence remove WorkerPool.ShouldWorkerTerminate.
Signed-off-by: Michael Hanselmann <hansmi@google.com>...
workerpool: Use common function to add tasks
Fix install document regarding DRBD usage
This is related to issue 105.
Signed-off-by: Iustin Pop <iustin@google.com>Reviewed-by: Michael Hanselmann <hansmi@google.com>
Update RAPI documentation for the OS changes
Rename masterfailover to master-failover
Most (all?) of our commands use dash-separator: replace-disks,verify-disks, add-tags, etc. “gnt-cluster masterfailover” is an oldexception to this rule.
The patch replaces it with master-failover, add a compatiblity alias,...
RAPI: Add os params to instance creation v1
Since the RAPI QA suite doesn't seem to offer easy testing of failedcreations, I didn't add this to the QA. Pointers on how to do it arewelcome.
The patch also changes the 'os' argument to be required, since that is...
makefile: fix TAGS building
“find .” requires that “-path” arguments start with a dot, otherwisethey are not matches. Additionally, we also include the QA files in thetags, for easier search while modifying the QA suite.
Signed-off-by: Iustin Pop <iustin@google.com>...
Improve handling of lost jobs
Currently, if the cli.JobExecutor class is being used, and one of thejobs is being archived before it can check its result, it will raise astracktrace as _ChooseJob is not prepared to handle this case.
This case makes JobExecutor work better with lost jobs (it still reports...
luxi: convert permission errors into exception
This patch adds handling of permission errors so that we don't showtracebacks when a non-root user runs a gnt-* command. Since in thefuture we'll have different permissions, we need to handle this in RAPItoo....
cmdlib: Return new name from rename operations
The new name is then displayed by the clients.
Signed-off-by: Michael Hanselmann <hansmi@google.com>Reviewed-by: Manuel Franceschini <livewire@google.com>
gnt-instance rename: Fix bug and rename params
This patch fixes a bug when gnt-instance rename was invoked with--no-name-check. It renames the internal variables to be consistent withthe ones in equivalent instance add code. Furthermore it checks whether...
QA: add tests for the reserved lvs feature
Signed-off-by: Iustin Pop <iustin@google.com>Reviewed-by: René Nussbaumer <rn@google.com>
Add modification of the reserved logical volumes
This doesn't allow addition/removal of individual volumes, onlywholesale replace of the entire list. It can be improved later, if weever get generic container parameters.
The man page changes replaces some tabs with spaces (hence the...
Add printing of reserved_lvs in cluster info
Introuce a new cluster parameter - reserved_lvs
This parameter, which is a list of regular expression patterns, willmake cluster verify ignore any such LVs. It will not prevent creation orremoval of such volumes by the backend code.
Change the meaning of call_node_start_master
Currently, backend.StartMaster (the function behind this RPC call) willactivate the master IP and then, if the start_daemons parameter is true,it will also activate the master role.
While this works, it has two issues:...
masterd: move the IP activation from Exec to Check
Currently, the master IP activation is done in the Exec function. Sincethe original masterd process returns after forking, and Exec is run inthe (grand)child process, this means that after 'ganeti-masterd' has...
Move the UsesRPC decorator from cli to rpc
This is needed because not just the cli scripts need this decorator, butthe master daemon too (and it already duplicated the code once).
In cli.py we just leave a stub, so that we don't have to modify all thescripts to import rpc.py....
watcher: smarter handling of instance records
This patch implements a few changes to the instance handling. First, oldinstances which no longer exist on the cluster are removed from thestate file, to keep things clean.
Second, the instance restart counters are reset every 8 hours, since...
Update the RAPI node migrate for the 'live' change
This patch adds handling of the new 'mode' parameter to the RAPI server,while keeping compatibility with the old mode. Note that in the old mode(when 'live' is being passed), the auto-mode doesn't work....
Update the RAPI client for the migration mode
See the discussion on the previous patch about this. Basically unless wewant to a add a new 'feature' marking for the live migration parameter,there is no simple way to handle this nicely in the client.
Given that the client was/is marked as experimental, this patch simply...
Fix burnin and live migration
This is breakage from the original 'live' parameter changes.
Rename the OpMigrate* parameter 'live' to 'mode'
This is needed as now the parameter is no longer boolean, but tri-state.
Rename migration type to migration mode
This is in preparation for the rename of the opcode 'live' parameter to'mode'.
utils: Fix incorrect docstring
Signed-off-by: Manuel Franceschini <livewire@google.com>Reviewed-by: Iustin Pop <iustin@google.com>
Merge branch 'devel-2.1' into master
Signed-off-by: Iustin Pop <iustin@google.com>Reviewed-by: Guido Trotter <ultrotter@google.com>
Fix issue when changing the disk template to drbd
If we pass the current primary node, the conversion will fail horriblywith LVM creation errors. Instead, we catch and check for thiscondition in CheckPrereq.
Remove a couple of empty design sections
The 2.1 and 2.2 designs contain sections with no actual content, as theyare detailed for each single change. Removing the global empty ones.
Signed-off-by: Guido Trotter <ultrotter@google.com>Reviewed-by: Manuel Franceschini <livewire@google.com>
Disable 'invalid name' pylint warning for tools/setup-ssh
Signed-off-by: Manuel Franceschini <livewire@google.com>Reviewed-by: René Nussbaumer <rn@google.com>
Always set commonName in X509 certificates
Due to the current switch of the RPC client to PycURL, a bug with newerversions of libcurl surfaced. When the 'Subject' or 'Issuer' of'server.pem' were empty, SSL handshake failed.
This patch changes the certificate generation functions such that they...
Adding tool to setup SSH on a remote host
This prepares the remote node to be joined into a cluster
Signed-off-by: René Nussbaumer <rn@google.com>Reviewed-by: Michael Hanselmann <hansmi@google.com>
Adding new (optional) dependency to configure.ac
Adding constants for setup-ssh
Signed-off-by: René Nussbaumer <rn@google.com>Reviewed-by: Iustin Pop <iustin@google.com>
Change AddAuthorizedKey to also allow filehandles
This is required to use this function over paramikosftp file handles.
Update .gitignore for vcs-version
RAPI client: Encode empty body to JSON
If the body consists of an empty dict, it should also be encoded.
Introduce git reference/tag tracking for debugging
This patch adds a new vcs-version file that is generated via git (andcan be adapted if VCS is changed) and then embebbded as VCS_VERSION inthe constants module.
This means two things:- local modifications without committing to git (or when using a tar.gz...
Fix epydoc warning "Lists must be indented."
Signed-off-by: Luca Bigliardi <shammash@google.com>Reviewed-by: Michael Hanselmann <hansmi@google.com>
Convert RPC client to PycURL
Instead of using our custom HTTP client, using PycURL's multiinterface allows us to get rid of the HTTP client threadpool.The majority of the code is still in the ganeti.http.clientmodule.
A simple per-thread HTTP client pool gives cURL a chance to...
Implement lock names for debugging purposes
This patch adds lock names to SharedLocks and LockSets, that can be usedlater for displaying the actual locks being held/used in places where weonly have the lock, and not the entire context of the locking operation....
Merge branch 'devel-2.1'
Conflicts: NEWS - merge configure.ac - keep 2.2 version
Signed-off-by: Guido Trotter <ultrotter@google.com>Reviewed-by: Iustin Pop <iustin@google.com>
Bump up version to release 2.1.6
Update NEWS file for 2.1.6
Fix pylint complaints introduced in commit e58f87a958c
Due to a small mistake I missed three non-critical pylint complaints forcommit e58f87a958c. They're fixed with this patch.
Signed-off-by: Michael Hanselmann <hansmi@google.com>Signed-off-by: Iustin Pop <iustin@google.com>...
LXC: Add cpu_mask hypervisor parameter
Also implement syntax checking.
Signed-off-by: Balazs Lecz <leczb@google.com>Reviewed-by: Iustin Pop <iustin@google.com>
Add ParseCpuMask() utility function
Also adds a generic ParseError exception.
Signed-off-by: Balazs Lecz <leczb@google.com>Reviewed-by: Michael Hanselmann <hansmi@google.com>
Add a migration type global hypervisor parameter
Since migration live/non-live is more stable (e.g.) for Xen-PVM versusXen-HVM, we introduce a new parameter for what mode we should use bydefault (if not overridden by the user, in the opcode).
The meaning of the opcode 'live' field changes from boolean to either...
Add test for some aspects of job queue
This new opcode and gnt-debug sub-command test some aspects of thejob queue, including the status of a job. The bug fixed in commit2034c70d507 was identified using this test. A future patch willrun this test automatically from the QA scripts....
LUVerifyCluster: update _ValidateNode description
Change _ValidateNode description to reflect what the function actually does.
Signed-off-by: Luca Bigliardi <shammash@google.com>Reviewed-by: Iustin Pop <iustin@google.com>
KVM hypervisor: Use utils.ShellWriter for network script
This patch converts hv_kvm to use utils.ShellWriter for writingthe network script. It also adds a few unittests (the firstfor any hypervisor modules).
Move ShellWriter class to utils
Also add unittest.
Rename test for utils.IgnoreProcessNotFound
Usually our tests are named “Test…”.
jqueue: Factorize code waiting for job changes
By splitting the _WaitForJobChangesHelper class into multiple smallerclasses, we gain in several places:
- Simpler code, less interaction between functions and variables- Easy to unittest (close to 100% coverage)...
Merge remote branch 'origin/devel-2.1'
Conflicts: test/ganeti.rapi.client_unittest.py: Trivial test/ganeti.rapi.rlib2_unittest.py: Trivial...
RAPI client: Implement old instance creation request format
Commit 8a47b4478 implemented instance creation in the RAPI client,but it left out support for the old instance creation request format.This patch now implements the old format as good as possible. This...
rlib2: Use constants for disk and NIC parameters
These constants were added in commit bd061c35, but the parsing codewas not updated. This also fixes a bug where a NIC's MAC addresswasn't used.
Use reserved documentation IPs and domains
Use RFC 5737 IP addresses and RFC 2606 domain names in allunittests, docs, qa and docstrings.
Provide feedback function for all LU methods
By exposing mcpu's _Feedback function (now renamed to “Log”) to LU's,methods like ExpandNames can also write to the job execution log.
jqueue: Setup inotify before checking for any job changes
Since the code waiting for job changes was modified to use inotify,a race condition between checking for changes the first time andsetting up inotify occurs. If the job is modified after the check...
cli.SubmitOpCode: Support custom job reporter
This is necessary to reuse SubmitOpCode while adding processing forcustom message types.
Add function to format all job log messages
Just calling utils.SafeEncode on the log message failed when itwasn't of the type ELOG_MESSAGE and not a string. Now non-messagelog entries are formatted using repr().
baserlib: Fix feedback function
The feedback function is called with only one parameter, a tuplewith the message details.
Confd IPv6 support
This patch series basically adds a new parameter 'family' to the constructorsof daemon.AsyncUDPSocket and confd.client.ConfdUDPClient. This enables theusers of these two classes to support IPv6.
In ganeti-confd.ConfdAsyncUDPClient a method to check the address families of...
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.
LXC: Fix wording of error messages
LXC: Fix GetInstanceInfo()
Don't try to get cgroups info if instance is not running.
Signed-off-by: Iustin Pop <iustin@google.com>Reviewed-by: Manuel Franceschini <livewire@google.com>
Enable from-repository builds on old distributions
… or on distributions which simply have other implementations of man,that do not support '--warnings'.
Introduce lib/netutils.py
This patch moves network utility functions to a dedicated module.
LXC: Fix GetAllInstancesInfo()
Add oper_vcpus instance status field
This introduces a new instance status field, named "oper_vcpus".It contains the actual number of VCPUs an instance is using asseen by the hypervisor.
LUCreateInstance: use cluster-wide iallocator
LUCreateInstance uses the cluster-wide default iallocator if no iallocator orprimary node is specified manually.
Signed-off-by: Apollon Oikonomopoulos <apollon@noc.grnet.gr>Signed-off-by: Iustin Pop <iustin@google.com>...
LUNodeEvacuationStrategy: Use default iallocator
Signed-off-by: Apollon Oikonomopoulos <apollon@noc.grnet.gr>Signed-off-by: Iustin Pop <iustin@google.com>Reviewed-by: Iustin Pop <iustin@google.com>
Add default_iallocator cluster parameter
Add a cluster parameter to hold the iallocator that will be used by defaultwhen required and no alternative (manually-specified iallocator ormanually-specified node(s)) is given.
Signed-off-by: Apollon Oikonomopoulos <apollon@noc.grnet.gr>...
Document the default instance allocator in gnt-cluster.sgml
Add _CheckIAllocatorOrNode for common iallocator/node checks
_CheckIAllocatorOrNode will be called by LUs wishing to use an instanceallocator or a target node. It performs sanity checks and will modify the LU'sopcode's iallocator slot to use the cluster-wide allocator if...
_CheckIAllocatorOrNode unit tests
Add unit tests to check the function of _CheckIAllocatorOrNode
LXC: Report actual number of CPUs
Mlockall: decrease warnings if ctypes module is not present
Node daemon prints a lot of warnings if --no-mlock option is not specified andctypes module is not present.
With the following patch the warning is printed only at noded startup.
Signed-off-by: Luca Bigliardi <shammash@google.com>...
Add a delay in master failover
I have seen some very seldom errors where (it seems) the address isstill live for a short while after removing it from the old master, thusthe new master will fail in startup/adding its own IP address.
To prevent against this, we add a delay/retry before we proceed, if the...
LXC: add lxc.console to the generated lxc.conf file
LXC: Use lxc-info to get instance info
Conflicts: qa/qa-sample.json (trivial) qa/qa_cluster.py (trivial)
Signed-off-by: Iustin Pop <iustin@google.com>Reviewed-by: Luca Bigliardi <shammash@google.com>
QA, burnin: allow selection of reboot types
After some more investigation, only the soft reboot type fails for Xen3.4 (due to the reboot/uptime time counter). As such, it's better toallow selective testing, since we do want to test in general theseopcodes/the command line script....
Fix opcode transition from WAITLOCK to RUNNING
With the recent changes in the job queue, an old bug surfaced: we neverserialized the status change when in NotifyStart, thus a crash of themaster would have left the job queue oblivious to the fact that the job...
cli.JobExecutor.WaitOrShow: always return status
Currently, for the 'wait' case, we return a list of tuples (status,result), in the order of submitted jobs, but we don't return anythingfor the no-wait case.
This patch changes the no-wait case to return a list of tuples (status,...
gnt-instance: fix GenericManyOps
Currently, GenericManyOps ignores the actual success or failure resultsfrom the invididual jobs. We change this to return '0' (i.e. success)only when all jobs failed, as many times we have just one job.
Together with the JobExecutor change, this will report failures...
Rework the export failure handling
Currently, the way to signal export failures is by the return value.This means that if a client doesn't check the values (e.g. burnin), anyfailure is being ignore. And this is what we've been doing forever inburning (not actually testing that the export is successful)....
Fix a typo in gnt-instance's man page
Add utils.GetMounts()
LXC: use utils.GetMounts()
hv_chroot: use utils.GetMounts()
gnt-cluster: deal with drbd helper in init/modify/info
Add drbd helper and storage options
Report drbd helper in query info LU
Check and set drbd helper in set params LU