Force tap's MAC prefix to "fe"
Setting a high prefix discourages the bridge from adopting the tap'sMAC. Xen is not affected by this since the MAC is forced to"fe:ff:ff:ff:ff:ff".
This addresses issue #217.
Signed-off-by: Iustin Pop <iustin@google.com>...
Fix decorator uses which crash newer pylint
Pylint version:
pylint 0.25.1, astng 0.23.1, common 0.58.0
crashes when passing the fully-qualified decorator name with:
File "/usr/lib/pymodules/python2.7/pylint/checkers/base.py", line 161, in visit_function...
Extend burnin to do NIC changes
This would have caught our previous issue, since QA otherwise doesn'tdo add, remove or changes of NICs.
Signed-off-by: Iustin Pop <iustin@google.com>Signed-off-by: René Nussbaumer <rn@google.com>Reviewed-by: Michael Hanselmann <hansmi@google.com>
Upgrade wrong iv_names at cfgupgrade time
Since Ganeti 2.6 does warn about disks with wrong iv_names, it wouldbe better to fix them when upgrading to 2.6.
Not sure if this is too brittle and whether we want to add moresafeguards on the contents of the config/instance/disks before...
Fix epydoc raises L{...} usage
For epydoc raise statement, it already expects an exception which willbe hyperlinked; if passing an L{…} construct, it will instead breakthe formatting (the @raise will not be recognised, but merged into theprevious paragraph)....
Merge branch 'stable-2.5' into stable-2.6
Signed-off-by: Michael Hanselmann <hansmi@google.com>Reviewed-by: Iustin Pop <iustin@google.com>
kvm-ifup: Use /bin/bash
As reported by Ben Beuchler, kvm-ifup uses bash-specific constructs anddoesn't work with Ubuntu's default shell. We use bash all over the placeanyway, so changing the shebang line is the easiest solution.
Signed-off-by: Michael Hanselmann <hansmi@google.com>...
Adjust cfgupgrade for new minor version
Also does some abstracting of the versions.
Signed-off-by: Iustin Pop <iustin@google.com>Reviewed-by: Michael Hanselmann <hansmi@google.com>
Preserve bridge MTU in KVM ifup script
Closes: #201 - KVM_IFUP does not set bridge-MTU on tap devicesSigned-off-by: Andrea Spadaccini <spadaccio@google.com>Reviewed-by: Iustin Pop <iustin@google.com>Reviewed-by: Michael Hanselmann <hansmi@google.com>(cherry picked from commit a1ec8695a6b453acdc2fa746a27be73c614b2e87)...
Enable lvmstrap to run under Linux 3.x
Extend the kernel version check to also accept Linux 3.x as valid.
Signed-off-by: Alexander Schreiber <als@google.com>Signed-off-by: Iustin Pop <iustin@google.com>Reviewed-by: Iustin Pop <iustin@google.com>(cherry picked from commit 1bf72492d381aacb5c488f1a87ac7665b9ddc6c7)...
Make setup-ssh behave more friendly
So while testing my previous patch I run setup-ssh manually withoutany arguments, and it did nothing (no complains, no messages,anything). That was very surprising, so let's make it behave better ifno nodes are passed....
Silence Paramiko deprecation warnings
This works around a problem in Paramiko, but which looks like it's aGaneti problem:
[cluster] root@node4:~# gnt-node add --readd node3/usr/lib/python2.6/dist-packages/Crypto/Util/randpool.py:40:RandomPool_DeprecationWarning: This application uses RandomPool, which...
Signed-off-by: Alexander Schreiber <als@google.com>Signed-off-by: Iustin Pop <iustin@google.com>Reviewed-by: Iustin Pop <iustin@google.com>
Replace single- with double-quotes
In at least two cases "%s" is replaced with str(), too.
fmtjson: A tool to format JSON data
While debugging an issue recently I had the pleasure of looking at along, single-line string of JSON data. This simple utility makes itpossible to format such data into a readable format.
Implement rbd disk template
Introduce the rbd disk template, which handles provisioning andmanagement of instance disks as block devices mapped to rbd volumeson a RADOS cluster.
The rbd template is of type DTS_EXT_MIRROR, meaning rbd-basedinstances can failover or migrate to any node, without...
Merge branch 'devel-2.5'
Fix wrong option names in QA and cluster-merge
Burnin: test set-mem
Add new --maxmem-size and --minmem-size options.The old --mem-size option allows setting both at the same time.If --minmem-size is lower than --maxmem-size execute a runtime memorychange on all instances, bringing them to their minimum memory size....
Style fixes on confd-client
Oops, forgot to check this before initial commit, sorry!
Signed-off-by: Iustin Pop <iustin@google.com>Reviewed-by: René Nussbaumer <rn@google.com>
Add a small confd client
This can be used to test live servers; currently there's not directway to interact with a confd server, except for burnin's builtin tests(which were the source of this file).
Signed-off-by: Iustin Pop <iustin@google.com>Reviewed-by: Guido Trotter <ultrotter@google.com>
burnin: use mem_size as max and min
Signed-off-by: Guido Trotter <ultrotter@google.com>Reviewed-by: Iustin Pop <iustin@google.com>
Prevent runnning of confd tests in burnin
Add the default master-ip-setup script
Add a shell script that will be the default replacement for the body ofbackend.ActivateMasterIp and backend.DeactivateMasterIp.
Signed-off-by: Andrea Spadaccini <spadaccio@google.com>Reviewed-by: Michael Hanselmann <hansmi@google.com>
Revert "Implementation of TLS-protected SPICE connections"
This reverts commit b6267745ede04b3c943bc02e004bdb9347e0f564.This commit will be readded on master.
Signed-off-by: Guido Trotter <ultrotter@google.com>Reviewed-by: Michael Hanselmann <hansmi@google.com>
Closes: #201 - KVM_IFUP does not set bridge-MTU on tap devicesSigned-off-by: Andrea Spadaccini <spadaccio@google.com>Reviewed-by: Iustin Pop <iustin@google.com>Reviewed-by: Michael Hanselmann <hansmi@google.com>
cluster-merge: log an info message at node readd
node readd can take a long time, it's good to have info messages to seeprogress.
Signed-off-by: Guido Trotter <ultrotter@google.com>Reviewed-by: Andrea Spadaccini <spadaccio@google.com>
Merge branch 'stable-2.5' into devel-2.5
Use --yes to deactivate master ip in cluster merge
Use deactivate-master-ip in cluster-merge
Use the gnt-cluster deactivate-master-ip command in cluster-merge todisable the master IP.
Signed-off-by: Andrea Spadaccini <spadaccio@google.com>Reviewed-by: Michael Hanselmann <hansmi@google.com>Reviewed-by: Guido Trotter <ultrotter@google.com>...
Signed-off-by: Andrea Spadaccini <spadaccio@google.com>Reviewed-by: Michael Hanselmann <hansmi@google.com>Reviewed-by: Guido Trotter <ultrotter@google.com>
listrunner: Don't pass arguments if there are none
If no arguments were specified the “exec_args” variable was “None”,leading to the command being run as “… ./… None”.
Signed-off-by: Michael Hanselmann <hansmi@google.com>Reviewed-by: Iustin Pop <iustin@google.com>...
Initial commit for ovfconverter tool
Signed-off-by: Agata Murawska <agatamurawska@google.com>Reviewed-by: Michael Hanselmann <hansmi@google.com>
Implementation of TLS-protected SPICE connections
Added support for TLS-protected SPICE connections:
listrunner: Allow passing of arguments to executable
This wasn't possible until now.
Signed-off-by: Michael Hanselmann <hansmi@google.com>Reviewed-by: Guido Trotter <ultrotter@google.com>
DeprecationWarning fixes for pylint
In version 0.21, pylint unified all the disable-* (and enable-*)directives to disable (resp. enable). This leads to a lot ofDeprecationWarning being emitted even if one uses the recommendedversion of pylint (0.21.1, as stated in devnotes.rst)....
listrunner: Replace str.split with library functions
- str.split("/").pop() should be os.path.basename- str.split("\n") should be str.splitlines()
Delete master IPs from mergee master nodes
Added a step in cluster-merge that removes the cluster IP from themaster node of the mergee clusters.
PEP8 style fixes
Identified using the “pep8” utility.
Wrap a few long lines
Had to break it as well, today! ;)
listrunner: Avoid exception if machine is rebooted
Handle exceptions gracefully when trying to read the command's output.
Remove wrong type declaration from option
Fix wrong method name in cluster-merge
Fixed a wrong method name in the last patch.
Fix --skip-stop-instances help message
cluster-merge: Add the --skip-stop-instances opt
This option allows to do a check for running instances on the mergeeclusters instead of stopping them.
Signed-off-by: Andrea Spadaccini <spadaccio@google.com>Signed-off-by: Guido Trotter <ultrotter@google.com>...
Offline node when adding it to a merged cluster
Transform node readd exceptions into just errors
We are after the point of no return, no point in failing everythingbecause a node failed to readd. Better to just report it and move on.
Add a TODO on the VerifyCluster option
Allow retrying commands in cluster-merge
Signed-off-by: Andrea Spadaccini <spadaccio@google.com>Signed-off-by: Guido Trotter <ultrotter@google.com>Reviewed-by: Michael Hanselmann <hansmi@google.com>
Try 3 times before giving up on per-node commands
When contacting lots of nodes some may fail. Give it a couple morechances before giving up on them.
Possible future TODO: continue, but just mark them as offline.
Signed-off-by: Guido Trotter <ultrotter@google.com>...
Unify some file headers
Remove unnecessary commas, add empty lines where necessary to make themconsistent.
I'm working on a script to check this, but it's not yet ready.
Signed-off-by: Michael Hanselmann <hansmi@google.com>Reviewed-by: René Nussbaumer <rn@google.com>
cfgupgrade: Add confirmation message
A message will be given instead of just dropping the user back to theprompt in case of a successful upgrade.
[…]documentation formats). Continue with upgrading configuration?y/[n]/?: yConfiguration successfully upgraded for version 2.5.0~beta1....
cluster-merge: consider file storage enable state
There's no point in checking whether the file storage dir in the twoclusters is the same if file storage is not even enabled
cluster-merge: implement params delta mercifulness
Sometimes it's good to tell the user about parameter differences butthen proceed anyway. Strictness is still enforced for those parametersthat would break the cluster (volume group name, storage dir if file...
Bump version to 2.5.0~beta1
Merge branch 'stable-2.4'
Signed-off-by: René Nussbaumer <rn@google.com>Reviewed-by: Iustin Pop <iustin@google.com>
cfgupgrade: Remove old watcher state file
Add a flag to burnin to allow specifying VCPU count.
Signed-off-by: Pedro Macedo <pmacedo@google.com>Signed-off-by: Iustin Pop <iustin@google.com>Reviewed-by: Iustin Pop <iustin@google.com>
cluster-merge: remove a hardcoded constant
cluster-merge: add instance restart strategy opt
Right now we always restart all instances, which is not right if someinstances were already down for other reasons. Thus we add an option todecide how to handle this. The right default should be "up" which is:...
cluster-merge: remove option list from usage
It doesn't make sense to have to keep them up to date twice, and --helpalready lists all of them with help strings.
Add support for GPT by using parted for disks bigger than 2TB.
Signed-off-by: Pedro Macedo <pmacedo@google.com>Reviewed-by: Michael Hanselmann <hansmi@google.com>
Adding a wrapper around "xm console"
The wrapper will connect to the console, and check in the background ifthe instance is paused, unpausing it as necessary.
Signed-off-by: Stephen Shirley <diamond@google.com>Reviewed-by: Michael Hanselmann <hansmi@google.com>
Adding a wrapper around connecting to kvm console
Reverts the patch series about console wrappers
This reverts commits 030a9cb8022b83bf43ec14dfbafd943299bc01c4 andae082df0000a785b693b2f4aa434650a81a94bdf.
There are two problems:
- Makefile.am breakage, which is trivial to revert- unittest breakage, which honestly I'm not sure how to fix and how...
Merge branch 'devel-2.4'
Merge branch 'stable-2.4' into devel-2.4
Add error checking and merging for cluster params
Set the default stderr logging level to WARNING so the relevant outputcan be seen.
Signed-off-by: Stephen Shirley <diamond@google.com>Reviewed-by: René Nussbaumer <rn@google.com>
cfgupgrade: really ignore hostname when told so
cfgupgrade provides a --ignore-hostname option, however consequently itspawns config.ConfigWriter, which refuses to handle a foreignconfiguration file by default.
config.ConfigWriter provides a relative keyword argument,...
Revert "Only merge nodes that are known to not be offline"
This reverts commit 288f240f62dafa8bd8ba7482c8367adbdf6d96c2.
That commit was buggy at various levels: - broke ssh access to the second cluster, making cluster-merge unusable (unless ssh key were previously setup?)...
cluster-merge: only operate on online nodes
The node list in MergerData is used only to: - stop ganeti on the nodes - readd the nodes to the clusterAs such offline nodes should be skipped from it.
Only merge nodes that are known to not be offline
Otherwise the readd will fail, breaking the merge.
Signed-off-by: Stephen Shirley <diamond@google.com>Reviewed-by: Iustin Pop <iustin@google.com>
cfgupgrade: Fix critical bug overwriting RAPI users file
The cfgupgrade tool was designed to be idempotent, that means it couldbe run several times and still give produce the correct result. Ganeti2.4 moved the file containing the RAPI users to a separate directory...
Shared file support for tools/burnin
Make burnin work with -t sharedfile and update burnin's help.
Shared block storage support is not included, as currently there is no way toprovision shared block storage from within Ganeti.
Signed-off-by: Apollon Oikonomopoulos <apollon@noc.grnet.gr>...
Rename DTS_NET_MIRROR to DTS_INT_MIRROR
DTS_INT_MIRROR better contrasts DTS_EXT_MIRROR.
Signed-off-by: Apollon Oikonomopoulos <apollon@noc.grnet.gr>[iustin@google.com: updated patch for changed context]Signed-off-by: Iustin Pop <iustin@google.com>Reviewed-by: Iustin Pop <iustin@google.com>
Fix typo in kvm-ifup script
Reported-by: Bas Tichelaar <bas@30loops.net>Signed-off-by: Michael Hanselmann <hansmi@google.com>Reviewed-by: Guido Trotter <ultrotter@google.com>
Fix pylint warnings
- 1 80-char line infraction- 4 changes in how arguments are passed to logging functions- 3 pylint disable-msg's because cluster-merge needs to access ganeti config internals
Signed-off-by: Stephen Shirley <diamond@google.com>Signed-off-by: Guido Trotter <ultrotter@google.com>...
Add support for merging node groups
Add option to rename groups on conflict
Don't remove master_candidate flag from merged nodes
Prevents lots of spurious warnings like:2011-02-10 17:00:22,776: CRITICAL Configuration data is not consistent:Not enough master candidates: actual 3, target 4
Signed-off-by: Stephen Shirley <diamond@google.com>...
Use a consistent ECID base
ECID was being calculated completely differently in__MergeNodeGroups() and _MergeConfig()
listrunner: convert from getopt to optparse
The “-A” (use agent) was not documented, and instead of adding manuallisting, I converted it to optparse like the other CLI tools.
Note that I cleaned up a bit the usage and help texts.
listrunner: fix agent usage
By delaying the agent key query until after the fork, we prevent theproblem of simultaneous access to the agent.
Tested that it works against 80 hosts in parallel without error; thecurrent version breaks already at 20 hosts....
Revert "Disable the cluster-merge tool for the moment"
This reverts commit c0711f2cb989facd60430ab18c5b0e59a1f279ac.
Signed-off-by: Stephen Shirley <diamond@google.com>Signed-off-by: Iustin Pop <iustin@google.com>Reviewed-by: Iustin Pop <iustin@google.com>
Fix cluster-merging by not stopping noded
cli.RunWhileClusterStopped() stops noded on all of the nodes in theoriginal cluster. This prevents /etc/hosts updates on the master, andconfig redistribution doesn't reach the other nodes in the originalcluster. As all we want to do is merge while the master is stopped,...
Minor reordering to match param order
Use gnt-node add --force-join to add foreign nodes
Fix iterating over node groups
Current line tries to unpack dict incorrectly
Disable the cluster-merge tool for the moment
Hopefully this can be fixed before the final 2.4 release…
Signed-off-by: Iustin Pop <iustin@google.com>Reviewed-by: René Nussbaumer <rn@google.com>Reviewed-by: Stephen Shirley <diamond@google.com>
utils.SetupLogging: Make program a mandatory argument
It's passed in by most users (daemons, CLI scripts) and for the others(burnin, watcher) it certainly doesn't hurt, especially when usingsyslog.
burner: Trivial code cleanup
- Use constant for exit value- Configure logging from main function, not from class' “__init__”
burnin: Reuse existing function for debug value
Instead of using its own, burnin can use cli.SetGenericOpcodeOpts.
Merge node groups from other cluster
Fix grammar of var naming
flatten is the verb, flattened is the adjective.
cluster-merge should refuse to merge own cluster
Also fix type of Merger.cluster_name from list to string. This wouldhave triggered an error in sshRunner if cluster keys were in use.
Signed-off-by: Stephen Shirley <diamond@google.com>Reviewed-by: Guido Trotter <ultrotter@google.com>