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 <leczb@google.com>Reviewed-by: Iustin Pop <iustin@google.com>
LXC: Fix wording of error messages
LXC: Fix GetInstanceInfo()
Don't try to get cgroups info if instance is not running.
Merge branch 'devel-2.1'
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.
Signed-off-by: Manuel Franceschini <livewire@google.com>Reviewed-by: Iustin Pop <iustin@google.com>
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
Signed-off-by: Luca Bigliardi <shammash@google.com>Reviewed-by: Iustin Pop <iustin@google.com>
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
Signed-off-by: Iustin Pop <iustin@google.com>Reviewed-by: Michael Hanselmann <hansmi@google.com>
Add utils.GetMounts()
Signed-off-by: Balazs Lecz <leczb@google.com>Reviewed-by: Michael Hanselmann <hansmi@google.com>
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
Check and set drbd helper during bootstrap
Add drbd_helper rpc call
Check drbd usermode helper in cluster verify
Set drbd usermode helper on config upgrade
Generalize a recursive check on logical disks
Add drbd_usermode_helper to configuration
VerifyNode: add usermode helper reply
BaseDRBD: provide a way to query usermode_helper parameter
Fix a broken commandline switch option
Signed-off-by: René Nussbaumer <rn@google.com>Reviewed-by: Michael Hanselmann <hansmi@google.com>Signed-off-by: Iustin Pop <iustin@google.com>Reviewed-by: Iustin Pop <iustin@google.com>
Add a QA option to disable reboots during burnin
Since we have seen cases where (repeated) reboots are not supported(e.g. Xen 3.4+), we need to be able to control this in the QAconfiguration.
Check pycurl module at configure time
Signed-off-by: Guido Trotter <ultrotter@google.com>Reviewed-by: Michael Hanselmann <hansmi@google.com>
OpCreateInstance: do not require hv/be/os params
It is perfectly legal to create an instance using only defaults(although beparams will be most times passed in), so let's relax therequirement for these three parameters.
Signed-off-by: Iustin Pop <iustin@google.com>...
Fix ganeti-rapi version string
This was "broken" for almost a year :)
Signed-off-by: Iustin Pop <iustin@google.com>Reviewed-by: Guido Trotter <ultrotter@google.com>
Silence the check-dirs check
The big shell fragment is just noise, for the common case where itdoesn't fail.
A few more type definitions
This is to simplify the type declarations in the actual LUs.
Make _CheckDiskTemplate a valid type checker
Rework the "type" system
This patch merges the _OP_REQP and _OP_DEFS class attributes into a_OP_PARAMS list, which holds both. The associated unittest checks thatall opcode attributes are declared and checked, and that no LU uses theold fields (could be removed later)....
Remove _CheckBooleanOpField
This is no longer used, and we can remove it.
Merge branch 'stable-2.1'
Bump up version for 2.1.5 release
Also update the release date and the NEWS file.
RapiClient: fix multi-authentication in Python 2.6
In Python 2.6 the urllib2.HTTPBasicAuthHandler has a "retried" count forfailed authentications. The handler fails after 5 of them. To solve thiswe reset the handler's "retried" member variable to 0 after every...
Remove rapi-user and rapi-pass from qa-sample.json
After commit 725ec2f10019c35bafeb1aabfce6f14174bf4f46 they are unused.
utils.OwnIpAddress: Change try/except for Python 2.4
Python 2.4 doesn't support “except” and “finally” in the same block.
Signed-off-by: Michael Hanselmann <hansmi@google.com>Reviewed-by: Iustin Pop <iustin@google.com>
RAPI client: Switch to pycURL
Currently the RAPI client uses the urllib2 and httplib modules fromPython's standard library. They're used with pyOpenSSL in a very fragileway, and there are known issues when receiving large responses from a RAPIserver....
baserlib: Use boolean type for boolean variables
This does not yet fix all issues in the RAPI interface which wereintroduced with the type system. More testing is needed.
qa: fix gnt-instance modify -t drbd
We need to pass the secondary node name, not a dict, which is an invalidvalue.
Fixing Makefile.am to reflect the document move and adding of cluster merger
Signed-off-by: René Nussbaumer <rn@google.com>Reviewed-by: Iustin Pop <iustin@google.com>
Adding a user document for the use of cluster-merge
Signed-off-by: René Nussbaumer <rn@google.com>Reviewed-by: Michael Hanselmann <hansmi@google.com>
Move cluster merger design doc to design-2.1.rst
qa: shutdown instance before trying disk convert
Because we have to. :)
Signed-off-by: Guido Trotter <ultrotter@google.com>Reviewed-by: Iustin Pop <iustin@google.com>
Fix check in gnt-instance modify -t
Currently when changing the instance disks the instance status (whichmust be down) is only checked if the target status is among the mirroredones. This is incorrect: the instance must be down either way, even ifthe desired final status is non-mirrored....
Modify gnt-instance rename to support --no-check-name
Adding check_name option to the opcode and luxi call for instance rename
This will allow instance rename without dns check as it does for instanceadd.
Enable utils.OwnIpAddress to work with IPv6 addresses
Currently a TcpPing using the target address as source is used todetermine wheter or not an IP address belongs to a node. This does notwork for IPv6 anymore (I'm not sure why) as binding to IPv6 localhost as...
Barebones LXC hypervisor
This needs lots of work, but it can successfully launch an LXC-basedinstance. See the docstring for the limitations/work to be done.
Signed-off-by: Iustin Pop <iustin@google.com>Reviewed-by: Balazs Lecz <leczb@google.com>
Document optional ctypes dependency
Signed-off-by: Luca Bigliardi <shammash@google.com>Reviewed-by: Guido Trotter <ultrotter@google.com>
DRBD IPv6 support
Support IPv6 configuration for 'drbdsetup show' parser and add unittestsconcerning that case. Renames some data files to use consistent namesclarifying their usage.
Signed-off-by: Manuel Franceschini <livewire@google.com>Reviewed-by: Michael Hanselmann <hansmi@google.com>
IPv6 support for utils.TcpPing()
Add function to retrieve family of an ip address
Signed-off-by: Manuel Franceschini <livewire@google.com>Reviewed-by: Guido Trotter <ultrotter@google.com>
Introduce utils.IsValidIP{4,6}()
This patch introduces functions to check for valid IPv4 and IPv6addresses and converts IsValidIP() to return True if it is either a IPv4or a IPv6 address.
For now we do not change the functional behavior and replace IsValidIP...
User assertFalse instead of assert_(not ...)
Fix osparams bug when gnt-cluster modify'ing
Commit 625ac1135834c27a2e78fd61bf2df2ce29ad2966 introduced 'osparams'slot in OPSetClusterParams which was not passed when invoked viagnt-cluster modify.
Signed-off-by: Manuel Franceschini <livewire@google.com>...
Introduce IPv6 constants
Replace '0.0.0.0' with constant
Rename some constants to facilitate IPv6 support
Add missing pylint disable for "except:"
Why it's needed here but not a few lines above is a mistery that onlypylint understands.
Also fix an indentation error in another disable, for the same function.
Signed-off-by: Guido Trotter <ultrotter@google.com>...
Adding design-doc for privilege separation work done on Ganeti 2.2
Update NEWS for the 2.1.5 release
Pass force variant option at instance creation
This was supposed to be done in"06073e857e3b518c7195d57306ae01793240c0c2" but by mistake the field wasadded to batch create rather than the normal instance create.
masterd: use AsyncTerminatedMessageStream for luxi
Each luxi connection now creates an asyncore MasterClientHandler (whichis an AsyncTerminatedMessageStream subclass, sending each message to aclient worker). This makes it harder to DOS the master daemon by just...
Fix a few uncommon pylint errors in compat.py
- It's ok if the optional modules functools, roman and hashlib are not there.- It's ok to reference any and all before defining them. We're doing all this exactly because, under python 2.4, they are undefined....
BatchCreate: get force_variant from specs not opts
There is no such option on the command line, and for batch creation it'sbetter to get the option from the json file (with a default of false, aswe fixed it in the previous patch).
AsyncTerminatedMessageStream: send_message
This function adds the ability for a AsyncTerminatedMessageStream tohave a thread-safe message delivery function.
AsyncTerminatedMessageStream: limit message count
Currently the message stream can process any number of messages inparallel (if they get dispatched to different threads or processes).In order to limit their number we only handle messages and read from...
Add test script for cfgupgrade
This should catch cases where we update the configuration version, butforget to adjust cfgupgrade accordingly.
Signed-off-by: Michael Hanselmann <hansmi@google.com>Reviewed-by: Guido Trotter <ultrotter@google.com>
cfgupgrade: Add option to override config verification
This is needed in a new test script for cfgupgrade where it's betterto only use the minimum parts necessary for testing cfgupgrade.Including full configuration data to ensure verification doesn't fail...
cfgupgrade: Fix bug when checking configuration directory
In the condition for checking the configuration directory, one “or” should havebeen an “and”. This bug was in cfgupgrade since commit 95e4a8142 (June 2008).Found thanks to a test script.
Signed-off-by: Michael Hanselmann <hansmi@google.com>...
cfgupgrade: Add support for Ganeti 2.2
Since configuration changes are now usually done in the configurationwriter class, cfgupgrade's only task is to change the config version.This means we can easily support upgrading from Ganeti 2.0 and 2.1 to2.2....
Remove dead code from cfgupgrade
Three constants were no longer user after commit 11c31f5cb5, whichremoved support for upgrading from Ganeti 1.2.
BatchCreate: set a default for force_variant
Currently if the json file doesn't contain a "force_variant" parameterBatchCreate stracktraces. We add a default so passing it explicitely isnot needed.
Signed-off-by: Guido Trotter <ultrotter@google.com>Reviewed-by: Balazs Lecz <leczb@google.com>
Better specify old object slots removal policy
The comments seem to imply we can remove deprecated slots after 2.1 isreleased. This is not quite true, if we still want to support upgradingstraight from 2.0. So let's specify better that they can be removed only...
Fix a type declaration error in LUTestAllocator
Also, improve logging of type errors, to ease debugging.
Fix _UpgradeConfig docstring
jqueue: remove the _big_jqueue_lock module global
By using ssynchronized in the new way, we can remove the module-global_big_jqueue_lock and revert back to an internal _lock inside the jqueue.