Merge branch 'stable-2.11' into master
Merge branch 'stable-2.10' into stable-2.11
Add missing save/re-read cluster configuration
.. in LUClusterSetParams. Since _SetFileStorageDir updates the 'cluster'variable directly, we need to re-read it and then save later (the othercalls use the configuration directly).
Signed-off-by: Petr Pudlak <pudlak@google.com>...
Complete zeroing
This patch will do all that is necessary to allow the helper VM to dowhatever it will do with the zeroing image in place - which is,hopefully, to zero out the disks of the instance.
Signed-off-by: Hrvoje Ribicic <riba@google.com>Reviewed-by: Jose A. Lopes <jabolopes@google.com>
Add timeout parameters to gnt-backup export
This patch adds the two parameters to gnt-backup export, documentingtheir meanings in the manual file as well.
Add zeroing function shell
This patch moves towards the actual zeroing by providing a functionthat determines the necessary size and creates and destroys a temporarydisk.
Add image size estimation function
To create a temporary disk, it is necessary to know just how big thisdisk must be. This patch adds a function that retrieves thisinformation for both data sources - a URL and a file.
Signed-off-by: Hrvoje Ribicic <riba@google.com>...
Modify failing assert
The assert stating that the disk did not have to be activated madesense once the instance's disks were never completely deactivated. Withzeroing, the assumption no longer holds true, and should be replaced bya check that the disks of the instance are indeed active....
Introduce class for temporary disk creation
The instance zeroing requires that a virtual appliance capable ofperforming it is used, and short of provisioning another VM, the bestGaneti can do is reuse the virtualization environment of the instance.To do this, a disk is needed to host the OS performing the zeroing, and...
Factor out and alter the instance running check
Examining whether an instance is running is useful outside the instancestate check, especially as the check relies on the admin_state recordedwithin the configuration, which the code treats as the desired rather...
Lock node if zeroing is used in LUBackupExport
This patch adds a node lock if zeroing is used, preventing anyoperations that might interfere with the amount of available space.
Add the zeroing-image option
This patch adds the zeroing-image option to gnt-cluster and theOpBackupExport params. The many changes are all minor, yet necessary.
Factor out image validity check
The image validity check has been implemented as a part of the OSinstalls, yet it could be useful for the zeroing image as well. Thispatch factors the utility out.
Add HV parameter checks
The first version of zeroing requires two things: that theself-initiated shutdown of the instance can be detected, and that theinstance boots from the first disk supplied to it. This patch checksfor these by examining the hypervisor parameters....
Add the zero-free-space option
Although unused for now, add the zero-free-space option to the backupexport opcode, and add a rudimentary check for whether it should beused.
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...
Update metadata on create, import, reinstall, modify
Note that create and import are the same LU, therefore, there are atotal of 3 calls, not 4.
Signed-off-by: Jose A. Lopes <jabolopes@google.com>Reviewed-by: Hrvoje Ribicic <riba@google.com>
Add helper function to modify metadata
This function is responsible for transforming the instance into a dictand optionally overriding the OS parameters (public, private, secret).Also, in case of failure it issues a warning.
Signed-off-by: Jose A. Lopes <jabolopes@google.com>...
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.
Signed-off-by: Helga Velroyen <helgav@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>
Acquire config lock for RPC calls that check consistency
Since LUClusterVerifyGroup issues 3 RPC calls to get information fromnodes, and during every of these calls, the configuration can bemodified by somebody else, it's necessary to acquire a shared lock on...
Fix configuration calls for LUBackupExport
Re-read the instance in-memory objects from WConfd after calls thatchange its state.
Signed-off-by: Petr Pudlak <pudlak@google.com>Reviewed-by: Klaus Aehlig <aehlig@google.com>
Fix configuration calls for LUInstanceRename
Re-read the instance in-memory objects from WConfd after callsthat change its state.
Fix configuration calls for LUInstanceReboot
Fix configuration calls for LUInstanceReinstall
Fix configuration calls for LUInstanceShutdown
Fix configuration calls for LUInstanceStartup
Instance storage: Mark functions that modify instances
.. in the configuration with comments.
Also re-read an instance object where needed.
Fix calls to Update in TLMigrateInstance
Instead of modifying the primary node on an object and calling 'Update',a new method was added to ConfigWriter.
Fix calls to Update in LUNodeSetParams
Add calls to Update after modifying the node's configuration and movesome of the modifications so that they don't conflict with other callsto ConfigWriter.
Fix calls to Update in LUInstanceSetParams
In particular, move the call to Update so that it doesn't conflict withcalls to ConfigWriter methods that change the configuration state.
Fix calls to Update in LUClusterSetParams
Since this LU intersperses calls ConfigWriter methods with modifyingobjects directly, it's necessary to call 'Update' and/or re-read them atappropriate places.
Also a new ConfigWriter method is created for modifying the instance...
Make configuration per job/thread
Previously there was one shared configuration object for all jobs,threads and other tasks. This patch creates separate ConfigWriteinstances for distinct jobs/threads.
All exported methods of ConfigWriter are now wrapped in calls that...
Use explicit configuration for nodes in GanetiContext
This way, each call to AddNode or RemoveNode uses a passed configurationobject that belongs to the appropriate job.
This is required to subsequently get rid of the single sharedConfigWriter object....
Move utility functions for candidate certs. to ConfigWriter
In particular AddNodeToCandidateCerts and RemoveNodeFromCandidateCerts.
Calling 'cfg.Update(cluster)' causes problems in WConfd, asit doesn't operate on a shared configuration object any more....
Show OS variant information in gnt-os info
Currently, the non-standard/modified per-OS hypervisor parameters, orOS specific parameters can be listed only by the 'gnt-cluster info'command, which is a non-standard place to show them. Extend the'gnt-os info' command to display the available/supported OS variants...
Skip rename when OS scripts are absent
When an instance does not have OS scripts because, for example, ituses an OS image, do not rename the instance after an import.
Use raw disks in import/export when OS scripts are absent
When an instance does not have OS scripts because, for example, it hasan OS image, then the import/export should not try to run the OSscripts. Instead, it should use raw import/export.
Add a thread ID to the WConfd client id
This allows to distinguish threads that don't have a job id, which isneeded for answering queries.
Since Python thread IDs aren't guaranteed to be unique, in future it'dbe preferable to use a different, unique identifier....
Remove unused functions to check OS variants
... as this is now performed on the node.
Signed-off-by: Jose A. Lopes <jabolopes@google.com>Reviewed-by: Petr Pudlak <pudlak@google.com>
Remove calls to 'CheckNodeHasOS'
... because 'CheckOSParams' already checks the OS variant.
Add 'force_variant' to RPC 'os_validate'
Move function 'CheckOSVariant' to the node and add parameter'force_variant' to RPC 'os_validate', thus making the node verify theOS variant together with the rest of the OS params.
Remove SSH copyfile from LU and assume the file exists
According to Ganeti design, files should not be copied from master tonodes and instead they are assumed to exist and it is the user'sresponsibility to assure that the file does exist.
Fix OS image detection on master
Make mcpu acquire WConfD locks
So far, the mcpu acquires locks that live in memoryof masterd. This design does not fit with our jobs-as-processesgoal. So make mcpu acquire the corresponding locks in WConfDinstead.
Note that this implies changes in various other files that call...
Instance reinstall with OS images
OS images in 'LUInstanceCreate' and OS scripts optional
Instance create with OS image
Extend 'LUInstanceCreate' to image the instance's first disk if an OSimage is specified via the OS params. If the OS image is a file, itwill be copied to the node via SSH. If ths OS image is a URL, it willbe passed directly to the node, which will then download the file....
Function to check if the OS image parameter is valid
Add helper function to check if the OS image parameter contained inthe OS parameters of an opcode is valid.
Function to image disks while ensuring that disks are paused
Function to remove instance if disks are degraded
Fix docstrings
Fix several docstrings.
Make gnt-debug delay interruptible
The gnt-debug delay command could be useful as a means of acquiringlocks for testing purposes. In practice, to be useful it should beinterruptible, otherwise we risk race conditions or long delays.
This patch follows the examples of the move-instance command and the...
Factor Unix domain socket creation into helper class
As the delay class will also have to start using domain sockets,extract the functionality into a helper class.
Signed-off-by: Hrvoje Ribicic <riba@google.com>Reviewed-by: Petr Pudlak <pudlak@google.com>
Handle incorrect duration more elegantly
The previous version of the LUTestDelay opcode relied on the utilityfunction complaining about the negative duration. As this function hasbeen removed for now, do the check ourselves, and issue a moreappropriate exception....
Make gnt-debug delay command run in parallel
The gnt-debug delay command executes the delay first on the master, andonly then on all the other nodes, causing a significant delay. Thispatch makes the command treat the master as it would all other nodes....
Remove duplicated '_CheckOSVariant'
It seems '_CheckOSVariant' was moved from 'ganeti.cmdlib.instance' to'ganeti.cmdlib.instance_utils' but the source was never deleted. Thispatch deletes the source copy if this function.
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.
Signed-off-by: Michele Tartara <mtartara@google.com>...
Allow cluster mac prefix modification
Extend LUClusterSetParams to allow the modification of the clustermac-prefix setting in 'gnt-cluster modify' command.
This fixes part of issue 239.
Signed-off-by: Dimitris Bliablias <bl.dimitris@gmail.com>Reviewed-by: Jose A. Lopes <jabolopes@google.com>
Show mac prefix setting in gnt-cluster info
Include mac-prefix setting in the output of 'gnt-cluster info'command.
Add some whitespace to fix formatting
Some error messages were lacking some spaces between linesto make it more readable.
Signed-off-by: Helga Velroyen <helgav@google.com>Reviewed-by: Klaus Aehlig <aehlig@google.com>
Consider old client cert only when available
This fixes a bug which occurred only after upgradingfrom 2.10 to 2.11. During the cluster renew-cryptooperation, Ganeti tries to include the old certificatein the candidate map while it is providing newcertificates. This failed when there was no certificate...
Fix return of 'Validate'
Signed-off-by: Jose A. Lopes <jabolopes@google.com>Reviewed-by: Helga Velroyen <helgav@google.com>
Merge branch 'stable-2.9' into stable-2.10
Merge branch 'stable-2.8' into stable-2.9
Conflicts: lib/cmdlib/instance.py: manually apply 0973f9ed on...
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....
Smooth renewal of client certificates
This patch fixes another chicken-and-egg problem whichoccurred when the node certificates get renewed. Whenrenewing a node certificate, the previous certificatehas to be used to update the configuration. To address...
Constant for instance communication network mode
Create a new constant to hold the instance communication network modeas this constant will be necessary during the QA, and update thegeneral documentation about the constants related to the instancecommunication mechanism....
Add '-c | --instance-communication' flag to instance modify
Enable/disable instance comm via 'gnt-instance modify'
This patch adds the logic necessary to enable/disable the instancecommunication in a running instance via 'gnt-instance modify'. Withinstance communication enabled, the instance gets a new NIC that is...
Refactor instance comm NIC name creation
Refactor name creation for the NICs used in instance communication.These names are generated based on a prefix and the instance name.Also, these names must be unique within a single instance.
Fix copy of NIC objects to be consistent with the other call
... which can be found just right below in the same module.
Fix whitespace and typos in comments
Use node UUID as client certificate serial number
It turns out, that some implementations of OpenSSL are morepedantic in checking the certficates than others. In thisparticular case, the SSL connection could not beestablished when the serial number of the certificates...
Revert "Disabling client certificate usage"
This reverts commit 45f75526b848, which was introduced totemporarily disable the implementation of SSL clientcertificates. As this patch series fixes the reason forthe disabling, we are rolling back the patch....
Rename some functions not to collide with opcode names
Rename some functions related to instance communication not to collidewith the naming convention used in the opcodes.
Refactor instance communication network add and connect
Factor out the opcodes 'OpNetworkAdd' and 'OpNetworkConnect' used in'LUClusterSetParams' and 'LUGroupAdd' in order to reduce codeduplication and keep the configuration of the instance communication...
Connect new groups to the instance communication network
When a new group is added, if the instance communication network isenabled, then this group must also be connected to this network.
'LUClusterSetParams' creates the instance communication net
Extend 'LUClusterSetParams' to create the user-supplied instancecommunication network in case this network does not exist. Note thatif the user-supplied network already exists, nothing needs to be done...
Check prereq instance communication network in 'SetParams'
Later, the logical unit for 'OpClusterSetParams' will be responsiblefor creating the instance communication network in case it does notexist. For now, it is important to check whether the network the user...
Instance comm network from config instead of predefined
Add 'instance_communication_parameter' to 'Cluster'
OpCodes: modify InstanceReinstall for private, secret params
Modify InstanceReinstall to accept and process private and secretparameters.
Signed-off-by: Santi Raffa <rsanti@google.com>Reviewed-by: Jose A. Lopes <jabolopes@google.com>
OpCodes: modify InstanceCreate for private, secret params
Modify InstanceCreate to accept process private and secret parameters.
OpCodes: modify ClusterSetParams for private parameters
Modify ClusterSetParams to accept and process private parameters.
OpCodes: modify InstanceSetParams for private parameters
Modify InstanceSetParams to accept and process private parameters.