Adding a wrapper around connecting to kvm 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 "xm 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.
Signed-off-by: Guido Trotter <ultrotter@google.com>...
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...
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>
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>...
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.
Signed-off-by: Iustin Pop <iustin@google.com>...
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.
Signed-off-by: Michael Hanselmann <hansmi@google.com>...
burner: Trivial code cleanup
- Use constant for exit value- Configure logging from main function, not from class' “__init__”
Signed-off-by: Michael Hanselmann <hansmi@google.com>Reviewed-by: René Nussbaumer <rn@google.com>
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>
Open other clusters' config in foreign mode
Add (unused) arg to _OfflineClusterMerge
cli._RunWhileClusterStoppedHelper.Call passes (self, *args) to functionscalled via cli.RunWhileClusterStoppedHelper(). The code in cluster-mergewas broken by commit d8aab233.
lvmstrap: fix logic bug for partition reread
The if structure in CheckReread is broken, and makes partitions rereadbe full of race issues (esp. after updating them).
Also fix a small message bug.
Signed-off-by: Iustin Pop <iustin@google.com>Reviewed-by: Michael Hanselmann <hansmi@google.com>
lvmstrap: fix very old contact information
A memory from the past: this was left over from before the 1.2 releaseor so…
lvmstrap: add more excluded FS types
Also moves the list of excluded types to the top level and make it afrozenset.
lvmstrap: add an explicit test for mounted devices
Recent kernels/userland report a mounted filesystem as follows:
root@node4:~# fuser -avm /dev/sda5 USER PID ACCESS COMMAND /dev/sda5: root kernel mount /srv/ganeti...
lvmstrap: add explicit test for swap backends
Similar to mounted filesystems, recent kernel/userland report swapbackends:
root@node4:~# fuser -avm /dev/sda6 USER PID ACCESS COMMAND /dev/sda6: root kernel swap /dev/sda6...
lvmstrap: ignore small-sized partitions
This patch changes lvmstrap to ignore “small” partitions. Currentlyextended partitions are reported as unused as with a size of 1024(bytes), and this confuses lvmstrap. Since a very small partitionwon't help anyway (below hundred of PE size is not helpful), let's...
lvmstrap: abstract a little the sysfs paths
lvmstrap: add PV-on-partition support
This is a not-so-nice change, adding support for partitions to be usedas PVs.
The not-nice part is that partitions live in a separate place insysfs, whereas in dev they live at the same level as disks. Weworkaround this via a new SysfsName function that computes the correct...
Ship default kvm-ifup script
In order to retain backwards compatibility, we ship the shell script previouslygenerated by _WriteNetScript as a stand-alone script under PKGLIBDIR.
Signed-off-by: Apollon Oikonomopoulos <apollon@noc.grnet.gr>Signed-off-by: Guido Trotter <ultrotter@google.com>...
Rename OpStartupInstance and LUStartupInstance
Signed-off-by: Iustin Pop <iustin@google.com>Reviewed-by: René Nussbaumer <rn@google.com>Reviewed-by: Michael Hanselmann <hansmi@google.com>
Rename OpQueryNodes and LUQueryNodes
Rename OpDiagnoseOS and LUDiagnoseOS
Rename OpMigrateInstance and LUMigrateInstance
Signed-off-by: Iustin Pop <iustin@google.com>Reviewed-by: René Nussbaumer <rn@google.com>
Rename OpMoveInstance and LUMoveInstance
Rename OpQueryInstances and LUQueryInstances
Rename OpRebootInstance and LURebootInstance
Rename OpReinstallInstance and LUReinstallInstance
Rename OpRemoveInstance and LURemoveInstance
Rename OpRenameInstance and LURenameInstance
Rename OpReplaceDisks and LUReplaceDisks
Rename OpSetInstanceParams and LUSetInstanceParams
Rename OpShutdownInstance and LUShutdownInstance
Rename OpActivateInstanceDisks and LUActivateInstanceDisks
Rename OpCreateInstance and LUCreateInstance
Rename OpDeactivateInstanceDisks and LUDeactivateInstanceDisks
Rename OpFailoverInstance and LUFailoverInstance
Rename OpGrowDisk and LUGrowDisk
Rename OpRemoveExport and LURemoveExport
Rename OpExportInstance and LUExportInstance
Merge branch 'devel-2.3' into devel-2.4
Signed-off-by: Guido Trotter <ultrotter@google.com>Reviewed-by: Iustin Pop <iustin@google.com>
Allow burnin with hidden OSes
burnin is a cluster/testing feature, so it makes sense that a hidden OScan be used for it.
Bump version for Ganeti 2.4.0~beta1
Update the version in all necessary places. Update NEWS with releasedate.
Signed-off-by: Michael Hanselmann <hansmi@google.com>Reviewed-by: Iustin Pop <iustin@google.com>
Set +x on tools/ganeti-listrunner
lvmstrap: also test sysfs holders
If a device has entries in its holder directory(/sys/block/$name/holders), it means that some kernel system "uses" that device, and hence should not be considered available.
This patch adds a new 'in-use' check based on this sysfs test, and...
lvmstrap: add support for non-partitioned md disks
This patch, originally written by Marc Schmitt <mschmitt@google.com>,adds support for MD devices (used in a non-partitioned mode). Iabstracted all the original startswith('md') checks into separatefunctions, and also moved the supported disk types to a list....
Merge branch 'devel-2.3'
cfgupgrade: Remove unused “program” variable
cfgupgrade: Check master name, clarify question
- Check hostname and abort if it doesn't match contents of “ssconf_master_node”, can be overridden using “--ignore-hostname” parameter.- Clarify confirmation question and don't mention instances anymore....
Fix build errors with ganeti-listrunner
- Remove non-ASCII character from manpage- Reformat docstring for epydoc in script
These caused build breakage on some but not all distributions.
Initial import of listrunner
This tool was used and worked on internally for quite a long time. Wedecided to include it in Ganeti.
Known issues:- Code doesn't match rest of Ganeti (e.g. using “print” all over the place, hardcoded calls to sys.exit deep in functions)...
Remove editor-specific settings from cfgupgrade*
Move “rapi_users” file into separate directory
This reduces the number of notifications in “ganeti-rapi”. Until now itwas notified for every change in …/lib/ganeti and had to check whetherthe users file was affected. A symlink is always created in cfgupgrade...
Bump version for Ganeti 2.3
Also update cfgupgrade and NEWS.
setup-ssh: Better error reporting
Together with Michael we refactored the code to make it better andeasier error reporting. Without printing backtraces for authenticationand verification issues.
Signed-off-by: René Nussbaumer <rn@google.com>Reviewed-by: Michael Hanselmann <hansmi@google.com>
Adjust the error message of setup-ssh if join check fails
Signed-off-by: René Nussbaumer <rn@google.com>Reviewed-by: Michael Hanselmann <hansmi@google.com>Reviewed-by: Iustin Pop <iustin@google.com>
Merge branch 'devel-2.2'
move-instance: Allow overriding instance parameters
When moving a single instance within the same cluster, the NICis not allowed to re-use an existing MAC address. To avoid this,NIC parameters must be overridden. BE, HV, OS and NIC parameterscan be overridden after applying this patch....
Change behaviour of OpDiagnoseOS w.r.t. 'valid'
This patch changes the behaviour of OpDiagnoseOS with regards to the'valid' field to be similar to the one for the hidden/blacklistedfields: unless this field is requested, invalid OSes are filtered out....
Merge branch 'stable-2.2' into devel-2.2
Adding functionality to check feasability of joining the host
This checks if the host might possibily belong already to anothercluster. If this is the case we abort without any further actionunless we are forced by --force-join.
Signed-off-by: René Nussbaumer <rn@google.com>...
If we had any errors in setup in one of the hosts, exit with non-zero
Fix the output of the key fingerprint from binary to hex
Signed-off-by: René Nussbaumer <rn@google.com>Reviewed-by: Iustin Pop <iustin@google.com>
Revert "Add 2.2->2.3 cluster upgrade function"
This reverts commit 2c9cf6bb05e14ea606638fce9680994cf92e8e24.The change is better done in objects.py
Signed-off-by: Guido Trotter <ultrotter@google.com>Reviewed-by: Michael Hanselmann <hansmi@google.com>
Fix some epydoc warnings
Signed-off-by: Manuel Franceschini <livewire@google.com>Reviewed-by: Michael Hanselmann <hansmi@google.com>
move-instance: Fix parameter order in _CreateInstance
This patch fixes a bug, which caused the primary and secondarydestination nodes to be revered on the destination cluster after aninstance move.
Signed-off-by: Manuel Franceschini <livewire@google.com>...
Add 2.2->2.3 cluster upgrade function
Revert behaviour for calling SetupNodeDaemon
This was previously done in setup-ssh which was the wrong place
Signed-off-by: René Nussbaumer <rn@google.com>Reviewed-by: Guido Trotter <ultrotter@google.com>
Adding host key verification to setup-ssh
setup-ssh: fix updating of authorized_keys
Due to what seems like a bug (or inconsistency) in paramiko, filesopened with a+ over SFTP need a seek() in order for the user to be ableto read data from them. We implement this, and rely on the fact that wedo iterate over all lines before writing and that the file is opened in...