(grnet) Remove deprecated physical_id if found
In 2.8 disks have been added to runtime files for hotplug support.Back then physical_id slot existed. Remove this slot in the earlystage of Disk.FromDict() otherwise an exception will be raised.
Signed-off-by: Dimitris Aragiorgis <dimara@grnet.gr>
(grnet) Upgrade runtime files
Each disk entry should include (disk dict, link name, disk uri).
When hotplug was backported in 2.8 access uri was not supported.Thus the relevant entry for each disk entry might be missing fromthe runtime files. Add an empty string in this case....
ifdown: Use new methods to unconfigure NICs
We unconfigure a NIC (invoke ifdown script) during:
In case of migration we do only a local cleanup.
ifdown: Use new methods to create NIC files
NIC files containing corresponding tap name are created during:
For compatibility we continue creating indexed based NIC files alongwith uuid based ones.
ifdown: Introduce _UnconfigureNIC() helper method
This method takes a NIC object, creates the proper invironmentand invokes ifdown script.
It takes an extra boolean argument only_local which is passedto ifdown script as the second positional argument. It states...
ifdown: Make Read/LoadKVMRuntime classmethods
.. and make LoadKVMRuntime() take instance_name rather than thewhole instance object as first argument. This will be needed duringinstance cleanup where we the instance object is not available.
We are going to retrieve current NIC configuration from the runtime...
ifdown: Extract env creation from ConfigureNic()
Introduce new helper method that creates the environment passedto ifup/ifdown scripts. Instance tags and NIC index will be passedonly during ifup script since only then are available andvalid. Both can change until a NIC gets removed and thus will not...
ifdown: Introduce helper methods
Until now Ganeti upon TAP creation, a NIC file was createdunder $RUNDIR/kvm-hypervisor/nic/<instance_name>/<nic_index>
Since NICs have obtained a UUID, we are going to create anotherfile named after its UUID. This will be needed during ifdown...
ifdown: Change kvm-if* scripts
ifdown: Add example kvm-ifdown script
This script currently does nothing more that calling user theuser provided one if it exists.
User provided script should be placed under /etc/ganeti/and named `ganeti-kvm-ifdown`.
(ipfix) Allow NICs with mode=routed and ip=none
This allows us to define an IPv6 only network (currently with adummy IPv4 network) with connectivity mode 'routed' and letthe NICs inside this network have only IPv6 address (auto-generatedfrom their MAC and the network's prefix)....
(ext) Do not remove disks if --keep-disks and DT_EXT
(ext) Override disk_cache hvp with disk param in ext
This is a hack that brings disk_cache hypervisor paramat disk level. This is supported only for disks of exttemplate that allow arbitrary params. The correspondingparam that should be used is 'cache'....
(ext) Pass disk geometry in kvm command
Currently we allow this feature only for ext templates thatallow arbitrary params per disk. If both 'heads' and 'secs'params are given then 'cyls' is calculated from the disk size.
TODO: export these params in IDISK_PARAMS since the can be...
(ext) Export logical_id info to hooks env
DISK_ID as the second part of logical_id
(b64) Use base64 encoding in networks' bitarrays
This is needed for GRNET'S production environment.
(snap) Snapshot support for ExtStorage
Extend existing RPC params with the snapshot name andadd allow snapshot not only for LVM but also for EXT.
(grnet) Move disk options before nic ones in kvm command
Older versions of Ganeti did ensure that during startupdisk devices will be inserted before nic devices in PCIconfiguration space. KVM inserts devices to PCI slotsdepending on the order of command line options....
(2.13) Pass the access parameter to ExtStorage template
Add the ExtStorage template to the set of templates that accept the'access' parameter. The default 'access' of the node-group forExtStorage devices will be 'kernelspace'.
Update the man page for gnt-instance to state that ExtStorage templates...
(2.13) Handle IDISK_ACCESS parameter in ComputeDisks
The IDISK_ACCESS disk parameter was not handled in the 'ComputeDisks'function, thus the 'access' parameter was ignored during the instancecreation. This patch fixes this and also fixes a typo in'_VerifyDiskModification'....
(2.13) Implement GetUserspaceAccessUri for ExtStorage
Allow ExtStorage devices to support userspace access.The 'attach' script of an ExtStorage provider is now allowed to returnmore than one line. The first line will contain as always the blockdevice path. Each one of the extra lines will contain a URI to be used...
(2.13) Move ExtStorage code out from bdev
Move the ExtStorage related code out from bdev to a newfile called 'extstorage.py'.
Signed-off-by: Ilias Tsitsimpis <iliastsi@grnet.gr>Signed-off-by: Thomas Thrainer <thomasth@google.com>Reviewed-by: Thomas Thrainer <thomasth@google.com>...
(2.13) Make 'access' an optional disk parameter
This patch makes 'access' an optional disk parameter just likespindles, mode, name, vg and metavg. This option can only be set to'kernelspace' or 'userspace'. When 'userspace' is used, the instancewill access this disk directly without going through a block device....
(2.11) Make BlockDev subclasses adhere the interface for Create
In commit 702c3270 two new parameters were added to theCreate function of BlockDev. Make subclasses also adherethis specification.
Signed-off-by: Klaus Aehlig <aehlig@google.com>Reviewed-by: Petr Pudlak <pudlak@google.com>
(2.11) Make BlockDev subclasses adhere to new interface
In commit 702c3270 two new parameters were added to theconstructor of BlockDev. Make the subclassess accept theseadditional parameters as well.
(2.11) Make disk.name and disk.uuid available in bdev
Until now Disk name and uuid was not available on bdev level.In case of ExtStorage, this info is useful, and may be for othertemplates in the future too.
This patch treats the name and uuid object slots just like the size...
(2.13) kvm: Add migration capabilities as an hvparam
Latest QEMU versions support various migration capabilities. Eachcan be enabled/disabled with 'migrate_set_capability' monitorcommand.
Version 1.7.0 defines x-rdma-pin-all, auto-converge, zero-blocks,...
(2.8r) Workaround for Issue 621
Upon LUNetworkDisconnect() and LUNetworkConnect() try to acquireall cluster's instances.
By that _LS_ACQUIRE_ALL acquire mode is set and not_LS_ACQUIRE_EXACT and thus the deleted lock does cause any problem.
NOTE: This workaround is not merged upstream. They prefer to have...
Check drbd helper only in VM capable nodes
Upon change of enabled disk templates, Ganeti checks for a valid drbdhelper among all nodes. Let those nodes be only the VM capable ones.
Signed-off-by: Dimitris Aragiorgis <dimara@grnet.gr>Signed-off-by: Klaus Aehlig <aehlig@google.com>...
'Raise' called inside 'CheckPrereq' needs the prereq kw
This patch fixes the missing 'prereq' keyword in calls to 'Raise' inthe control flow of 'CheckPrereq', and updates the tests.
Signed-off-by: Jose A. Lopes <jabolopes@google.com>Reviewed-by: Hrvoje Ribicic <riba@google.com>
Fix gnt-network client wrt instances report
Let the gnt-network client expect a list of instance names and notUUIDs as returned by QueryNetworks (by both old and new style querymechanism).
Signed-off-by: Dimitris Aragiorgis <dimara@grnet.gr>Reviewed-by: Helga Velroyen <helgav@google.com>
Fix QueryNetworks wrt instances
QueryNetworks tries to find which instances are connected to whichnetworks. The query mechanism in Haskell was written back when NICsreferred to a network via its name and not its UUID. Fix luxi tocomply with the current implementation (network slot of NIC object...
Convert all the classes to new-style classes
... to make lint shut up.
Signed-off-by: Helga Velroyen <helgav@google.com>Reviewed-by: Jose Lopes <jabolopes@google.com>
Add --no-locks option to gnt-debug delay
Add the possibility to don't acquire locks during `gnt-debug delay`.This allows to run many delay jobs in parallel instead of havingthem run sequentially.
Signed-off-by: Thomas Thrainer <thomasth@google.com>Reviewed-by: Helga Velroyen <helgav@google.com>...
Support group evacuation by failover
Support evacuating a node group not using migration.This can be useful if the group evacuated to has differenthardware.
Signed-off-by: Klaus Aehlig <aehlig@google.com>Reviewed-by: Thomas Thrainer <thomasth@google.com>
Add an option --force-failover
...to be added to gnt-group evacuate forcing evacuation bymeans for failovers instead of migrations.
openvswitch fix
Support sequential evacuation
Make gnt-group evacuate support the --sequential option,which causes all evacuation moves to be execuated sequentially.This can be used to avoid congestion on a possibly slow linkbetween the node groups.
Signed-off-by: Klaus Aehlig <aehlig@google.com>...
Add an option --sequential
...which can be used to tell commands like gnt-group evacuate tosequentially perform their action to keep load away from the cluster.
Merge branch 'stable-2.9' into stable-2.10
Signed-off-by: Thomas Thrainer <thomasth@google.com>Reviewed-by: Klaus Aehlig <aehlig@google.com>
On expanding jobs, extend reason trail
Certain op-codes expand to a set of jobs. Forthose new jobs, extend their reason trail withthe reasons of the job that expanded to them.In this way, also for indirectly genreated jobsa complete trace back to the initiator can be...
Fail in replace-disks if attaching disks fails
Previously, if attaching the new secondary during a replace-disksoperations failed, only a warning was emitted. The subsequent sync-disksoperation cannot finish in such a case, however.
Therefore, this patch changes the warning into an error. This way it's...
Conflicts: configure.ac # Taken both contributions
Signed-off-by: Hrvoje Ribicic <riba@google.com>Reviewed-by: Klaus Aehlig <aehlig@google.com>
KVM: set IFF_ONE_QUEUE on created tap interfaces
The IFF_ONE_QUEUE flag directs the kernel to only queue tap packets once(as opposed to queueing them twice, once for the device, and once for theqdisc), possibly avoiding interface stalls when one of the queues overruns....
Set correct Ganeti version on setup commands
When asked to execute a setup command, prefix it witha command sequence to test for the existence of theneeded Ganeti version and switching to it.
Add a utility to combine shell commands
Add a function that combines individual shell commands intoa single command (calling the standard shell) that executesthe given commands in sequence while they succeed.
Fix failed DRBD disk creation cleanup
When creating a DRBD disk, Ganeti reserves minor numbers on a per-nodebasis. In case of a failed disk creation, these reservations should bereleased. During the name/uuid refactoring, the invocation of thefunction that releases the minors was not updated, resulting in no...
Hooking up verification for shared file storage
As for the cluster modify, it was also forgotten tohook up the verification of the shared file storagepaths despite all infrastructure was done already.
Signed-off-by: Helga Velroyen <helgav@google.com>Reviewed-by: Klaus Aehlig <aehlig@google.com>
Fix --shared-file-storage-dir option of gnt-cluster modify
While all infrastructure to make shared-file storageruntime-configurable was already submitted, the actualsetting of the path was forgotten. This patch fixes it.
Signed-off-by: Helga Velroyen <helgav@google.com>...
Fix non-running test and remove custom_nicparams rename
Due to a missing base class, the test that was supposed to check ifRAPI instance parameter renames during modifications are working didnot execute. As the instances are not covered by the QA tests, the...
Account for NODE_RES lock in opportunistic locking
This patch extends the opportunistic locking to take both theNODE_RES and NODE locks into account when selecting nodes to be usedby the iallocator.
Signed-off-by: Gerard Oskamp <gjo@google.com>Reviewed-by: Hrvoje Ribicic <riba@google.com>
Fix request flooding of noded during disk sync
If a user manually pauses the DRBD sync, Ganeti started to poll the nodedaemon without any waiting between request. This caused heavy load onthe node. This patch fixes this by waiting at least 5 secondes between...
KVM: use running HVPs to calc blockdev options
Commit 0fe22ad2 moved the call to _GenerateKVMBlockDevicesOptions() from_GenerateKVMRuntime() to _ExecuteKvmRuntime. However, while in_GenerateKVMRuntime() there is only one set of HVPs, those of theinstance's configuration, in _ExecuteKVMRuntime there are two sets of...
KVM: reserve a PCI slot for the SCSI controller
Currently instances with disk_type=scsi are broken, because the SCSIcontroller uses a PCI slot not accounted for in the PCI assignmentlogic. We reserve a throw-away slot just for that.
This is a temporary workaround and will be reverted during the upcoming...
Check for LVM-based verification results only when enabled
This patch fixes a little glitch in 'gnt-cluster verify'.If LVM-based storage was disabled, it would still checkLVM-related verification results and print a confusingerror message.
Fix "existing" typos
This patch fixes the wording of a couple of messages,including two typos of the word 'existing'.
Signed-off-by: Helga Velroyen <helgav@google.com>Reviewed-by: Hrvoje Ribicic <riba@google.com>
Fix output of gnt-instance info after migration
After migrating a DRBD based instance, the output of gnt-instance infowas wrong wrt. DRBD minors. This patch fixes the output in such cases.
Signed-off-by: Thomas Thrainer <thomasth@google.com>Reviewed-by: Hrvoje Ribicic <riba@google.com>
Verify configuration version number before parsing
As the attempt to convert the dict used as json representationof the configuration into a configuration object already makesassumptions about the internal representation, verify the versionbefore such an attempt. Fixes issue 783....
Signed-off-by: Hrvoje Ribicic <riba@google.com>Reviewed-by: Klaus Aehlig <aehlig@google.com>...
Merge branch 'stable-2.8' into stable-2.9
Fix specification of TIDiskParams
Commit 580b1fdd incorrectly assumes that disk parameters arejust the standard ones, whereas the man page explicitly statesthat additional parameters can be passed as well, if they makesense for the chosen storage type. Fix this....
Add renaming of instance custom params
Much like the groups before, this patch allows custom_* params to besubmitted under the same name they can be retrieved as in the infocall.
Signed-off-by: Hrvoje Ribicic <riba@google.com>Reviewed-by: Thomas Thrainer <thomasth@google.com>
Add renaming of group custom ndparams, ipolicy, diskparams
This patch adds the ability to set the group-specific parameters in thesame way they are described when returned by the info command - withthe "custom_" prefix.
Signed-off-by: Hrvoje Ribicic <riba@google.com>...
Add aliases for nodes
This patch adds a single alias for the secondary_ip property of thenode.
Add aliases for cluster parameters
This patch adds aliases for two cluster parameters.
Add support for value aliases to RAPI
This patch extends the metaclass used to generate RAPI handlers toallow creating aliases of certain values returned by GET methods.
Add reason parameter to RAPI client functions
Only the functions for starting, stopping and rebooting a VM had a reasonparameter. Now, all the RAPI client functions generating opcodes do.
Also, one test is expanded to verify that a RAPI request with both body and...
Make watcher submit queries low priority
Make the watcher collect its data using low-priority jobs,to avoid blocking user/admin jobs. Note that repair jobs arestill submitted normal priority. Fixes issue 772.
Fix conflict between virtio + spice or soundhw
With regard to PCI slot occupied by a KVM instance we haveobserved the following:
1) Slot 0 will always be Host bridge.2) Slot 1 will always be ISA bridge.3) Slot 2 will always be VGA controller (even with -display none)....
Fix bitarray ops wrt PCI slots
Introduce new method `_GetFreeSlot()` responsible only for bitarrayoperations. It fixes search in case of bitarray is either '0000..'or '1111..'.
Use it instead of `_UpdatePCISlots()` and in `_GetFreePCISlot()`.
Signed-off-by: Dimitris Aragiorgis <dimara@grnet.gr>...
Fix error introduced during merge
A parameter was lost while resolving a conflict in the signature of a function.
Signed-off-by: Michele Tartara <mtartara@google.com>Reviewed-by: Klaus Aehlig <aehlig@google.com>
gnt-cluster copyfile: accept relative paths
If, on the command line, the argument to gnt-cluster copyfile isa relative path, consider this a shorthand for the correspondingabsolute path.
Signed-off-by: Klaus Aehlig <aehlig@google.com>Reviewed-by: Michele Tartara <mtartara@google.com>
Merge branch 'origin/stable-2.8' into stable-2.9
Improve RAPI detection of the watcher
If the watcher is not allowed to access RAPI, it doesn't mean that it is deadand needs to be restarted.
Fixes Issue 752.
Signed-off-by: Michele Tartara <mtartara@google.com>Reviewed-by: Hrvoje Ribicic <riba@google.com>
Enable a timeout for instance shutdown
Add the timeout parameter to the StopInstance function of the hypervisor baseclass and to all its implementations.
Also, change the tests as required by this change.
Signed-off-by: Michele Tartara <mtartara@google.com>...
Allow KVM commands to have a timeout
Modify the function that sends commands to the KVM monitor so that it ispossible to specify an optional timeout after which the command is killed.
Allow xen commands to have a timeout
Modify the function that runs Xen commands so that it is possible to specify anoptional timeout after which the command is killed.
Fix wrong docstring
Fields must be the final elements in an epytext string.
Use node UUIDs for executing LU hooks
LUNodeAdd, the only LU using a node name still, is changed to overwritePreparePostHookNodes() and use node UUIDs only as well.This allows to remove the support for 3-tuples as results ofBuildHooksNodes() and removes the translation to node names....
Add PreparePostHookNodes to LUs
This method can be used to alter the list of node UUIDs on which posthooks are executed. PreparePostHookNodes is called after Exec, so LUscan use data only known after the execution of the LU.
Signed-off-by: Thomas Thrainer <thomasth@google.com>...
Fix error propagation in post-commit hooks
An error in the post-commit hooks could not be propagated correctly and couldresult in e.g. the return code of gnt-cluster verify to be 0 even in presence ofan error in its output.
Fixes Issue 744.
Merge branch 'origin/stable-2.9' into stable-2.10
Signed-off-by: Hrvoje Ribicic <riba@google.com>Reviewed-by: Jose A. Lopes <jabolopes@google.com>
Make gnt-debug locks display fake job locks properly
When a job is dependent on other jobs, a fake lock is created whosepending entry contains a list of job ids waiting on the job. gnt-debuglocks did not expect the job ids to be ints, crashing when encountering...
Make NiceSort treat integers well
NiceSort is invoked on arrays that may contain strings, but in othersituations can contain ints as well. As this surprisingly makes sense,add a tiny modification to make NiceSort work in these conditions.
Signed-off-by: Klaus Aehlig <aehlig@google.com>Reviewed-by: Hrvoje Ribicic <riba@google.com>Reviewed-by: Jose A. Lopes <jabolopes@google.com>
Signed-off-by: Klaus Aehlig <aehlig@google.com>Reviewed-by: Jose A. Lopes <jabolopes@google.com>
Fix expression describing optional parameters
The NIC's network and vlan are also newly added, hence need to beconsidered optional to remain backwards compatible.
Let the instance's tuple of nodes start with the primary
Before the tuple of nodes of an instance was created from a set, listingthe nodes in alphabetical order. This patch ensures that the primarynode is always the first one in the list.
Signed-off-by: Petr Pudlak <pudlak@google.com>...
Conflicts: lib/cmdlib/instance.py: manually apply 0973f9ed on...
Improve job status assert affected by race condition
In the sliver of time between choosing a waiting job to be executed andtrying to acquire locks for its execution, the status of the job can bechanged to canceling. An assert checking the job status neglected to...
Export and import Disk/NIC name
Name of Disk/NIC were not exported during backup until now.Use the exported info during gnt-backup import.
Signed-off-by: Dimitris Aragiorgis <dimara@grnet.gr>Signed-off-by: Michele Tartara <mtartara@google.com>Reviewed-by: Michele Tartara <mtartara@google.com>
Fix backup import in case NIC is inside a network
Network UUID is written in .ini file during backup exportbut is not used by _ReadExportParams(). This patch fixes it.
Please note that in case a network is given, link and mode shouldnot be included in NIC options....
Override get() method of ConfigParser
During backup import/export SafeConfigParser() is used tosave/restore instance's configuration. There is a possibility if anexport is done with a different Ganeti version, a specific value notto be saved during export (e.g. the NIC/Disk name) but still...
Workaround for monitor bug related to greeting msg
QMP may return multiple greeting messages upon connection.This is reported on qemu-devel. The fix is one-liner butuntil it get's released this is a quick and dirty workaroundthat flushes the client's buffer after getting the first...
hotplug: Verify if a command succeeded or not
Just after issuing _CallHoplugCommands() we invoke_VerifyHotplugCommand() which parses `info pci` resultand searches for given PCI slot and device id.
If we previously had removed a device but it is still there...
hotplug: Call each qemu commmand with an own socat
Previously we issued one socat command with two "\n" separatedactions (e.g. netdev_add ...\ndevice_add...)
After having observed a strange monitor behavior [1] splittingthose commands and introducing a sleep time in between, may reduce...