Implement the backward-compatible ‘-s’ disk option
This patch adds back to the instance creation command (gnt-instace add,gnt-backup import) the ‘-s’ short form option for specifying asingle-disk instance.
Also a small bug in gnt-backup import is fixed....
Some command line scripts fixes
This patch changes the gnt-node and gnt-job list commands to acceptargument and list only the selected items, which is useful when havingmany nodes or jobs.
It also removes the “--units” option from gnt-job list as we don't...
Always use the same short option for iallocator
This patch changes the scripts so that the short name for the“--iallocator” option is always ‘-I’.
Reviewed-by: ultrotter
Some batcher fixes
Currently the batcher hypervisor parameter must be a dict with oneelement (e.g. {"xen-hvm": { "acpi": true }}). This is overly complex andhard to validate correctly; the patch splits it in two: - one "hypervisor" string parameter, with the name of the hypervisor...
gnt-instance fix a typo in AddInstance
It's hvparams, not opts.hvparams.
Reviewed-by: iustinp
gnt-cluster, pass hvparams directly to dict()
If hvparams is not set it will be [], so dict() will transform it to anempty dict, which is safe in all cases.
Sort instance data in gnt-node info
The patch sorts the instance list in gnt-node info output, in order tomake it more readable (and stable).
Reviewed-by: imsnah
Some fixes to node add and re-add
The patch changes the pre-checks in node-add and re-add: - if the node is not already in the cluster, refuse to re-add - when re-adding, reuse the secondary IP from the cluster configuration - when re-adding, reset the offline and drained flags, so that RPC...
Instance parameters: force typing
We want all the hv/be parameters to have a known type, rather than arandom mix of empty string, boolean values, and None, so we declare thetype of each variable and we enforce/convert it.
- Add some new constants for enforceable value types...
Implement modification of the drained flag
This patch adds LU and cli-level support for modification of the nodedrained flag. It is similar to the offline changes.
Allow query of the drained node attribute
This patch exports the drained attribute: - LUQueryNodes accepts now the drained field - RAPI exports it for node objects - gnt-node info shows it now (along newly-added master_candidate and offline flags)...
Add a new instance query flag ‘disk_usage’
This patch adds a new instance query flag called disk_usage thatretrieves the overall space used by an instance on each of its nodes.This can be used when balancing the cluster or checking N+1 status.
The flag is also exported in RAPI. Note the flag is currently broken for...
Export the cpu nodes and sockets from Xen
This is a hand-picked forward patch of commit 1755 on the 1.2 branch(hand-picked since the trees diverged too much since then):
The patch changed the xen hypervisor to compute the number of cpu sockets/nodes and enables the command line and the RAPI to show this...
Fix some issues for lockless queries
This patch converts some more jobs with only queries into cheaper luxiqueries (no job created), and fixes some fallout from the locklessqueries changes.
Enable lockless node queries
Similar to the instance list, this patch enables lockless node queris.“gnt-node list” accepts now the “--sync” flag which enables locking, thedefault is lockless.
ssconf: add some more keys and some fixes
This patch adds the online node list and instance list to the ssconfkeys. In order to do distribute correctly the instance list, we need toupdate the cluster serial number on instance additions and removals.
The patch also changes the permissions on the ssconf files to be 0444:...
Implement lockless query operations
This patch adds the framework for, and enables lockless OpQueryInstances. Thismeans that instances will be shown in ERROR_up or ERROR_down state, even thoughthis is not an error (but just an in-progress job).
The framework is implemented as follows:...
Allow gnt-node evacuate to use an iallocator
This is a partial implementation of fully automated node evacuation:we allow passing an iallocator and all instance replace-disks will beexecute via that iallocator.
The individual OpReplaceDisks opcodes are submitted in a single job,...
Add gnt-node migrate
This is a (modified) forward-port of commit 1190 on the 1.2 branch:
This is the same as gnt-node failover, and is also a cut&paste of its code (almost). It will be really really useful to quickly empty a healthy node. I can be persuaded to merge MigrateNode and FailoverNode...
An attempt at fixing some encoding issues
This patch unifies the hardcoded re-encoding attempts into a singlefunction in utils.py. This function is used to take either an unicode orstr object and convert it to a ASCII-only str object which can be safely...
gnt-instance: support no_PARAMETER value
Since parameters get set to False if a no_ is prefixed don't try tointerpret those boolean values, and pass them unchanged.
gnt-instance list: accept input names
Currently gnt-instance list will refuse to take arguments, and alwaysreturn the full list of instances. This patch allows it to pass names toLUQueryInstances, so that we restrict the input to a given set ofinstances....
Check that instance exists before confirm. queries
Currently we ask the user for confirmation, and only after (try to)remove, failover or migrate the instance. This doesn't work nicely ifthe instance doesn't exist, so we make a query for the instance before...
Rework the multi-instance gnt commands
This patch changes the multi-instance gnt-* commands (gnt-instancestart/stop, gnt-node evacuate/failover) such that the individualoperations are submitted in parallel, ideally improving the speed of theexecution....
Sort the instance names in batcher
In case we submit multiple instances via batcher, it's nicer to have thesorted nicely.
Fix batcher for 2.0-style disks and nics
This patch fixes the gnt-instance batch-create command, and in doing soalso slightly changes two other functions: - we change utils.ParseUnit so that it accepts integer values also (both ParseUnit(5) and ParseUnit("5") return the same value)...
Make iallocator work with offline nodes
This patch changes the iallocator framework to work with and properlyexport to plugins offline nodes. It does this by only exporting thestatic configuration data for those nodes, and not attempting to parsethe runtime data....
A couple of small fixes to iallocator
This removes some constraints: - only two disks supported, this is no longer true as the underlying functions can now compute size for a variable number of disks - error when the hypervisor was not being passed...
Fix a couple of epydoc warnings
Move the default MAC prefix to the constants file
Instead of having the default live in the gnt-cluster script, we move itto the constants file. The patch also fixes a typo on constants.py.
Forward port the live migration from 1.2 branch
This is forward port via copy (and not individual patches cherry-pick)of the latest code on the 1.2 branch related to the migration.
The changes compared to 1.2 are the fact that we don't need theIdentifyDisks step anymore (the drbd rpc calls are independent now), and...
Skip offline nodes in gnt-cluster commands
This patch makes gnt-cluster copyfile and command skip the offlinenodes.
Reviwed-by: ultrotter, imsnah
Heavy redo of gnt-instance info output
In 2.0, we have more parameters in drbd's logical_id, and passing theresults over json makes them unicode which looks worse with the defaultformatting. As such, a redo of the output is needed.
This patch: - adds a separate function to format the logical_id of devices...
Introduce a very simple LU to force config updates
This LU can be used to force a push of the config in case it's needed,for example after an upgrade to update the ssconf_release_version file.
Cleanup replace-disks modes and options
In 1.2, due to the md+drbd7 legacy, we had a complex choice of replacemodes, and the new drbd8 modes where forced into this syntax, with somecomplicated rules of transition from one mode to another (if REPLACE_ALL...
Prevent RPC timeout on auto-archiving jobs
With a large job queue, auto-archiving jobs can take a very long time,causing timeouts on the luxi RPC layer. With this change, auto-archive returns after half of the RPC timeout has passed. The userwill see how many jobs are left unchecked....
Fix epydoc format warnings
This patch should fix all outstanding epydoc parsing errors; as such, weswitch epydoc into verbose mode so that any new errors will be visible.
gnt-node modify: add the offline attribute
This patch changes gnt-node modify and the associated opcode/lu to allowmodification of the node offline attribute.
Setting a node into offline mode automatically demotes it from themaster role.
node list: add the offline field
gnt-cluster init, handle candidate_pool_size
- Add a new command line option, defaulting to the constant value- Pass the value to bootstrap.InitCluster- Use it to init the new Cluster object
Extract the ListNodes headers and use them in help
Currently we have to update both the ListNodes headers and the onlinehelp for the full field list. This patch uses the headers keys for thehelp, thus removing duplicating places to update, and adding hope that...
cluster init: don't discard the hypervisor
On cluster init if the user specifies a default hypervisor (with -t)which is not in the default list of enabled hypervisors (currently justxen-pvm) without explicitely specifying the list we silently overridethe choice....
SetInstanceParams: handle default/none values
If the hv/be parameter lowercase value is set to "default" we'll passconstants.VALUE_DEFAULT, if it's set to "none" we'll passconstants.VALUE_NONE.
Update gnt-backup online help
--src-node and --src-dir are not mandatory anymore
Add cluster candidate pool size parameter
This patch adds a new cluster paramater "candidate_pool_size" whichtracks the desired size of the list of nodes with the master_candidateflag set.
Add a gnt-node modify operation
This patch adds the OpCode, LogicalUnit and gnt-node command formodifying node parameters, more specifically the master candidate flagfor a node.
Add master/master_candidate fields to node list
This patch adds listing of the master_candidate field (as Y/N) and ofthe master role (again Y/N) for nodes.
gnt-instance add: Remove "--os-size" and "--swap-size"
They're not used anymore.
gnt-job: Print message from CancelJob to standard output
jqueue: Allow jobs waiting for locks to be canceled
- Add new "canceling" status- Notify clients when job is canceled- Give a return value from CancelJob- Handle it in the client library
Improve the node add operation
Currently, the node add operation uses a job to query the node name andthe bootstrap function directly reads the config file for the clustername.
This patch changes to that both the cluster name and the verification ofthe node is done via queries to the master....
instance import: adapt to multi-disk/nic world
This is mostly a copy from gnt-instance add; import works, but it's notoptimal - device count/parametrs should be able to be reused.
Allow network-less instances
Currently there's no way to specify no NICs for an instance, even thoughthis is a supported configuration.
The patch adds a --no-nics option to gnt-instance add.
Reviewed-by: amishchenko
Fix gnt-job submit
The submit function was using a very old API. This patch brings it up todate.
Fix instance creation
This patch fixes the diskless and drbd/file based instances. Sorry :(
Implement support for multi devices changes
This big patch adds support for: - changing NIC/disks in the multi-device model - adding/removing NICs - adding/removing disks
The patch is big and not very nice; the error checking paths are notvery clear....
Show disk access mode in gnt-instance info
The mode parameter needs to be exported and shown in the info output.
Slighly improve multi-nic in gnt-instance info
Previously we had only one nic, so the NIC information was all on oneline. This patch changes it to:
- NICs: - nic/0: MAC: aa:00:00:e8:b2:ef, IP: None, bridge: None - nic/1: MAC: aa:00:00:53:ca:92, IP: None, bridge: xen-br0...
Enable auto-unit formatting in script output
This patch enables by default the old 'human-readable' option, but in aslightly different model.
The option is now called "units" and takes either: - 'h' for automatic formatting - 'm', 'g' or 't' for mebi/gibi/tebibytes...
Improvements to CLI output
This patch adds nicer formatting for some gnt-instance list operations.
Make cli.py use FieldSet for matching fields
This changes cli.py to FieldSet usage so that gnt-instance list willformat nicely the disk.size/*, and the count of disks/nics.
Change GrowDisk to work with multi-disk
This patch changes the instance.FindDisk method to take index arguments(instead of iv_names), and changes GrowDisk and list instancesaccordingly.
Reuse HTTP client pool for RPC
ganeti-masterd: Add initialization and shutdown of RPC pool. It needsto be shutdown before forking.
ganeti.cli: Add decorator function to initialize and shutdown RPC pool.
ganeti.rpc: Add functions to initialize and shutdown RPC pool. Throw...
Convert replace-disks (same nodes) to multi-disk
This patch changes the drbd8 replace disk only (no secondary change) towork in with multi-disk. This mode of replaces works correctly withreplacing only a subset of disks.
Initial multi-disk/multi-nic support
This patch adds support for mult-disk/multi-nic in: - instance add - burnin
The start/stop/failover/cluster verify work as expected. Replace diskand grow disk are TODO.
There's also a change gnt-job to allow dictionaries to be listed in...
Fix gnt-cluster init without cluster parameters
Documentation updates for gnt-debug and gnt-os
Documentation updates for gnt-job
Documentation updates for gnt-backup
Change exit code of gnt-backup list
Currently gnt-backup list exits with the same error code even if can'tcontact som nodes for backup information.
The patch changes it to return 1 instead in this case.
Documentation updates for gnt-node
The patch also adds a 'return 0' to a function that was missing it.
Documentation updates for gnt-cluster
Documentation updates for gnt-instance
Fix use of ToStderr in gnt-cluster
convert remaining print statements to ToStderr in gnt-cluster
Set default hypervisor at cluster init
During cluster init, set the default hypervisor to be used for instances.Ensure that the default hypervisor belongs to the set enabled hypervisorsfor this cluster. Also fix a small bug with setting the default enabled...
Add mac option to gnt-backup import
Before 'auto' was the only allowed possibility
Forward-port-of: r1885, Reviewed-by: iustinp
Fix some pylint-detected issues on the scripts
Some names were wrong, and similar stuff detected by pylint.gnt-debug.GenericOpCode is still broken.
Convert the gnt scripts to ToStdout/err
Currently the gnt-* scripts are using a mix of print, logger.ToStd* andsys.stderr.write. We convert them all to using cli.ToStdout/err. Thisway, we can easily change the implementation for all at once.
Fix gnt-instance modify with beparams
The gnt-instance modify didn't work correctly w.r.t the be parameters.There was also a typo in the corresponding LU.
Remove --hypervisor-type from gnt-cluster.
We no longer use a single, cluster-wide hypervisor, but configure theactual to be used hypervisor on the instance level.
Fix gnt-cluster init to set cluster defaults.
Enable gnt-cluster modify to hv/beparams
This patch enables the cluster modify to change: - enabled hypervisor list - hvparams (per hypervisor) - beparams (only the default group)
Syntax: gnt-cluster modify -B vcpus=3 -H xen-pvm:no_initrd_path
Validation for parameters is somewhat missing - the individual...
Show the cluster parametrs in gnt-cluster info
This is just a raw update without any special formatting.
Add an interface for the drain flag changes/query
This adds the set/reset in the jqueue and luxi modules, and a way toquery it in OpQueryConfigValues, and also the comand line interface forit:$ gnt-cluster queue infoThe drain flag is unset$ gnt-cluster queue drain...
Adding batch-create to gnt-instance
This change is part of the integration of tools/batcher fromGaneti 1.2 into Ganeti 2.0 core code. It has a compatiblesubmission interface to the version from 1.2 with these differences:
gnt-backup: update for cluster parameters
- add backend and hypervisor parameters- fix beparams validation/passing- pass hypervisor and hvparams- remove deprecated flags
gnt-instance fix ValidateBeParams call
ValidateBeParams does not return, but its return value is assigned to avariable which is never used. Avoid this assignment.
gnt-instance remove deprecated flags
kernel, initrd, hvm_boot_order and vnc_bind_address are now hypervisorparameters and should not have their own flag. Moreover querying ofvnc_bind_address should of course pass through the hv/ namespace.
grow-disk: wait until resync is completed
The patch adds a new ‘--no-wait-for-sync’ parameter to grow-disk similarto the one in instance add, and changes the default to wait.
This is cleaner as at the moment when the command returns, we eitherhave a fully synced disk or there is an error....
Some fixes related to auto_balance
Change the constant name to match the value (autobalance ->auto_balance).
Also add the auto_balance header so that gnt-instance can list it.
Change over to beparams
This big patch changes the master code to use the beparams. Errors mighthave crept in, but it passes a small burnin.
Allow instance info to only query the config file
This patch adds a new '-s' parameter to ‘gnt-instance info’ that makesit return only 'static' information. This is much faster, especially fordrbd instances.
This is a forward-port of rev 1570 on the ganeti-1.2 branch, resending...
Convert gnt-instance info to the hvparams model
Some informations are not printed nicely (e.g. “virtual CDROM: False”),but this is the first step.
Change gnt-instance modify to the hvparams model
Change gnt-instance list to the hvparams model
This is just a change of the various hvm_ and pvm parameters to the hvmodel. Parameters are queried via hv/$name or via the whole dict asreturned by hvparams.
Reviewed-by: ultrotter,imsnah
Switch instance hypervisor parameters to hvparams
This big patch changes instance create to the new hvparams structure.Old parameters are removed, so old jobs or old instances file will breakcurrent clusters.
Update scripts and qa config for changed hypervisor names.
Move the hypervisor attribute to the instances
This (big) patch moves the hypervisor type from the cluster to theinstance level; the cluster attribute remains as the default hypervisor,and will be renamed accordingly in a next patch. The cluster also gains...
Change default instance reboot type to hard.
Merged r1777 from branches/ganeti/ganeti-1.2