Add migration support at the rpc layer
This patch adds the migration rpc call and its implementation in thebackend. The patch does not deal with the correct activation of disks.
Because of the new RPC, the protocol version is increased.
Reviewed-by: imsnah
hypervisor: add live migration support
This is just the hypervisor-level migration (e.g. “xm migrate”) not thewhole node coordination work.
Reviewed-by: ultrotter
Activate down instances' disks on replace-disks
When replacing disks or evacuating nodes with instances administrativelydown ganeti fails because the instance disks are not active. This patchactivates them, performs the replacement, and shuts them down again....
FailoverInstance: change AddInstance with Update
We're not adding a new instance, just making configuration changes tothe one we're working on.
Burnin: Use iallocator in import/export
Currently the iallocator option is ignored by burnin at import/exporttime even if passed in. With this patch it becomes used. The log messageused by the importer is also changed to reflect this.
This patch also improves import/export on the non-iallocator case:...
Fix an error message in instance add
There is a mistake in the error message generated when we can't reach anode for checking for available disk space. Without it, the errormessage is:Failure: prerequisites not met for this operation:Cannot get current information from node '{u'gnte2.lab.k1024.org':...
Move warning flags from autogen.sh to configure.ac
Reviewed-by: iustinp
Replace logging functions with calls to logging module
- Shorter code- Reorder arguments to logger.SetupLogging calls to make more sense
Fail job on ganeti exceptions
When a Job raises a ganeti exception a message is printed but nothing isreported in the job itself. It's better to update the job status, thusnotifying the client, possibly polling for the job result, of what wentwrong.
Fix a typo in jqueue.py
s/result/op_result/ (this code was never used, so this wasn't caught)
Don't use specific versions in autogen.sh
Not all distributions have the same version of aclocal, autoconfor automake. Users can pass the name of a specific executablesvia environment variables. Change configure.ac to require atleast autoconf 1.9.
Move InitCluster opcode into a single function
This allows us to initialize a new cluster. The code certainly containsbugs and hooks aren't implemented yet.
Move cmdlib._HasValidVG to utils.CheckVolumeGroupSize
This is required for splitting the cluster initialization code.
Move {Set,Remove}EtcHostsEntry wrappers to utils.py
This is required for the split of the cluster initialization code.
Reviewed-by: iustinp, ultrotter
Remove REQ_CLUSTER from opcode handling code
It's not needed anymore now that all opcodes require a cluster. Clusterinitialization was the only exception.
Remove unreachable code from cli.SubmitOpCode
Rename master socket to ganeti-master.sock
…/run/master.sock is not specific enough.
Remove SimpleStore cache
SimpleStore is instantiated anew most of the times it's used, so havinga cache inside it serves no purpose. Removing it.
Forward-port: Fix two problems in QA scripts
- Failover back to original node in instance failure test- Exclude secondary node from list of potential nodes in replace-disks test
Forward-port: Add QA tests for “gnt-instance reboot”
Forward-port: Add QA test for “gnt-instance replace-disks”
Forward-port: Update gnt-instance and gnt-backup manpages
- Add --iallocator options- Small text fixes
Forward-port: Fix wrong filename in ganeti-watcher manpage
Forward-port: Small codestyle fixes for dumb-allocator
Forward-port: Remove output file if docbook failed
Forward-port: Alias Dump/Load functions in ganeti.serializer to DumpJson/LoadJson
The remote API will use JSON for the foreseable future, so it's betterto put the serialization format in the function name. We can stilluse another serialization format for Ganeti's core....
Add line-breaks to gnt-instance manpage
Add check for node memory in instance creation
Currently the check for enough memory is done only on instance startcommand and failover command. But we also start an instance in instancecreate, therefore we need to check this instead of failing to start in...
Show cluster hypervisor for gnt-cluster info
Author: schreiberalReviewed-by: iustinp
Forward-port: Another for gnt-instance modify & HVM parameters
Another tiny fix. Anybody got a nice brown paper bag I can wear?
Forward-port: make gnt-modify work with new HVM parameters
This fixes gnt-instance modify so it actually works with thenew HVM parameters for Ganeti 1.2
Forward-port: show only parameters relevant to the instance
This patch modifies the code for "gnt-instance info .." to only displayinstance parameters that actually apply to that instance, i.e. for PVMinstances no HVM parameters are shown and vice versa....
Forward-port: patch 4/4 extended HVM features for 1.2
This patch documents the extended HVM features.
Author: schreiberalReviewed-by: imsnah
Forward-port: patch 3/4 extended HVM features for 1.2
This patch adds hypervisor support for the extended HVM features.
Forward-port: patch 2/4 extended HVM features for 1.2
This patch adds the commandline extensions and the code to storeand display the extended HVM features.
Complete removal of md/drbd 0.7 code
This patch removes the last of the md and drbd 0.7 code. Cluster whichhave the old device types will be broken if they have this applied.
LURemoveInstance: fix op.ignore_failures usage
Currently: the LURemoveInstance.Exec() method uses the ignore_failuresattribute of the OpRemoveInstance opcode, but it doesn't check for itsexistence. The patch adds this attribute to _OP_REQP and to all the...
Documentation: cleanup of local/remote_raid1
Since we have removed support for local and remote raid1, update the manpages and guides to reflect the new situation.
Distribute dumb-allocator in examples
When creating the ganeti tarball the dumb allocator was left out.Shipping it alongside the other examples.
Update command line help and manpages with mandatory options
document cluster verify --no-nsplus1-mem option
Add this recently added option to the gnt-cluster man page beforereleasing 1.2.4.
Fix drbd show parser to handle valueless keywords
It turns out in some cases there can exist keywords without anassociated value exported by drbdsetup show. This patch makes the valuepart optional in our parser, so that if it's not present the parsingresult will contain an array with just the keyword in it. This is not a...
Split drbd command creation and execution
Make _AssembleDisk more similar to _AssembleNet by splitting thegeneration of the drbdsetup command and its execution. While notchanging anything this makes it easier to manipulate the command just incertain cases, which in the future we'll need to do....
Small style fixes
[Trunk version]
Reviwed-by: imsnah
Implement node daemon conectivity tests
This patch adds in gnt-cluster verify checks for inter-node tcpcommunication checks on the node daemon port for both the primary and(if defined) secondary networks.
The output looks like (4-node cluster, one with the secondary interface...
Forward-port changes made to readd in 1.2
qa_node.py: Fix typo in messagecmdlib.py: Don't add readded node to node listganeti-qa.py: Make sure readd isn't done for master node
CLI: retry: remove command opts/args in "gnt-X"
This new version of the patch removes only the listing of the usage inthe "gnt-X" list, but keeps the strings in since we'll want to enhanceand use them in "gnt-X $cmd --help".
Revert "CLI: remove command opts/args in "gnt-X""
This reverts commit 976.
CLI: remove command opts/args in "gnt-X"
[Forward-port of the 1.2 branch patch]
This patch removes all the parameters and options from the output"gnt-X" (i.e. the subcommand list for command). This is done in order touniformize the output, currently only some parameters are shown and they...
Watcher: do not activate disks for started instances
Currently the watcher runs first the instance startup and then theboot-id method of disk reactivation. However, irrelevant of the factthat a node has rebooted or not, if we just started an instance, there's...
Watcher: do not activate disks for admin_down
Currently the watcher does activate disks (via bootid mechanisms) evenfor admin_down instances. This patch logs and skips over theseinstances.
Reduce chance of ssh failures in verify cluster
The cluster verify builds a sorted list of nodes and passes that to allthe nodes (in parallel) for ssh checks. This means that for a clusterwith N nodes, there will be approximately N simultaneous connections to...
bdev: always log command output if it failed
Currently many error handling code paths in bdev.py log onlyresult.fail_reason (i.e. exit code or signal that killed the command)but not its output. This makes debugging very hard.
The patch changes all places where we only log fail_reason to also log...
DRBD: Fix another bug in diskless activation
DRBD8 requires that we pass ‘--create-device’ to the first command thatwants to activate a new DRBD minor. We do this currently when we run the“drbdsetup ... disk” command which we run before the network setup....
Remove utils.CheckDaemonAlive and use “xm info” instead
There are a couple of reasons for doing so:- /proc is not OS independent, it's only supported by Linux (there are emulations on other systems, but those might differ from the way Linux represents data)....
Improve DRBD8.Open's docstring a bit more
Fix comment typo in bdev.py
Fix DRBD8 diskless assembling
The algorithm for attaching to existing DRBD devices is not trivial. Ithas four alternatives, and there is a bug in the last one when we havediskless devices.
The last case (local disk info matches but remote/network configuration...
Add unittest for constants
Use new ssconf function to check configuration version
Upgrades will be handled in future patches.
Use dict instead of if/elif map for hypervisor classes
Rename hypervisor code to lowercase filenames
Generate devel/upload during build time from template
- Use variable with prefix instead of grep and sed- Always run with /bin/bash
Export the number of cpus to iallocator scripts
Now that we have the number of cpus available from the hypervisors, wecan export this to the iallocator scripts.
Minor doc/help update
This shortens the help output in gnt-node so that the output looksnicer, and improves the manual page for gnt-instance with the new'status' field.
Improve the gnt-* list field selection
This patch allows the '-o' option to the list subcommands to add morefields to the default list instead of replacing the default list byprefixing the fields list with '+'.
The patch also moves the listing (in the help output) of the default...
Add node cpu count to gnt-node list
This patch adds the backend and frontend changes needed for being ableto list the cpu count.
Wrap exception in _DistributeConfig code
nodelist.remove(X) could potentially raise a ValueError (even if the chancethat the current node is not in the list are pretty scarce, and its absenceshould raise a red flag anyway). If this happens let things go on, as that's...
Simplify target generation in DistributeConfig
Currently we get the list of nodes, and for each one extract all its info, andjust to exclude it if the name matches ours. Since the list of nodes is a listof names just use .remove() to exclude ourself from it, and use that list...
ssconf: update the SetKey docstring
SetKey is used, other than for adding new nodes, in another few cases. Updatethe docstring to reflect this, so we don't mislead people reading it.
Delete hypervisor.py
This completes the changes in r898 by actually getting rid of the old unusedhypervisor.py code which was left in the code tree.
ganeti-masterd: Some docstrings work
- Add a docstring to IOServer's constructor- Add argument description to PoolWorker's and JobRunner's ones
locking: remove obsolete comment
Remove deprecated disk templates from doc
Since local_raid1 and remote_raid1 are deprecated they are removedfrom the docs. This patch removes some old documentation sectionsand bumps the documented version from 1.2 to 1.3.
hooks.sgml: Add cluster-verify hooks information
Add cluster-verify hooks
Only post-hooks are run on cluster verify, and then their output is sent backto the LU, which upon failure displays it to the user and changes the result ofthe execution to a failure.
Add a LU Hooks notification function
Previously LUs could be failed by pre-hooks, and post-hooks just had effects bythemselves. This patch allows a LU to define the HooksCallBack function if itwants to know about its hooks' results and alter its results in response....
HooksMaster: Make RunPhase return the rpc output
Right now the hooks output is propagated from the nodes all the way up toHooksMaster.RunPhase, which uses it for debugging PRE hooks, but then silentlydiscards them. We'll now propagate it up to the Processor.ExecOpCode function,...
Remove NoHooksLU.BuildHooksEnv
Since NoHooksLU defines HPATH as None, BuildHooksEnv will never be called (asthe LogicalUnit.BuildHooksEnv docstring correctly states). Removing thefunction altogether, to avoid having dead code lying around, and to make sure...
LogicalUnit.BuildHooksEnv, update docstring
The LogicalUnit.BuildHooksEnv docstring used to say that the node list shouldnot include the master node. This is obviously not the case checking therelevant code, and double-checking with iustin he confirmed it just document...
Remove non-existing arguments from some docstrings
A fewdocstrings in the HooksRunner backend class list arguments the relevantfunctions do not take. Clean them up.
Add file-based options to gnt-instance man-page
Support config version in ssconf
Disable forking in the master daemon
This patch adds a mechanism to disable utils.RunCmd in selectedprograms. This is needed in the master daemon unless we confirmthreading doesn't pose any problems.
This makes cluster init fail, but creating new trunk clusters is anyway...
Raise PrereqError when exporting file-based instance
This patch adds a check to LUExportInstance.CheckPrereq to raise anerror when an instance with file disks is exported.
Add file backend storage options to ImportInstance
This patch adds the file storage options to gnt-backup import whichwould otherwise fail since the values of file_storage_dir andfile_driver are accessed in LUCreateInstance.
Split hypervisor.py into several files
Before it was a huge file with more than 700 lines. No code changes weremade except for changing imports and class names where needed. In thefuture, we could even think about only importing the hypervisors weactually need. The patch finished QA scripts and distcheck successfully....
Move the 'cmd' lock from cli.py to ganeti-masterd
This patch removes the lock and the lock options from cli.py and movesthem to the master.
Later during development we can remove it completely, but for now it'sgood to protect any other tool that uses the lock directly....
Convert cli.SubmitOpCode to use the master
This patch converts the cli.py SubmitOpCode method to use the unixprotocol and thus execute the opcodes via the master.
The patch allows a partial burnin to work with the master. Currently thequery opcodes, since they are executed via the SubmitOpCode, are...
Add check for major/minor in _FormatBlockDevInfo
bdev.FileStorage does not have major or minor fields, so gnt-instanceinfo for file backed instances fails with a TypeError. This patchadds checks to prevent that and print 'N/A' instead.
Make testSignal unittest not depend on default shell
This patch changes the code executed when testing the signal handlingof RunCmd. Since sh does not always point to bash (e.g. on Ubuntu,where it points to /bin/dash) this test might fail due to the returned...
Move iallocator script execution to ganeti-noded
Currently the iallocator execution takes place in the master, which is aviolation of the current architecture, and will create problems with athreaded master daemon.
This patch moves the execution to the backend, similar to the hooks...
Fix iallocator instance info
The commit "IAllocator: some more info exported" broke the instance listgeneration due to a wrong index variable. This patch fixes that.
Extend utils.WriteFile
Add parameters to not check the path for absoluteness, implement a dryrun mode and automatically create a backup if requested. This will beused by the cfgupgrade utility.
Reviewed-by: schreiberal
IAllocator: some more info exported
This patch adds the following information to the exported info: - hypervisor type (in the main dict) - total memory used by primary instances (in each node dict) (can be computed from the node+instance dicts, but it's cheap to compute...
IAllocator: simplify node info computation
Currently we try to convert the values returned by call_node_info toints, and if all succeed, we actually do the conversion. Simplify thisby doing it in one step.
The patch also adds exporting of node memory as 'reserved_memory'....
patch 1/4 extended HVM features for 1.2
This patch extends the config objects with the slots to handlemore HVM configuration items.
Author: schreiberalReviewed-by: iustinp,imsnah
Move target creating symlinks in lib/ into Makefile.libcommon
Add iallocator documentation
backend.FinalizeExport: safely initialize some vars
This patch initializes nic_count and disk_count with 0. This preventssome reference errors if the snap_disks block device list is empty.