History | View | Annotate | Download (113.9 kB)
Peripheral changes for networks
Specifically: * export a new environment variable for the gnt-os-interface * export a new environment variable for KVM specific scripts * ovf support for networks
Signed-off-by: Apollon Oikonomopoulos <apollon@noc.grnet.gr>...
LUClusterVerifyGroup: Localize virtual file paths
The check for file consistency didn't properly handle virtual pathsin case of a virtual cluster. This didn't cause any breakage as ina standard virtual cluster setup with only one node all files arevisible for every node....
Move constant for /etc/hosts to pathutils
Needed for coming patches.
Signed-off-by: Michael Hanselmann <hansmi@google.com>Reviewed-by: Iustin Pop <iustin@google.com>
backend: Use utils.IsBelowDir instead of local code
utils.IsBelowDir is actually tested and doesn't allow writes to“…/queue*”, like the old code here did.
Check fingerprint of file with allowed file storage paths
This makes differences show up in “gnt-cluster verify”.
backend: Check for shared storage also
If normal file storage was disabled but shared storage enabled,“_TransformFileStorageDir” would still throw an exception.
in “opcodes._CheckStorageType” there's also a check, but I wasn't quitesure what the correct way of handling it was, so I added a TODO comment....
Move a function from backend to ssconf
The “WriteSsconfFiles” function is used to write ssconf files. By movingit we can avoid importing backend into bootstrap. The latter is importedby CLI programs and backend doesn't have much to do with them.
Signed-off-by: Michael Hanselmann <hansmi@google.com>...
Remove constant for disk wipe block size
It is dangerous to have this block size as a global constant as thatcould give the impression of it being easily changed. Doing so withoutfurther adjustments to how “dd” is called will lead to disks not beingwiped properly....
Stop hardcoding root user
Some parts of the code still use a hardcoded user name: root. This patchreplaces all with a constant specified at build time. The end goal is tomake it possible to run a Ganeti cluster without any special privileges(of course this will prevent some functionality from working)....
instance_info now returns vcpus
instance_info and all_instances_info calls had different per-instancereturn types, this commit fixes the mismatch.
Signed-off-by: Agata Murawska <agatamurawska@google.com>Reviewed-by: Iustin Pop <iustin@google.com>
Implement virtual cluster support in Python code
- pathutils: Prepend node-specific prefix path- RPC: Use virtual paths (see vcluster.py)- SSH: Pass environment variables, use destination's node directory when copying files using scp, use GANETI_HOSTNAME to determine hostname...
Migrate lib/backend.py from constants to pathutils
File system paths moved from constants to pathutils.
constants: Move most paths to separate module
This is inpreparation for the implementation of virtual clusters. Manypaths will change based on an environment variable and are no longerconstant and should no longer be in “constants.py”. Since “constants.py”...
Bump pep8 version to 1.2
Debian Wheezy will ship with this version, and it has many improved checks compared to 0.6, so let's:
- bump version in the docs- silence some new checks that are wrong due to our indent=2 instead of 4- fix lots of errors in the code where the indentation was wrong by 1...
Fix DRBD resize code
There are two bugs in the current resize code, affecting mostly DRBD.
First, due to bugs in old DRBD versions (pre 8.0.14), the code currentlycalls `drbdsetup resize' on both the primary or secondary. However,this is actually wrong per current DRBD (from drbdsetup(8)):...
Merge branch 'devel-2.5'
Merge commit 'v2.5.1' into devel-2.5
Add a default PATH variable to OS scripts env
In commit 896a03f6 I cleaned up the environment for OS scripts,however I think that was a bit too extreme - it breaks our owninstance-debootstrap hooks, because for example dpkg (called from thegrub script) requires PATH to be set....
Fix LVM volume listing with newer LVM
Per commit 0304f0e, newer LVM has extended the lv_attr field. However,that commit was incomplete as we examine this attribute in anotherplace in the code.
Thanks to user alperhome, the _LVSLINE_REGEX in lib/backend.py also...
Add instance_balloon_memory rpc
Signed-off-by: Guido Trotter <ultrotter@google.com>Reviewed-by: René Nussbaumer <rn@google.com>
Move ErrnoOnStr backend function to utils
Signed-off-by: Guido Trotter <ultrotter@google.com>Reviewed-by: Iustin Pop <iustin@google.com>
Use disk parameters in noded
More fixes after commit 78519c106
A quick QA run successfully finished with these changes.
Signed-off-by: Michael Hanselmann <hansmi@google.com>Reviewed-by: Andrea Spadaccini <spadaccio@google.com>
Fix “node_info” RPC result
Commit 78519c106 broke everything. Here's the fix.
Change “node_info” RPC to accept multiple VGs/hypervisors
Keeping the node state up to date will require information from multipleVGs and hypervisors. Instead of requiring multiple calls this changeallows a single call to return all needed information. Existing users...
ImportExport: use max and min memory params
Import uses the old "memory" parameter to populate the two new ones, ifthey're not overridden already.
FinalizeExport exports minmem and maxmem, but also memory, as maxmem, toallow importing to older ganeti clusters....
Set DRBD sync speed in DRBD8.Assemble
Instead of relying on clients of the class for setting the device speed(and, in general, the DRBD parameters), move this responsibility insidethe Assemble method.
Signed-off-by: Andrea Spadaccini <spadaccio@google.com>...
Use master IP address setup script in backend
Replace the code in backend.ActivateMasterIp andbackend.DeactivateMasterIp with the master IP address setup script,either the default one or the one provided by the user.
- Convert to string the netmask parameter in _BuildMasterIpEnv...
Change master IP address RPCs for external script
Change the master IP address RPC call chain to accept theuse_external_master_ip_script parameter. Introduces an unused parameterin backend.ActivateMasterIp and backend.DeactivateMasterIp, that will beused in the next commit....
Update cluster verify to check IP address scripts
Update cluster-verify to check the integrity of the default master IPaddress setup script and the presence and executability of the externalone (if currently in use by the cluster).
Improve error handling in netmask change
- check if the master IP with the old netmask is up before attempting to change the netmask (to avoid a failed change netmask resulting in an undesired activation of the master IP);- improve error messages of the backend function;...
Derive IP hooks env variables from RPC parameter
Let the environment variables of the master IP turnup/turndown bederived from the parameter of the RPC itself (that is of typeobjects.MasterNetworkParameters in both cases).
Pass MasterNetworkParameters instances in RPCs
Pass instances of objects.MasterNetworkParameters when calling RPCs foractivation and deactivation of master IP.
Signed-off-by: Andrea Spadaccini <spadaccio@google.com>Reviewed-by: Guido Trotter <ultrotter@google.com>
Uniform master IP activation and deactivation
Add the master IP family parameter to the master IP deactivation RPCs,so that the activation and deactivation interfaces are uniform.
Fix overriding of ActivateMasterIp params
In the process of reworking the patches for master, I forgot to remove acall to GetMasterInfo() that overrides the parameters passed via RPC.This patch fixes this issue.
Add netmask and IP version to master IP hooks env
Add the master netmask and master IP version parameters to the hooks anddocument them. In this way, the hook environment building function canbe reused for the planned master IP turnup changes.
Explicitly pass params to activate_master_ip
To remove the usage of ssconf in the backend, the master needs to pushthe parameters of activate_master_ip to the backend.
This patch changes the entire call path of activate_master_ip to use thenew interface....
Explicitly pass params to deactivate_master_ip
Make the master explicitly pass the parameters to thedeactivate_master_ip RPC, and change all the call flow to use the newinterface.
Signed-off-by: Andrea Spadaccini <spadaccio@google.com>Reviewed-by: Michael Hanselmann <hansmi@google.com>
Explicitly pass params to change_master_netmask
Make the master explicitly pass the parameters to thechange_master_netmask RPC, and change all the call flow to use the newinterface.
Add master IP turnup and turndown hooks
Reviewed-by: Michael Hanselmann <hansmi@google.com>Signed-off-by: Andrea Spadaccini <spadaccio@google.com>
Add RunLocalHooks decorator
Add the RunLocalHooks decorator, that allows the execution of hookslocally. Also, add a RunLocalHooks method to HooksRunner, to adapt thesignature of HooksRunner.RunHooks to the one expected by HooksMaster,and also to check that the hooks are being executed locally....
Use GetClassFromIpFamily in ActivateMasterIp
Merge branch 'stable-2.5' into devel-2.5
Signed-off-by: René Nussbaumer <rn@google.com>Reviewed-by: Michael Hanselmann <hansmi@google.com>
Merge branch 'devel-2.4' into stable-2.5
Conflicts: lib/cmdlib.py - trivial
Signed-off-by: Guido Trotter <ultrotter@google.com>...
Fix queue archive creation with wrong permissions
On a master failover some of the archive dirs might have wrongpermissions in the non-root model. This is due to the nature of nodedstill running as root and the job queue is synced that way. This patchwill fix this behaviour by setting the permissions accordingly....
Add hypervisors ancillary files list
These lists will be used to declare some of the files not necessarilyneeded on all nodes. The files selected are files without which thevarious hypervisors can still work, but that when they are presentshould be synchronized across the cluster (or node group)....
Revert "Added SPICE TLS option and related cert paths"
This reverts commit bfe86c763a9ff1b481d799537ff0f0cf6740dfd1.This commit will be readded on master.
Signed-off-by: Guido Trotter <ultrotter@google.com>Reviewed-by: Michael Hanselmann <hansmi@google.com>
Don't send gratuitous ARP if master IP setup fails
Restore backend.GetMasterInfo return values order
Change 5a8648eb609f7e3a8d7ad7f82e93cfdd467a8fb5 changed the order of thereturn values of backend.GetMasterInfo(). This broke the users of themaster_info RPC.
This change restores the original order, and adds a comment in...
Add cluster netmask parameter
Add the master_netmask cluster parameter, that represents the netmask ofthe master IP, encoded as a CIDR suffix.
This parameter can be set via the --master-netmask of gnt-cluster initand gnt-cluster modify. The default behaviour is to be consistent with...
Signed-off-by: Andrea Spadaccini <spadaccio@google.com>Reviewed-by: René Nussbaumer <rn@google.com>
LUClusterVerifyGroup: Spread SSH checks over more nodes
When verifying a group the code would always check SSH to all nodes inthe same group, as well as the first node for every other group. On bigclusters this can cause issues since many nodes will try to connect to...
Split starting and stopping master IP and daemons
Make migration RPC non-blocking
To add status reporting for the KVM migration, the instance_migrate RPCmust be non-blocking. Moreover, there must be a way to represent themigration status and a way to fetch it.
Migration: warn the user about hv version mismatch
Added SPICE TLS option and related cert paths
Fix backend.MigrateInstance docs
The MigrateInstance function does not return anything, so the relevantlines are removed from the documentation. Instead, the raised exceptionis documented.
import: Fix a logic error due to missing "not"
import: Make sure the disk_dump path is in EXPORT_DIR
Switch other commonprefix to IsBelowDir
DeprecationWarning fixes for pylint
In version 0.21, pylint unified all the disable-* (and enable-*)directives to disable (resp. enable). This leads to a lot ofDeprecationWarning being emitted even if one uses the recommendedversion of pylint (0.21.1, as stated in devnotes.rst)....
PEP8 style fixes
Identified using the “pep8” utility.
Added check for the ip command at configure time
Also, corrected a few places where the ip command was hardcoded.
Change the backend.InstanceLogName signature
This uses now the component for the transfer (if available), otherwise(e.g. in installs/renames) nothing.
Signed-off-by: Iustin Pop <iustin@google.com>Reviewed-by: Michael Hanselmann <hansmi@google.com>
Instance transfer: export component name to backend
This modifies the RPC layer to export the component name too to thebackend, so that it can be used in log files and messages.
Clear the OS scripts environment
The OS scripts currently run with the whole noded environment; this isdifferent from the hooks which run with a cleared one and most likelyan oversight.
This might create problems when upgrading, so it needs to be clearly...
Remove requirement for variants on OS API v15+
This removes:
- the check in backend that such OSes have a variants file or if it exists that is non-empty; in order for this to work, we also rework the logic in backend._TryOSFromDisk to allow for optional OS files...
Most boring patch ever
s/'/"/ in (hopefully) the right places.
Set startup_paused to False when restarting
This fixes the lint error:
E1120:1220:InstanceReboot: No value passed for parameter'startup_paused' in function call
Signed-off-by: Stephen Shirley <diamond@google.com>Reviewed-by: Michael Hanselmann <hansmi@google.com>
Add gnt-instance start --pause
Creates the instance, but pauses execution before booting. This combinedwith 'gnt-instance console' unpausing instances means that the entireboot process can be viewed and monitored.
Signed-off-by: Stephen Shirley <diamond@google.com>...
Export/import instance tags
Signed-off-by: Michael Hanselmann <hansmi@google.com>Reviewed-by: René Nussbaumer <rn@google.com>
Merge branch 'devel-2.4'
RPC/Backend: Make UploadFile uid and gid agnostic
Signed-off-by: René Nussbaumer <rn@google.com>Reviewed-by: Iustin Pop <iustin@google.com>
Implement grow dry-run at RPC level
Signed-off-by: Iustin Pop <iustin@google.com>Reviewed-by: Guido Trotter <ultrotter@google.com>
Implement dryrun mode for BlockDev.Grow()
This is always called with False from backend for now.
Add 2 new variables to the OS scripts environment
Add INSTANCE_PRIMARY_NODE and INSTANCE_SECONDARY_NODES. These newvalues are useful for OS scripts that needs to know the nodes wherethe instance lives.. or has lived.
Signed-off-by: Iustin Pop <iustin@google.com>...
Cluster verify: check for missing bridges
Currently cluster verify doesn't check for bridge information; theonly checks are done at instance create and failover/migratetime. This means a cluster that seems healthy will fail creation jobs.
This patch implements a simple verification that all nodes (in the...
Shared storage instance migration
Modify LUMigrateInstance and TLMigrateInstance to allow instance migrations forinstances with DTS_EXT_MIRROR disk templates.
Migrations of shared storage instances require either a target node, or aniallocator to determine the target node. If none is given, the cluster default...
Add bdev_sizes RPC call
The bdev_sizes multi-node RPC call returns the sizes of the requestedblock devices on the desired nodes. Its intended use is to verify theexistence of a block device on a given node for shared block storagesupport.
Block device paths are expected to lie under constants.BLOCKDEV_DIR...
Core shared file storage support
This patch introduces core file storage support, consisting of the following:
A configure-time switch for enabling/disabling shared file storagesupport and controlling the shared file storage location:--with-shared-file-storage-dir=. Shared file storage configuration is then...
Merge branch 'devel-2.3' into devel-2.4
backend: Disable compression in export info file
The new import/export infrastructure in Ganeti 2.2 and up handlescompression differently. It no longer writes compressed files to thedestination. Unfortunately changing this behaviour would be non-trivial,...
Re-create instance disk symlinks on activate
This patch implements recreation of instance disk symlinks when theactivate-disks operation is run. Until now, it was not possible tore-create these symlinks without stopping and starting or migrating aninstance as the RPC call where this is done was in instance startup...
cluster verify: add hvparams verification
Currently, the validity of the hypervisor parameters is only checkedat init/modification time, and not in the cluster verify. This is bad,as it can lead to inconsistent state that is only detected when thenext modification (which can be unrelated) is made, leading to...
Verify disks: increase parallelism and other fixes
The recent work on multi-VG support has converted LUClusterVerifyDisksinto doing serialised calls to each node, as each node can havedifferent VGs. This is suboptimal, especially for big clusters, where...
Improve import/export timeout settings
With this patch, the exporting node will retry to connect a few times.The receiving node will make use of the master's increased timeout (seeprevious patch).
utils: Move I/O-related code into separate file
Fix a typo in backend.py
Sorry I thought I did run commit-check but must not have paid attentionto its output. There was a typo in the docstring. This patch fixes this.
Add backend method for pause/resume sync of devices
Signed-off-by: René Nussbaumer <rn@google.com>Reviewed-by: Iustin Pop <iustin@google.com>Reviewed-by: Michael Hanselmann <hansmi@google.com>
Adding additional VerifyNode checks to backend
This adds checks for out of band support. The helpers have to exist andthey have to be executable.