(b64) Use base64 encoding in networks' bitarrays
This is needed for GRNET'S production environment.
Signed-off-by: Dimitris Aragiorgis <dimara@grnet.gr>
(grnet) Hotplug: cfgupgrade for deprecated fields
Add cfgupgrade so that we remove any deprecated fields hotplugimplementation used in the past.
(2.10) Fix net-common script in case of routed mode
setup_route should run in case or routed mode and notopenvswitch.
Signed-off-by: Dimitris Aragiorgis <dimara@grnet.gr>Signed-off-by: Thomas Thrainer <thomasth@google.com>Reviewed-by: Thomas Thrainer <thomasth@google.com>
(2.9) Refactor NIC configuration scripts
Add new script vif-ganeti that could be used instead ofdefault vif-bridge in order NIC customization can be moreflexible.
Extract common code from kvm-ifup and insert it in a newfile net-common that is being sourced by kvm-ifup and...
master-up-setup: Ping multiple times with a shorter interval
In the case of network problems, one ping packet can possibly get lost.Sending multiple packets is safer. The interval between packets is setto 200ms so that the check finishes faster.
Signed-off-by: Petr Pudlak <pudlak@google.com>...
Add a packet number limit to "fping" in master-ip-setup
This fixes issue #630. Apparently there is a bug in fping 3.5 where itloops forever without "-c" given an unreachable host, even though"-c 1" should be the default according to the man page.
The "-c" flag works on Squeeze. Checking the man pages on the Internet,...
Generate tools/users-setup from descriptions
Now that we have a machine readable description of the usersto be added to the system, use it to generate the tools/users-setupscript, so that we again have only one authoritative source ofthe user and group requirements. This also has the advantage of...
Remove dsahostkeypub during config downgrade
Remove the newly-added DSA host public key field from the configuration filewhen downgrading to 2.7, if present. Otherwise masterd will refuse to start.
Signed-off-by: Apollon Oikonomopoulos <apoikos@gmail.com>...
Support DSA SSH keys in bootstrap
As outlined in issue 338, Ganeti failed to initialize a cluster if noRSA SSH key is present on the master node. This patch extends Ganetissupport to DSA keys, so clusters with only DSA keys are possible now.
This fixes issue 338....
Fix the downgrade function of cfgupgrade
The downgrade was not correctly removing some of the UUIDs (namely, thoseof disks and NICs).
Fixes Issue 510.
Signed-off-by: Michele Tartara <mtartara@google.com>Reviewed-by: Klaus Aehlig <aehlig@google.com>
Rename queryd to luxid
As queryd will, in the future, handle all LUXI request, queue jobs andmost likely perform various other tasks, it is renamed to luxid already.This will safe some headache when upgrading Ganeti installations, as wedon't have to deal with a daemon rename....
Add queryd daemon (split from confd)
queryd is added as a new daemon which handles configuration queries overLUXI. This functionality was removed from confd, which now only queriesover the network.
The queryd user is added to the master group such that it can access...
Add confd user to masterd group
The server.pem file is 0440 (materd_uid, masterd_gid) and cannot beaccessed by confd.
This patch contains a workaround for 2.8.0~beta1 (adding conf to themasterd group in the user setup tool, and remembering the users to...
Version bump to 2.8.0~alpha1
Now that alpha versions are supported, we can bump the version numberfor branch stable-2.8 to 2.8.
This also requires updating the cfgupgrade tool.
Thanks to the previous patches, all the other documents can be upgradedduring the alpha lifetime, before switching to beta (that will enable...
Make cfgupgrade idempotent
One of the unit tests checks whether cfgupgrade's downgrade option isidempotent. It is, but a version number check made it impossible toactually downgrade multiple times.
With this change, both the current-version version number and the...
Update config version number when downgrading
The downgrade option of the cfgupgrade tool was not changing the versionnumber in the configuration file of the cluster while performing thedowngrade.
Signed-off-by: Michele Tartara <mtartara@google.com>Reviewed-by: Guido Trotter <ultrotter@google.com>
Consider disks_active in UpgradeConfig
The disks_active flag is updated when masterd reads the configuration.Also, cfgupgrade now removes the disks_active flag during downgrades.
Signed-off-by: Thomas Thrainer <thomasth@google.com>Reviewed-by: Helga Velroyen <helgav@google.com>
Merge branch 'stable-2.7' into stable-2.8
Don't fail to deactivate master IP if already down
The master IP setup script now checks if the master IP is actuallyconfigured on the machine before trying to remove the IP.
This fixes issue 460.
Signed-off-by: Thomas Thrainer <thomasth@google.com>Reviewed-by: Guido Trotter <ultrotter@google.com>
Merge stable-2.7 into stable-2.8
Conflicts: INSTALL NEWS configure.ac src/Ganeti/Query/Group.hs test/hs/Test/Ganeti/Objects.hs test/hs/Test/Ganeti/Query/Query.hs
Signed-off-by: Michele Tartara <mtartara@google.com>Reviewed-by: Helga Velroyen <helgav@google.com>
Disable inter-cluster instance move for file instances
Inter-cluster instance moves depends on exporting an instance. For file-basedinstance, exporting is not supported. Therefore, this patch disablesinter-cluster instance moves for file-based instances and informs the user...
Add monitoring daemon to the masterd group
The hmac.key file is owned by group masterd and is required to communicate withthe confd.
The monitoring daemon need to communicate with the confd so it has to be part ofthe masterd group.
Signed-off-by: Michele Tartara <mtartara@google.com>...
Add multiple min/max specs in instance policy
Now instance policies can contain more than one min/max specs. This is themain element of the "Constrained instance sizes" section in the"Partitioned Ganeti" design doc.
This is a big patch, but changing the type of a configuration item requires...
Conflicts: NEWS doc/rapi.rst
Signed-off-by: Klaus Aehlig <aehlig@google.com>Reviewed-by: Guido Trotter <ultrotter@google.com>
cfgupgrade: Remove enabled_disk_templates on downgrade
Remove enabled_disk_templates instead of the deprecatedenabled_storage_types.
Signed-off-by: Bernardo Dal Seno <bdalseno@google.com>Reviewed-by: Guido Trotter <ultrotter@google.com>
cfgupgrade: Limit specs in ipolicy are always complete
Partial specs are filled with cluster defaults.
Signed-off-by: Bernardo Dal Seno <bdalseno@google.com>Reviewed-by: Helga Velroyen <helgav@google.com>
Add monitoring daemon user to user creation script
The script was added to Ganeti before the monitoring daemon, so itdid not include that user yet.
Preserve device names during instance move
Fix 'move-instance' tool to preserve the instance disk and NIC nameswhen moving instances from one cluster to another. Also, fix value errorsince an instance NIC is an 8-tuple, containing also name and UUID.
Signed-off-by: Christos Stavrakakis <cstavr@grnet.gr>...
users setup: add masterd to confd group
Without this masterd fails saving the config, because it can't changethe group on the file.
Signed-off-by: Guido Trotter <ultrotter@google.com>Reviewed-by: Helga Velroyen <helgav@google.com>
Merge branch 'devel-2.7'
Add tool for creating users and groups
When executed in split user mode, Ganeti requires a specific set of usersand groups to be created in the appropriate way.
This commit introduces a tool that takes care of that automatically.
cfgupgrade: Add support for newly refactored ipolicies
Instance policies in the configuration are upgraded and downgraded. Bothoperations are idempotent.
cfgupgrade: Add --downgrade option
It's now possible to go back to the previous stable version. Unit testsprovided.
This is mostly useful during development, when going from master tostable/devel.
Signed-off-by: Bernardo Dal Seno <bdalseno@google.com>...
cfgupgrade: Refactor code
All the upgrading code is now in one function. No functionality has beenchanged.
Trivial merge: no conflicts...
cfgupgrade: Fix error messages
Messages were inconsistent. You could get both an error and a messagesaying that everything was fine.
vcluster-setup: Create $vnode/etc/ganeti directory
This directory is required by “cfgupgrade” and some other tools.
Signed-off-by: Michael Hanselmann <hansmi@google.com>Reviewed-by: Michele Tartara <mtartara@google.com>
Add cfgupgrade for changing nic.network to uuid
This gets all network info from config_data and parsesall instances and their NICs and makes the substitution.
Signed-off-by: Dimitris Aragiorgis <dimara@grnet.gr>Reviewed-by: Helga Velroyen <helgav@google.com>
Version bump for 2.7.0~beta1
Also update the documentation target versions and the cfgupgrade tool torecognize 2.6 and upgrade to 2.7
Signed-off-by: Guido Trotter <ultrotter@google.com>Reviewed-by: Michael Hanselmann <hansmi@google.com>
Move burnin to ganeti.tools.burnin
Similar to other scripts, “tools/burnin” just becomes a wrapper script.
Signed-off-by: Michael Hanselmann <hansmi@google.com>Reviewed-by: Guido Trotter <ultrotter@google.com>
burnin: Enable DT_EXT/DT_RBD for single node clusters
As reported by Constantinos Venetsanopoulos, DT_RBD and DT_EXT work onsingle node clusters.
burnin: Disk template option cleanup
Burnin doesn't support all disk templates (specifically it doesn'tsupport “blockdev”). The code, however, used manually composed lists insome places, constants.DISK_TEMPLATES in others, and an internal list ofsupported templates in some....
burnin: Factorize disk template lists
Keep the lists at the top instead of having them embedded in the code.Use frozenset, too.
Implement the External Storage Interface
With this commit we introduce the External Storage Interfaceto Ganeti, abbreviated: ExtStorage Interface.
The ExtStorage Interface provides Ganeti with the ability to interactwith externally connected shared storage pools, visible by all...
Replace frozenset with compat.UniqueFrozenset
This is not a trivial s/frozenset/compat.UniqueFrozenset/, but ratheronly replaces “frozenset” where appropriate. Most of the places are“static” information that doesn't change after the module has beenloaded....
burnin: rename instances to same name
this (a) allows us to test renaming in burnin even if we don't have anextra instance name and (b) is a valid operation, as it allows to "fix" an instance who went name-astray
Signed-off-by: Guido Trotter <ultrotter@google.com>...
Very very very basic openvswitch support
This is a "better than nothing" support, just for kvm and just joiningthe machine to the opevswitch bridge with the right command.
Signed-off-by: Guido Trotter <ultrotter@google.com>Reviewed-by: Iustin Pop <iustin@google.com>...
Factorize logging setup in tools
Most tools had their own “SetupLogging” function, but they were allessentially the same. This patch adds a generic version to “utils.log”and provides unit tests.
Fix tools/move-instance after networks addition
Commits d4117a72 (“Modify LUInstanceCreate to support networks”) and09a3d21f (“Pass detailed network info in hooks“) expanded the nicinformation as computed by _NICToTuple, which means that the format ofthe result value from LUInstanceQueryData has changed, and...
Fixes to pass pep8 (make lint)
Signed-off-by: Dimitris Aragiorgis <dimara@grnet.gr>Reviewed-by: Iustin Pop <iustin@google.com>
Fixes to pass unittests (make check)
cfgupgrade for networks
Add networks slot in config data.Add networks slot in nodegroups.
Merge branch 'devel-2.6' into submit
Conflicts: Makefile.am (reordering, fixed) htools/Ganeti/Confd/Server.hs (hlint fixes on master) htools/Ganeti/Daemon.hs (hlint)...
Fix gnt-instance console with xl
- Rename xm-console-wrapper to xen-console-wrapper- Pass the xen command to use as a parameter
Signed-off-by: Guido Trotter <ultrotter@google.com>Reviewed-by: Iustin Pop <iustin@google.com>
cfgupgrade: Write file for file storage paths
When file storage is used this file is now mandatory.
Signed-off-by: Michael Hanselmann <hansmi@google.com>Reviewed-by: Iustin Pop <iustin@google.com>
Make Paramiko an optional dependency for listrunner
With the move away from “setup-ssh”, Paramiko is no longer necessary toconfigure SSH on nodes.
Remove setup-ssh
It has been superseeded by “prepare-node-join”.
gnt-node add: Use prepare-node-join
This patch changes “gnt-node add” to use the newly added“prepare-node-join” tool. Hereby Paramiko is no longer a hard dependencyfor setting up SSH on nodes.
In “gnt_cluster.py”, a positional parameter is no longer passed as a...
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>...
vcluster-setup: Stop hardcoding /etc/hosts
… use a constant instead.
vcluster-setup: Watcher, init script
- Generate a wrapper script for ganeti-watcher- Provide command line option to specify init script
Signed-off-by: Michael Hanselmann <hansmi@google.com>Reviewed-by: Bernardo Dal Seno <bdalseno@google.com>
vcluster-setup: Add more parameters to "gnt-cluster init"
This patch also adds two new parameters to the vcluster-setup script tonot configure /etc/hosts and networking. Build-time variables are nowused for paths.
Signed-off-by: Michael Hanselmann <hansmi@google.com>...
Stop hardcoding root user
Some parts of the code still use a hardcoded user name: root. This patchreplaces all with a constant specified at build time. The end goal is tomake it possible to run a Ganeti cluster without any special privileges(of course this will prevent some functionality from working)....
Cleanup of build-time shell variable replacements
Instead of having a different set in (almost) every shell script, thisinserts the most commonly used variables at build time. This way thecode for injecting a root directory for virtual clusters also is just...
Add vcluster-setup utility
This utility can be used to configure an environment for a virtualcluster. It sets up entries in /etc/hosts, creates the necessarydirectory structure, and generates helper scripts.
Documentation for virtual clusters will come in a later patch....
cfgshell: Remove pylint disable line
Commit 326830963 removed the use of a private member function. Alsoreplace '' with "" in one place.
Migrate tools/* from constants to pathutils
File system paths moved from constants to pathutils.
Make the slots functionality more modular
As we will introduce another set of containers using the slots trickwe abstract away as much as possible to separate bases classes. Thechild classes then adapt them for their needs. This leads to less code...
Merge branch 'devel-2.6'
Signed-off-by: Iustin Pop <iustin@google.com>Reviewed-by: Bernardo Dal Seno <bdalseno@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...
Bump pep8 version to 1.2
Debian Wheezy will ship with this version, and it has many improved checks compared to 0.6, so let's:
- bump version in the docs- silence some new checks that are wrong due to our indent=2 instead of 4- fix lots of errors in the code where the indentation was wrong by 1...
Re-indent kvm-ifup.in
By a strange accident, this file seems to be tabified, instead of ourown 2-space rule. Re-indent it and also break one long line.
Signed-off-by: Iustin Pop <iustin@google.com>Reviewed-by: René Nussbaumer <rn@google.com>
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
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.
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!
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
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.
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>