Codestyle updates for locking code
Reviewed-by: ultrotter
LockSet: make acquire() able to get the whole set
This new functionality makes it possible to acquire a whole set, by passing"None" to the acquire() function as the list of elements. This will avoid newadditions to the set, and then acquire all the current elements. The list of...
LockSet: encapsulate acquire() in try-except
This patch adds a try/except area around most of the acquire() code (everythingafter the intial condition checks). Since the except: clause contains just a'raise' nothing really changes except the indentation of the code....
Make LockSet.__names() return a list, not a set
Previously the private version of the __names function returned directly a set.We'll keep this in the public interface but change the private version to alist in order to be able to sort() its result and then loop on it, even though...
LockSet: improve remove() api
Lockset's remove() function used to return a list of locks we failed to remove.Rather than doing this we'll return a list of removed locks, so it's moresimilar to how acquire() behaves. This patch also fixes the relevant unit tests....
LockSet: make acquire() return the set of names
In a LockSet acquire() returned True on success. This code changes that toreturn a set containing the names of the elements acquired. This is still atrue value if we acquired any lock but is slightly more useful (because if...
LockSet: invert try/for nesting in acquire()
This patch changes nothing to the functionality of a LockSet. Rather thantrying to do the whole for loop we try each of its steps. This opens the way tohandle differently a single failure.
Reviewed-by: imsnah
Initial GanetiLockManager implementation
Includes some locking-related constants and explanations on how theLockManager should be used, the class itself and its test cases.
The class includes: - a basic constructor - functions to acquire and release lists of locks at the same level...
Fix master role stop on cluster destroy
Currently the cluster destroy doesn't remove the master role, whichmeans that the IP address of the cluster remains assigned to the masternode.
This patch fixes this and also a docstring in backend.StopMaster()....
Implement QA tests for gnt-cluster rename
Fix cluster rename operation
This one-liner fixes the cluster rename operation. As a side note, weshould have a QA test for this too.
LockSet: make acquire() fail faster on wrong locks
This patch makes acquire() first look up all the locks in the dict and then tryto acquire them later. The advantage is that if a lockname is already wrongsince the beginning we won't need to first queue and acquire other locks to...
LockSet implementation and unit tests
A LockSet represents locking for a set of resources of the same type. A threadcan acquire multiple resources at the same time, and release some or all ofthem, but cannot acquire more resources incrementally at different times...
Fix the gnt-cluster init man page
Some options were missing in the gnt-cluster init man page. This patch addsthem, removes an empty line, and clarifies a bit more some requirements.
Reviewed-by: schreiberal
Don't allow renaming to an existing instance
Even if the target instance is down or we are not checking for IP conflictschanging an instance name to a new one which is already in the cluster isdoomed to fail, because in a lot of places (among which figures the mind of...
Clarify online help for xc-instance reinstall.
Use constants.ETC_HOSTS instead of string for /etc/hosts
Reviewed-by: iustinp
Distribute lib/locking.py
Split GanetiUnitTest into testutils.py
Update svn:ignore properties
Reviewed-by: iustin
Some changes on disk failure tests
Change comments to printed information, some cleanup. These changesare from November 2007. The test is not perfect yet.
This patch replaces some hardcoded strings with their corresponding constant in `_GenerateDiskTemplate()`.
Improve ganeti example cron file
The cron file in ganeti's example directory is now static, and executesganeti-watcher in /usr/local/sbin no matter where it's really installed. Withthis patch we generate it at build time substituting the right value of...
Small comment fix.
Fixes small spell mistakes and comments
Break trunk by removing twisted
This patch switches from the twisted usage for inter-node protocol tosimple BaseHTTPServer/httplib. The patch has more deletions because weuse no authentication, no encryption at all.
As such, this is just for trunk, and only for testing. What it brings is...
Add a few SharedLock delete() tests
- Check that even a shared acquire() fails on a deleted lock- Check that delete() fails on a lock you share (must own it or nothing)
These are assumptions I build on in future code, so better check for them.Currently no code change is necessary for them to be valid....
SharedLock: fix a wrong unit-test helper code
The _doItDelete helper code was supposed to be used to dispatch threads thatdeleted the SharedLock. It actually just acquired it exclusively. This remainedunnoticed as the helper thread is just used to test interaction, not the delete...
Add another 1.1->1.2 compatibility alias
gnt-instance replace-disks used to be called replace_disks.
Add the delete() operation to SharedLock
This new operation lets a lock be cleanly deleted. The lock will be exclusivelyheld before deletion, and after it pending and future acquires will raise anexception. Other SharedLock operations are modify to deal with delete() and to...
Fix a couple of SharedLock docstrings
Use the actual class name rather than a spaced version of it.
Update version numbers for the 1.2.3 release
Note: we don't update for now the install.sgml file with the new versionnumber, as there are no other changes. We'll update the web site toindicate that the current install.html document is valid for 1.2.3 too....
Revert "Include the DRBD upgrade tool in the dist archive"
This reverts commit 604 as the upgrade tool should not be in the 1.3 branch.
Update online help and manpage to include drbd disk type.
Include the DRBD upgrade tool in the dist archive
This patch adds the DRBD upgrade tool in the archive and in theinstalled tools dir, and its associated README in the doc_DATA target.
Fix gnt-instance info i1 i2 ...
Due to an indentation error only the last instance queried got returned byLUQueryInstanceData. Moving the append() call inside the for cycle to fix thisissue.
This is a one-liner targeted at 1.2.3
Replace version number in install.sgml during build time
Further fixes for the 'export MAC in hooks' change
QA suite which tests gnt-instance modify has uncovered another issue related tomac export.
Alter the device activation code
This tiny patch fixes the breakage that the previous patch aboutactivation did by removing the Close() call after activation.
The initial reason for that call was that if the device is alreadyactive and open, but we need it closed, we close it automatically....
Two small improvements to burnin
This tiny patch fixes the verbose option to actually work, and also whencreating instances it logs the secondary node too (even if this doesn'tapply for plain templates, it doesn't create an error).
Modify the default output of gnt-instance list
This patch adds a new field available for selection in gnt-instance listnames "status" which represents the combined value of "admin_state" and"oper_state". Since this is much easier to parse (e.g. gnt-instance list...
Code style updates for QA code.
Parse double protocol version in drbd8.2
DRBD 8.2 uses a double integer field ad protocol version, rather than a singleone. This patch fixes the ganeti parsing code, allowing both the old and thenew version type. In order to do so the internal _GetVersion function is...
Fix a wrong OP_ID added in r261
Shared Lock implementation and unit tests.
Adding a locking.py file for the ganeti locking library. Its first component isthe implementation of a non-recursive blocking shared lock complete with atesting library.
Reviewed-by: imsnah, iustinp
Document the client API protocol, first version
This patch adds some documentation about the proposed client API. It'snot yet complete, but should be a usable draft for the initialimplementation.
Add a test opcode that sleeps for a given duration
This can be used for testing purposes.
Reviewed-by: ultrotter,imsnah
Reduce the chance of DRBD errors with stale primaries
This patch is a first step in reducing the chance of causing DRBDactivation failures when the primary node has not-perfect data.
This issue is more seen with DRBD8, which has an 'outdate' state (inwhich it can get more often). But it can (and before this patch, usually...
Fix some indendation issues
Fix incomplete mac address export to hooks
This patch completes the change introduced in r566 (trunk) and r568(branch-1.2).
Give mac information to instance hooks
Currently just the bridge and ip address are passed. Add an environmentvariable for the mac address.
Make the mouse more usable in VNC for HVM.
Export bridge information too
gnt-backup export used to export the ip and mac of each nic, but not whichbridge it was connected to. Adding this information.
Fix online help for gnt-backup import
The help string missed drbd as a disk template option. Adding it.
Bump version numbers for the 1.2.2 release
tiny typo fix
Improve the documentation of query output fields
The gnt-node and gnt-instance list commands have a customizable list ofoutput fields, but the list is not up to date (in the man page) and noteasily understandable from the ‘--help’ output.
This patch updates the man pages and adds the available fields and...
Fix a typo in a devel/upload comment
Files are uploaded to $prefix/sbin, not $prefix/bin
Add QA tests for gnt-instance modify
This patch adds QA tests for most of the possible parameters in theinstance modify operation (exception being the MAC), and modifies thesample QA file to run this test.
It also tests the no-modification test, but that is a weak one: we only...
Add option for the number of VCPUs in instance listing
Allow selection of hypervisor type in QA
This patch allows the selection of the hypervisor type for the QAprocess; this is useful when testing hypervisor-independent changes thatdon't require a Xen setup.
The patch also fixes the OS name in the sample QA config file provided....
Fix "gnt-instance modify --initrd"
The new QA tests for instance modify uncovered a bug in the modifyinitrd operation when setting the initrd to none.
Fix gnt-instance modify breakage due to hvm_boot_order
As reported by hypnoce@gmail.com, this is missing a check on None. As we don'tcare about uppercase, we keep the check simple by removing the lower() call.
Add a missing parenthesis
It was wrongly deleted when converting
if a in dict.keys():toif a in dict:
Change the install directory for the tools
Currently, the tools are installed under $prefix/share/ganeti. Thisprevents installing other things in a nice way under share/ganeti (likearch-independent OS definitions), therefore we want the tools to liveunder share/ganeti/tools....
Remove qa tests for gnt-instance start/stop
Those tests were added in the wrong place. This patch removes them. One daywe'll implement proper command line regression testing and they should go inthere.
Test start/stop aliases in qa
This tests both that those two aliases have not been removed and also thataliases handling hasn't been broken.
Add a few aliases for startup/shutdown
These aliases are widely used to think of these operations and save some typingtoo. Even though there is some thought to make start/stop the default operationname I don't think this should happen for 1.2, for now adding it as an alias is...
Add the first command alias
Alias activate_block_devs to activate-disks, for ganeti 1.1 compatibility.
Add support for command aliases
Passing a new aliases dict to generic main we can easily support aliases forcompatibility reasons or simply useability.
Add tool to ease testing of unsubmitted patches
The upload tool can be used to submit the current code to an arbitrary list ofnodes. This helps developers in easily testing their changes before submittingthem.
Check that we have a valid export list
Before iterating over the list of exports present on a node, check that whatganeti returned is actually a list. This solves the case when one of the nodesis down, and an error value is returned.
This fixes issue 21...
Fix VG listing broken by r510
LVM code sometimes adds an extra separator at the end of the field list.Make the code strip it if exists.
Make backend._GetVGInfo check the validity of 'vgs'
Currently, the function backend._GetVGInfo only checks for errors viathe exit code of the 'vgs' command. However, there are other ways offailure so we need to also check for valid output before parsing....
Fix checking of node free disk in CreateInstance
This patch does two things: - checks that the result values from call_node_info are valid integer values and aborts otherwise - skips disk space computation for the DT_DISKLESS case
The most important point of the patch is the verification of results...
Abstract node memory checking into a separate function
The checking of a node's free memory (via rpc.call_node_info) is done inboth start instance an failover. This patch abstracts this call,together with the appropriate error handling, into a separate function...
Change a hardcoded path into its proper constant
The function backend.UploadFile still uses "/etc/hosts" directly insteadof the existing constant; this patch fixes this.
Allow use of 'diskless' disk template in burnin
Even if this doesn't have any practical use for actually creatinginstances, it can be used for very fast burnin and testing just theadd/start/stop/remove functionality.
This has also revealed a bug in export/import related to diskless...
Fix run directory for the fake hypervisor
Currently the fake hypervisor has hardcoded ‘/var/run’ as a basedirectory for its store. This patch adds a constant RUN_DIR that is usedfor both the fake hypervisor and for BDEV_CACHE_DIR.
Fix the init.d script
The script (which is geared towards Debian) is actually not fullycompliant, as lintian generates a warning on it - the S runlevel is nota valid one in the "Stop" stanza. This patch removes "S" from the stoplist.
Fix the make dist rule
In revision 459 I added a bug in the make dist rule in the sense thatthe archive will include all of test/data directory, including the.svn directory if it exists.
This patch fixes that problem and adds a distcheck hook that tests for...
Bump version numbers for the 1.2.1 release
This a merge to trunk of revision 494.
Show the HVM boot order in instance info
This is a merge from the 1.2 branch
Two small style fixes
Make instance start/stop skippable at burnin time
Even though burnin was born just to do that test it now contains a lot morethings one might try, so it makes sense to make instance start/stop optionaltoo.
This creates a burnin that at the bare minimum tests instance create and...
Do instance export and import during burnin
Instances get exported to a remote node, then removed and imported back totheir original nodes. This should be an idempotent option from the instancepoint of view, and help making sure ImportExport is kept up to date....
Allow burnin to take "-t plain" as an option
The burnin code deals with "-t plain", but the command line parserdoesn't allow that as an option. This patch fixes this issue.
Fix some misspellings
This patch fixes two name typos and a style issue (which makes pylintcomplain).
Fix CreateInstance new optional parameters
Some new paramenters of the CreateInstance opcode are optional (namelykernel_path, initrd_path and hvm_boot_order) but their absence makes the codecrash. Fix this by initializing them to a default value if they're not present....
Add mac="auto" at import time
Mac is now a mandatory option for OpCreateInstance. Add it when we call thisopcode at import time too. This is a quick fix for the code, but probably morework needs to be done to integrate mac addresses with the import/export...
Support selecting the boot device order for HVM.
This patch adds support for specifying and changing the boot device order forHVM instances. The boot device order specification is ignored for non HVMinstances.
Complete --node description for gnt-backup(8)
The second paramenter of --node was not described in gnt-backup. Addinformation about it.
Update gnt-backup(8) -m option explanation
Copy it from gnt-instance(8) for uniformity
Add the --swap-size option gnt-backup(8)
gnt-backup import doesn't allow to chose the os
Since it's an import the os is implied to be the one which performed theexport. No -o option is accepted. Reflect this in the manpage.
Fix gnt-backup import -s option
Update gnt-backup import to be in line with gnt-instance add about the os disksize option. Thanks to Gunnar Wagenknecht for spotting the issue.
Add boot_order entry to Instance object.
First step to support custom boot device order for HVM instances, add alocation to actually store that information for the instance.
Add the new OpCreateInstance parameters to burnin
Fix gnt-instance modify breakage introduced in r462
Update manpages with the kernel/initrd options
This patch modifes the ‘gnt-instance’ instance manpage with the new‘--kernel’ and ‘--initrd’ options.