Add function to determine current configuration version
The 'gnt-cluster upgrade --resume' command needs to determine whether theconfiguration has already been updated or not, in order to decide at whichphase to resume. So provide a function to determine the version of the...
Add method to read and parse the intent-to-upgrade file
During upgrades, a file is written to disk on master that documentsthe fact that an upgrade is currently in progress. Add a functionto parse it.
Signed-off-by: Klaus Aehlig <aehlig@google.com>Reviewed-by: Thomas Thrainer <thomasth@google.com>
Write the intent-to-upgrade file during upgrades
To recognize that an upgrade attempt of a cluster was interrupted by apower failure or similar, write a file into the file system documentingthat currently an upgrade is in progress.
Signed-off-by: Klaus Aehlig <aehlig@google.com>...
Add an upgrade command to gnt-cluster
This command will coordinate the switching to a newGaneti version across the cluster. This has becomepossible by the new layout that allows several Ganetiversions to be present at the same time.
Add option to redist-conf while queue is drained
Add a new option to 'gnt-cluster redist-conf' allowing to ignore a drainedstate of the Ganeti queue. This is needed (until we implement the fine-grainedqueue control) during upgrades, as here we have to redistribute the configuration...
Replace 'IALLOCATOR_NEVAC_*' with 'NODE_EVAC_*'
Replace uses of 'IALLOCATOR_NEVAC_PRI', 'IALLOCATOR_NEVAC_SEC','IALLOCATOR_NEVAC_ALL', and 'IALLOCATOR_NEVAC_MODES', with'NODE_EVAC_PRI', 'NODE_EVAC_SEC', 'NODE_EVAC_ALL', and'NODE_EVAC_MODES', given that these constants are repeated....
Merge branch 'stable-2.9' into master
Fix some wrong indentations in the code
Fix all instances of pep8's error: "E128 continuation line under-indented forvisual indent".
Signed-off-by: Michele Tartara <mtartara@google.com>Reviewed-by: Guido Trotter <ultrotter@google.com>
Remove physical_id field from disk object
The 'physical_id' field of disk objects is no longer used, so remove it.Also, all references are removed together with the code which made surethat the physical_id is up to date when transmitted over RPC.
Signed-off-by: Thomas Thrainer <thomasth@google.com>...
Replace LD_* constants with DT_* constants
LD_* constants are basically like DT_* constants, exceptfor that both file and shared file were mapped to file.In order to not having to maintain three slightly differentsets of disk-related constants (DT, LD and ST), we merge...
CLI: actually remove the --no-drbd-storage option
This removes the '--no-drbd-storage' option completelyfrom the command line interface. The hugepages designdoc still had a left-over reference to --no-lvm-storage,which is removed in this patch as well....
cluster init/modify: set helper without DRBD being enabled
The logic around the DRBD usermode helper so far was thatsetting it was only possible when DRDB was not explicitelydisabled. This patches changes it in a way that it isconsistent to how Ganeti handles the volume group name....
cluster modify: deprecate --no-drbd-storage
As in the previous patch, the option '--no-drbd-storage'is deprectated, because it is subsumed by the non-inclusionof 'drbd' in the list of enabled disk templates.
Signed-off-by: Helga Velroyen <helgav@google.com>...
cluster init: deprecate --no-drbd-storage
Whether or not a particular type of storage is enabledor not is determined by the list of enabled disk templatesin the cluster's configuration. This makes the option'--no-drbd-storage' obsolete, because it is subsumed by...
gnt_cluster.py: unit test for usermode helper
This patch factors out the functions in gnt_cluster(related to cluster init and cluster modify) whichdeal with setting / determining the drbd usermode helperto make them more testable. Unit tests for the extracted...
Add parameters for OpenvSwitch to gnt-node
Extend gnt-node by parameters for OpenvSwitch. --ovs Flag to enableOpenvSwitch, --ovs-name for the name of the OpenvSwitch and --ovs-linkfor the interface to connect to.
Signed-off-by: Sebastian Gebhard <sege@fs.ei.tum.de>...
gnt-group add/modify: ipolicy vs disk templates
This patch adds a consistency check between the ipolicy'slist of allowed disk templates with the cluster-wideenable disk templates when a new node group is addedor a group is modified.
It also fixes a bug in gnt-group where the list of allowed...
Merge branch 'stable-2.9'
Merge branch 'stable-2.8' into stable-2.9
Merge branch 'stable-2.7' into stable-2.8
Include VCS version in `gnt-cluster version`
Also print the VCS version in the output of `gnt-cluster version`. Thismakes the VCS version also available over RAPI, etc.
Signed-off-by: Thomas Thrainer <thomasth@google.com>Reviewed-by: Helga Velroyen <helgav@google.com>
Add cleanup parameter to instance failover
Most of the code is shared with instance migrate, so we actually only needto add the parameter and pass its value along the the common code.
Also, tests and harep are updated to support the right set of options to...
Format gnt-network info group output
gnt-network info currently displays the connected group output unformatted:
This patch adds formatting to the node group output....
Extend gnt-instance show to show vlan parameter
Extensions for "gnt-instance show" to output the vlan parameter whichwas introduced by my recent patch series.This is done by extending the nic object that is used to output theinfo. Every other occurrence of this object is adopted as well....
gnt-cluster {init, modify} --file-storage-dir
This patch implements consistent usage and behavior ofthe --file-storage-dir option in 'gnt-cluster init'and 'gnt-cluster modify'. It includes a bunch of unittests as well.
Additionally, it enables the previously written unit...
Fix KeyErrors with network mode and vlan
This patch fixes some KeyErrors that were introduced by the vlan implementationand showed up when certain parameters were missing:gnt-cluster init without network modegnt-isntance add without vlan
Set default OVS in cluster init
This commit adds functionality to gnt_cluster to set the defaultmaster-netdev for openvswitch, when openvswitch mode is configured,instead of DEFAULT_BRIDGE.
Signed-off-by: Sebastian Gebhard <sege@fs.ei.tum.de>Signed-off-by: Klaus Aehlig <aehlig@google.com>...
Merge branch 'stable-2.8' into master
Allow modify_etc_hosts to be changed
The modify_etc_hosts options, enabling the cluster to modify the /etc/hostsfiles of nodes, and to keep them in sync, could only be set at cluster inittime.
With this commit it can now be changed through modify_etc_hosts as well....
Fix gnt-network info
QueryNetworks() returns the uuids of the instances that areinside a network. Since QueryInstances() uses names and not uuidsfor search, we create a uuid2name dict to get each instance nameand then retrieve its nics and networks.
Signed-off-by: Dimitris Aragiorgis <dimara@grnet.gr>...
Merge branch 'stable-2.8' into 'master'
Index nodes by their UUID
No longer index nodes by their name but by their UUID in the clusterconfig. This change changes large parts of the code, as the followingadjustments were necessary: * Change the index key to UUID in the configuration and the ConfigWriter, including all methods....
Add an option to print job id of submitted jobs on stdout
When submitting a job, the job id, prefixed by 'JobID: ', is output tostderr. While this is easy to understand for humans, for scripting, itis more convenient to have (additionally) the id on stdout (and only...
Add new command gnt_job wait
This command tacitly waits for a job to finish. In thatway, job dependency can also be handled in shell scripts.
Signed-off-by: Klaus Aehlig <aehlig@google.com>Reviewed-by: Helga Velroyen <helgav@google.com>
Add --force option to gnt-cluster modify
Make the force option of the ClusterSetParams Opcode availableon the command line.
Signed-off-by: Klaus Aehlig <aehlig@google.com>Reviewed-by: Michele Tartara <mtartara@google.com>
gnt-cluster info: only parameters for enabled hypervisors
In the output of gnt-cluster info, restrict the hypervisor parametersto those hypervisors that are enabled. This fixes issue 443.
Signed-off-by: Klaus Aehlig <aehlig@google.com>Reviewed-by: Bernardo Dal Seno <bdalseno@google.com>
gnt-instance info prints information about spindles
For each disk, the number of requested spindles (if present) is shown.
Signed-off-by: Bernardo Dal Seno <bdalseno@google.com>Reviewed-by: Thomas Thrainer <thomasth@google.com>
gnt-job list: deal with non-ascii encoding in jobs
This fixes issue 432. If a job summary contained a non-ascii character,gnt-job list crashed badly so far. This patch fixes the crash and makesgnt-job list display unicode characters properly.
Make DEFAULT_ENABLED_DISK_TEMPLATES a list
This patch makes the constant DEFAULT_ENABLED_DISK_TEMPLATESa list instead of a set, because the order of the elements actually mattersas the first one is planned to be the default disk template for instancecreation. Also, this constant is always used like a list and thus providing it...
gnt-cluster modify/init: deprecate --no-lvm-storage
This patch does three things:
1. It deprecates the option '--no-lvm-storage' of 'gnt-cluster modify'and 'gnt-cluster init'. Technically, it is not fully removed, but kept in orderto warn the user that it is no longer supported and that she should use...
Limit specs in ipolicy command lines are always complete
Command line options are brought in line with the specs change of previouspatch. Old options are still allowed in gnt-cluster init, where thesemantic will remain non-ambiguous even after introducing multiple specs....
Add --ipolicy-xxx-specs options
These options allow to specify whole instance policy specs. This is neededfor the upcoming changes that tend to threat specs as monolithic objects.
Signed-off-by: Bernardo Dal Seno <bdalseno@google.com>Reviewed-by: Helga Velroyen <helgav@google.com>
Add command to print ipolicy options
The output of this command can be used to create an exact copy of thecurrent instance policy specs. The command could be expanded to print allthe options used to create a group or the cluster.
Signed-off-by: Bernardo Dal Seno <bdalseno@google.com>...
Remove old "reason" implementation
Remove the useless parts of the old, partial, implementation of the support fortracking the reason of instances state change, before implementing the newreason trail support, as per the design document.
Signed-off-by: Michele Tartara <mtartara@google.com>...
Display UUIDs and names in gnt-instance info
Modify gnt-instance client to display the UUID and namefields of instances disks and NICs.
Signed-off-by: Christos Stavrakakis <cstavr@grnet.gr>Signed-off-by: Dimitris Aragiorgis <dimara@grnet.gr>Reviewed-by: Helga Velroyen <helgav@google.com>
Support UUIDs and names when refering to a device
Modify _ApplyContainerMods function to lookup NICs/Disks not only by theirindex inside the container, but also by their UUID or name. Abstract thelookup code in new GetItemFromContainer function.
Make type of identifier in "opcode._TestInstSetParamsModList" to be...
Removes obsolete 'enabled storage types'
Since managing of different storage units is now done usingdisk templates and not storage types, we remove the obsoleteenabled storage types.
Signed-off-by: Helga Velroyen <helgav@google.com>Reviewed-by: Michele Tartara <mtarara@google.com>
gnt-cluster init: enabling of disk templates
This patch enhances 'gnt-cluster init' to accept a list of disk templatesto be enabled. It removes the list of enabled storage types.
gnt-cluster modify: modify enabled disk templates
Adds setting of the list of enabled disk templates to 'gnt-cluster modify'.Note that this does not yet include any verification regarding disk templatescurrently used by instances.
gnt-cluster info: report enabled disk templates
Add reporting of the currently enabled disk templates to'gnt-cluster info'.
gnt-group info uses a revised format
The code is more modular, the output is more similar to "gnt-cluster info" and is YAML-compliant.
gnt-node info uses a revised format
The code is more modular, and the output is YAML-compliant. QA has beenupdated to reflect the new format.
Refactor out function to format instance policy
The new function can be used for group-level instance policies. Support forroman numeral formatting has been dropped to make the code simpler. Forother info items it's already unsupported, and it's not exactly documented...
Fix help string for gnt-group info
Add option --new-primary to gnt-instance modify
Extend gnt-instance modify by a new parameter --new-primarythat sets the pnode paramter of the opcode.
Signed-off-by: Klaus Aehlig <aehlig@google.com>Reviewed-by: Guido Trotter <ultrotter@google.com>
Refactor ispecs in ipolicy structures
Minimum and maximum instance specs are put together into a single elementof the instance policy. This is in preparation for introducing multiplemin/max specs.
Remove duplicate filling of instance policy
Instance policy fields were manually filled in CreateIPolicyFromOpts() andthen filled again by the caller. Now they are filled once inside thefunction.
gnt-instance info uses a revised format
The code is more modular and the output is YAML-compliant. QA updated totake advantage of it.
gnt-cluster info uses a revised format
The code is more modular and the output is YAML-compliant.
Added function in QA that uses PyYAML to parse the command output, and QAis updated to take advantage of it (instead of using lots of complicatedREs).
gnt-cluster init: add enabled_storage_types parameter
This patch extends the 'gnt-cluster init' command to set the listof enabled storage types on cluster creation.
Signed-off-by: Helga Velroyen <helgav@google.com>Reviewed-by: Guido Trotter <ultrotter@google.com>
gnt-cluster modify: dis/enabling storage types
This patch extends the 'gnt-cluster modify' command to manipulate the listof enabled storage types. Note that this currenlty does no validationwith respect to whether or not there are instances currently using a storage...
gnt-cluster info: show enabled storage types
This extends the 'gnt-cluster info' command to list the storage typesthat are enabled on the cluster. It also fixes the broken indentationin the 'handleCall' function.
Enable split queries for the network
Now that all fields are implemented, and (I think) behave equivalentto the Python implementation, we can switch on the split queries fornetworks.
Signed-off-by: Iustin Pop <iustin@google.com>Reviewed-by: Helga Velroyen <helgav@google.com>
Enable split queries for export in CLI
Rapi doesn't seem to export backup lists, so we enable the split queryonly in gnt-backup.
Signed-off-by: Iustin Pop <iustin@google.com>Reviewed-by: Michael Hanselmann <hansmi@google.com>
Merge branch 'devel-2.7'
Minor fixes regarding nic.network change
Make LookupNetwork() return None in case target is None. This fixesIssue 380. Rapi passes network=None and the lookup should not fail.
Make network client aware of new nic.network.gnt-network info showsthe IPs of each instance inside the network. It parses nic.networks...
Fix issue 378
In case a NIC is not inside a network then netinfo None. Thusnetinfo["name"] fails.
Signed-off-by: Dimitris Aragiorgis <dimara@grnet.gr>Reviewed-by: Helga Velroyen <helgav@google.com>
Status change reason support for Reboot
Add support to the Reboot command for specifying the reason for the laststatus change.
Some features are implemented as functions, even if used only once, becausethey will be used by the future patches introducing reason support for all...
Infrastructure for specifying instance status change reason
This patch introduces some infrastructural modifications that will be used bythe following commits to implement the support for specifying the reason forthe last status change of an instance....
Show network name and not uuid in instance info
This was before the case too. Now is bit trickier because nic.networkis uuid. Info must derive from nic.netinfo.
Revert "Disable live-RPC queries under split query"
This reverts commit fb251c2c4c582ec0d6c00a6f6c5e134ed5196e03. On themaster branch we want to continue to have them enabled.
Force conflicts check in LUNetworkDisconnect
Until now if one disconnects a network with --no-conflicts-checkand then remove it, there is a possibility to leave instances with NICsreferencing non-existing networks. This causes network queries,instance removal and modification to fail....
Remove network_type slot (Issue 363)
This slot was not used by Ganeti so the same info can beprovided via tags. In order not to break configuration datawe add a FromDict() method in Network config object thatremoves the deprecated network_type (if found) and then invoke...
Make gnt-os list work with no OSes
When absolutely no OSes are present on the cluster, the result ofOpOsDiagnose is an empty list. This is currently handled in gnt-os asan error condition, probably due to how OpOsDiagnose used to returnerrors in the past....
Disable live-RPC queries under split query
Currently, the node listing RPC is very slow due to missingparallelisation. For the 2.7 release, we reset these back to masterd,hoping to revert them by the time 2.8 is ready.
There are a number of queries that I've left pointing to confd, as...
List networks: call client explicitely
This way, it is easier to make it call the haskellimplementation of the network queries.
Signed-off-by: Helga Velroyen <helgav@google.com>Reviewed-by: Michael Hanselmann <hansmi@google.com>
Handle the result of QueryGroups() correctly
If no group is given for the “gnt-network connect“/“… disconnect”commands, the client uses the result of “QueryGroups()” which is a listof lists. Use “itertools.chain()” to handle the return value correctly....
Add the gnt-storage client
Add a new client called 'gnt-storage'.The client interacts with the ExtStorage interface, similarly tothe way gnt-os interacts with the OS interface.
For now, only two commands are supported: 'info' and 'diagnose'.
'diagnose' calculates the node status of each provider on each node,...
gnt-network: Fix CLI issues with node groups
The original implementation reserved the name “all” to specify all nodegroups. That would prevent the use of a node group actually named “all”.
This patch changes the order and definition of the command line...
gnt-network CLI improvements
- Use unpacking instead of addressing indivdual list items- Add “--submit” and “--priority” support where possible- Re-use LUXI client where possible- Fixed some typos
There is still an issue that a node group named “all” can not be...
Format network field "group_list" in client
The field is now a list of tuples containing the group name, mode andlink.
Signed-off-by: Michael Hanselmann <hansmi@google.com>Reviewed-by: Guido Trotter <ultrotter@google.com>
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...
gnt-network: Fix import for textwrap
The style guide says to use “import foo”-style imports, not “from fooimport bar” unless it's a Ganeti module. There are some places withexceptions, but this one certainly isn't warranted. Also fix the importorder....
gnt-network add: "--network" is required
Also do some minor code re-formatting.
Signed-off-by: Michael Hanselmann <hansmi@google.com>Reviewed-by: Iustin Pop <iustin@google.com>
gnt-network add: Network mode bash completion
This makes entering the command easier.
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....
Enable job queries via confd in gnt-node and RAPI
This patch is enabling split queries for jobs for gnt-node and rapiaccess (only for job listing, not job waiting).
Allow shutting down offline instance
If an instance is offline we definitely shouldn't start it up.But shutting it down, should it be up by mistake is not "that" bad.Still, we only allow it with --force, as it still performs an action onan instance we shouldn't touch. This should make everybody happy....
uidpool: Remove roman number support
Doing so simplifies to code a bit and never had a practical use.
Switch from scp/ssh to node daemon setup utility
This patch does away with many calls to scp and by means of using“tools/node-daemon-setup”, verifies most of the values before writingthem to files.
Signed-off-by: Michael Hanselmann <hansmi@google.com>...