Fix gnt-instance replace-disks online help
The "quick" online help just reported the option to change secondary node. Addthe ones to just replace the disk locally on-primary or on-secondary. It is ofcourse impossible to espress in one line everything needed to use this command,...
Codestyle fixes: adding a few empty lines
Reviewed-by: ultrotter
Clarify online help for xc-instance reinstall.
Reviewed-by: imsnah
Add another 1.1->1.2 compatibility alias
gnt-instance replace-disks used to be called replace_disks.
Reviewed-by: iustinp
Update online help and manpage to include drbd disk type.
Modify the default output of gnt-instance list
This patch adds a new field available for selection in gnt-instance listnames "status" which represents the combined value of "admin_state" and"oper_state". Since this is much easier to parse (e.g. gnt-instance list...
Fix online help for gnt-backup import
The help string missed drbd as a disk template option. Adding it.
tiny typo fix
Improve the documentation of query output fields
The gnt-node and gnt-instance list commands have a customizable list ofoutput fields, but the list is not up to date (in the man page) and noteasily understandable from the ‘--help’ output.
This patch updates the man pages and adds the available fields and...
Add option for the number of VCPUs in instance listing
Fix gnt-instance modify breakage due to hvm_boot_order
As reported by hypnoce@gmail.com, this is missing a check on None. As we don'tcare about uppercase, we keep the check simple by removing the lower() call.
Add a few aliases for startup/shutdown
These aliases are widely used to think of these operations and save some typingtoo. Even though there is some thought to make start/stop the default operationname I don't think this should happen for 1.2, for now adding it as an alias is...
Add the first command alias
Alias activate_block_devs to activate-disks, for ganeti 1.1 compatibility.
Check that we have a valid export list
Before iterating over the list of exports present on a node, check that whatganeti returned is actually a list. This solves the case when one of the nodesis down, and an error value is returned.
This fixes issue 21...
Show the HVM boot order in instance info
This is a merge from the 1.2 branch
Two small style fixes
Add mac="auto" at import time
Mac is now a mandatory option for OpCreateInstance. Add it when we call thisopcode at import time too. This is a quick fix for the code, but probably morework needs to be done to integrate mac addresses with the import/export...
Support selecting the boot device order for HVM.
This patch adds support for specifying and changing the boot device order forHVM instances. The boot device order specification is ignored for non HVMinstances.
Fix gnt-backup import -s option
Update gnt-backup import to be in line with gnt-instance add about the os disksize option. Thanks to Gunnar Wagenknecht for spotting the issue.
Make ‘gnt-instance info’ show kernel/initrd paths
This patch changes the info subcommand to nicely show the kernel andinitrd paths.
Allow defining the kernel/initrd at creation time
This patch adds support for defining the kernel/initrd at instancecreation time, using the same interface as in instance modify.
Add support for modifying the kernel/initrd path
This patch adds support in ‘gnt-instance modify’ to set the kernel andinitrd paths. The user can pass either 'default' or 'none' (none is notvalid for kernel).
Improve verify-disks: broken/missing LV detection
This patch improves the ‘gnt-cluster verify-disks’ command by addingsupport for detecting broken volume groups and missing logical volumenames.
As such, we don't try anymore to activate disks for instances that are...
Allow instance MAC address to be set.
Allow the MAC address of an instance to be specified optionally duringinstance creation and later to be changed via instance modify.
Proof-of-Concept HVM support for Ganeti.
This patch implements a first proof-of-concept for HVM support in Ganeti.Due to the nature of this patch, it is intended for test environmentsonly.
Add instance port support.
Extends the instance object by adding a port item, also adds changesto print this port via gnt-instance info.
Add the ‘gnt-cluster verify-disks’ command
This patch adds the OpVerifyDisks handling in mcpu.py and theverify-disks command in the gnt-cluster script, which for every instancecomputed by LUVerifyDisks submits a new OpActivateInstanceDisks request.
Various code style fixes for strings.
- When line wrapping is needed, move spaces to the next line.- Remove embedded line breaks from error messages.
Reviewed-by: schreiberal
Replace disk template drbd8 with drbd where missing.
Correct the -s parameter in gnt-node output
This fixed the previous commit (-s => -s ip).
Add the -s option in the output of 'gnt-node'
Since on dual-homed clusters one always needs to add '-s' to thegnt-node add command, make this appear in the output of 'gnt-node' (whenrun without arguments).
Fix --node option for “gnt-backup list”.
Change --nodes to --node
The --nodes option in gnt-backup really accepts only one node at a time.Change it to --node, for added clarity and consistency with a similaroption in gnt-cluster. This patch also updates the relevant man page.
Reviewed-By: iustinp
Enhance secondary node replace for drbd8
This (big) patch does two things: - add "local disk status" to the block device checks (BlockDevice.GetSyncStatus and the rpc calls that call this function, and therefore cmdlib._CheckDiskConsistency) - improve the drbd8 secondary replace operation using the above...
Remove --secondary-node option.
Replace --secondary-node option with an optional parameter for --node.
Implement degraded status for logical volumes
Logical volumes can be 'degraded' in a similar way to mirrored devices,when their underlying storage has gone away (i.e. after a physical diskfailure and 'vgreduce --removemissing'). If we can detect this, we can...
Make DiagnoseOS use the modified OS objects
Modify backend.py so that DiagnoseOS only returns OS objects rather thanInvalidOS errors, and make sure gnt-os understands the new objects. Also deletethe deprecated helper functions from gnt-os.
Implement tag searching
This patch adds a search command for locating tags on all objects of thecluster using a regex pattern.
Reviewed-by: aat
Remove two trailing whitespaces
Ok, I've been battling with those for a while but it seemsin the end I forgot to get rid of them! :( Doing it explicitely now.
Move blank lines inside function messages
This patch changes whitespace only. It fixes all the functions in script/gnt-osby putting a white line at the end of all the function descriptions andremoving it from just before the code.
Add empty line after each diagnose OS-Node set
Reviewed-By: imsnah
Modify the displayed format for gnt-os diagnose
Get rid of the tabulated form and create a simplier indented structure.Now a valid OS looks something like:
OS: foo [global status: partial valid] Node: gsdtest4.euw.corp.google.com, status: valid (path: /usr/local/lib/ganeti/os/foo)...
Change the way to compute the first os status message
Use both _DiagnoseOSStatus and _DiagnoseOSPath to calculate the messageassociated with the first entry found on a node for an OS. Also call the renamethe relevant variables to _msg rather than just _status to reflect that they...
Separate OS status and path
Make _DiagnoseOSStatus only return a status message for the OS diagnose objectand create a new _DiagnoseOSPath function to get the path out. This will let usbe more flexible in the messages we display to the user.
Revert "Implement multi-failover options"
This reverts commit 289, as the node failover functionality was alreadyimplemented in gnt-node (as opposed to gnt-instance). My mistake.
Fix usage of OpReplaceDisks.
Small improvements to multi-instance selections
This patch fixes the documentation in a few cases and adds handling ofthe situation where no instance is selected due to too restrictiveoptions given.
Implement multi-failover options
This patch adds the same style of multi-instance selection as inshutdown/startup to the failover subcommand, with the exception that wecannot failover with --node or --all (it doesn't make sense).
Implement replace-disks for drbd8 devices
This patch adds three modes of disk replacement for drbd8: - replace the disk on the primary node - replace the disk on the secondary node - replace the secondary node
It also adds some debugging code to backend.py and increments the...
Convert ListOS to use the all helper function.
The predicate function gets build by a lambda function.Also add a bit of debugging information to the 'unknown OS diagnose type'.
Initial implementation of drbd8 template type
This is a partially working drbd8 template type. It does: - add/remove - startup/failover/shutdown
Not working is replace disks, which needs custom code for this template.
Abstract more strings values into constants
Currently, the disk types are defined using constants in the code.Convert those into constants so that we can easily find them and checktheir usage.
Note that we don't rename the values of the constants as they are used...
Patch series for reboot feature, part 3
This patch series implements the reboot command for gnt-instance. Itsupports three types of reboot: soft (hypervisor reboot), hard (instanceconfig rebuild and reboot) and full (full instance shutdown and startupagain)....
Add the number of VCPUs in gnt-instance info
Allow force removal of instances
This patch adds a new option to the instance removal command"--ignore-failures" that forces the removal of the instance from theconfiguration even if the removal process encounters errors.
In order to be able to do this when the remote node(s) is(are) down, we...
Make “gnt-os diagnose” exit 1 if not all OSes are valid.
Reorder gnt-os simplify _GetAllOS and call it _DiagnoseByOS
Put some order in gnt-os putting helper functions above and command functionsbelow. Also add a new _DiagnoseOSName() function and use it to make _GetAllOSsimplier to understand. Change its name to _DiagnoseByOS which makes more clear...
Fix ListOS which was broken
To do this we abstract the creation of the all_os dictionary, which wasproduced in DiagnoseOS and use it both for listing and diagnosing.
Docstring correction
Implement gnt-node evacuate
This patch adds a new 'evacuate' subcommand to gnt-node. The commandwill do a replace disks for all instances having that node as secondarywith the new target being the new node given.
The syntax is: gnt-node evacuate src_node target_node...
Implement node failover
This patch implements a simple failover command for failing over allprimary instances. This is just a batched form of gnt-instance failover.
Refactor DiagnoseOS
The new version debugs Hidden OSes as well.
Add boot id to “gnt-node list”.
Add source file option for {add,remove}-tags
This patch adds a '--from' option to the {add,remove}-tags commands thatallows the command to read from a file or from stdin (when passing adash for the filename).
Implement command-line tags support
This patch adds generic functions for tag manipulations to cli.py andmodifies gnt-{cluster,node,instance} to export {list,add,remove}-tagscommands that use those.
Ship (and display) path for InvalidOS errors too.
- Document the expected change to errors.InvalidOS- Always pass the additional argument- Modify DiagnoseOS output to show the path
Reviewed-by: iustinp, imsnah
Fix OS Diagnose in light of the new OS Search path (Part One).
As of now only the last OS was taken into consideration by diagnose, fix bystoring them all and displaying for now only the first. Also display the sourcepath for valid OSes.
Add warning on gnt-node add operation.
People might not have read all the documentation and might not expect their ssh configurationand specially keys to be changed. Adding this warning will inform them before it happens.
Pass required ip_check parameter to OpCreateInstance in gnt-backup.
Ask for confirmation when touching multiple instances
This patch makes the new startup/shutdown multi-instance operations toask for confirmation when touching more than one instance (and unless--force-multi is given).
The code is not very short, but it does present a nice (IMO) user...
Improve the cli.AskUser() function
This patch improves the AskUser function by allowing it to: - choose from multiple choices (instead of only y/n) - give help to the user - preserve line breaks and whitespace formatting in the message
With this patch, an instance removal looks like this:...
Allow 'add instance' to not start the new instance
This patch allows 'gnt-instance add' to not start the newly-createdinstance. It also allow 'gnt-instance add' and 'gnt-backup import' tonot check for IP conflicts (only when not starting the instance)....
Implement cluster rename operation
This patch adds a new OpCode (and corresponding LU) that implements thecluster rename functionality.
This is done by shutting down the master role, making the needed sstoremodifications and distributing the changed files to all nodes, and then...
Fix a docstring
Implement instance rename operation
This patch adds support for instance rename operation at all remaininglayers: RPC, OpCode/LU and CLI.
Allow start/stop of multiple instances at once
This is an initial version of the multi-instance start/stop, whichallows the gnt-instance startup and shutdown subcommands to work onmultiple instances at once.
The available selections are: - "gnt-instance startup --instance name..." which is the default, and...
Change OpQueryNodes nodes attribute to names
Change this to have the exact same parameters as OpQueryInstances.
Also fix burnin which is broken since r146.
Enable LUQueryInstances to work with a given list of instances
As per the changes to LUQueryNodes, the QueryInstances LU is modified toaccept a list of instances for which to compute and return information.
Remove OpQueryNodeData and LUQueryNodeData
Now that LUQueryNodes supports all the functionality of LUQueryNodeData,let's migrate gnt-node.ShowNodeConfig to use it and remove all traces ofOpQueryNodeData and LUQueryNodeData.
Change LUQueryNodes to return raw values and support selective listing
LUQueryNodes it's very similar to LUQueryNodeData, but it lacks twofeatures: - instance list (it has count though), both primary and secondary - selective node listing
In order to support these features, we change it to return raw values...
Move string formatting out of LUQueryInstances
Currently, LUQueryInstances will provide strings for its results. This makes ithard for other consumers than "gnt-instance list" to use the OpQueryInstancesopcode for whatever they wish to.
The change moves the formatting in five of the six cases where this happens to...
Fix the manpage gnt-instance w.r.t. units
The manpage wrongly states that the default unit for disk sizes isgibibytes, whereas currently it's mebibytes. Fix that and also updatethe '--help' output to display the default unit.
Reviewed-by: roman.marxer
Rework ssh known-hosts handling.
This changes: - cluster setup, we no longer edit /etc/ssh/ssh_known_hosts but our own file - node add, we no longer remove root's known_hosts (twice) - gnt-instance console, both the LU and the script: since now the ssh...
Improve LURunClusterCommand
This function used a hand-coded ssh call to remote nodes. Fix it to use thessh.SSHCall function, and in the process drop the command field from theresults, as it's too verbose and we can use (in gnt-cluster) what we passed in....
Add support for listing instance disk sizes.
Change cli.OutputTable to cli.GenerateTable
Since the table generation might be useful elsewhere, let's change it toreturn the data instead of directly printing it.
Its callers have also been updated.
Style changes for pep-8 and python-3000 compliance.
This changes the raising of exceptions from: raise Exception, valueto raise Exception(value)
as the first form will be removed in python-3000 and the second form ispreferred now.
The changes also involve a few cases of changing from raising standard...
Import constants into gnt-cluster.
Put default bridge into constant.
Fix a function's doc string
Use OutputTable for “gnt-os list”.
Remove defectiv comma.
- Implement “gnt-instance reinstall --os-type=…”- Add the command to gnt-instance.sgml
Fix the "gnt-cluster getmaster" command by making the LuQueryClusterInforunnable on non-master nodes (and remove the list of instances and nodesreturned by it, that information can be retrieved by other opcodes).
Also, remove the node/instance list from "gnt-cluster info" as it...
- Move --force option to cli.py- Implement “gnt-instance reinstall”- Fix two typos
Comment formatting updates.
Use generic function to output tables.
- Implement “gnt-node volumes”- Create all --output options using a constant- Put node checking code from opcodes into a single function- Do the same for output fields
Big change/cleanup in relation to the master startup: - move the master node name from the ConfigWriter to SimpleStore (all nodes need this, and it was the only thing pulled in from the ConfigWriter on nodes) - fix mcpu.py and the testing w.r.t. this change; for testing, rename...
Fix small typo.