drive_del after device_del in disk hot-remove
This is needed so that qemu process really releases thecorresponding file descriptor and thus we can dmsetup/lvremovethe device without errors.
Signed-off-by: Dimitris Aragiorgis <dimara@grnet.gr>
Some fixes in _GenerateKVMBlockDevicesOptions()
Use blockdev_assemble rpc directly before hotplug
AssebleInstanceDisks() if invoked with primary=True and disk=[disk]creates wrong symbolic links!
Before blockdev_assemble we call SetDiskID() in order to fill upphysical_id of disk needed by bdev.Assemble and eventually by...
Add finally: mosock.close() in _PassFds
Add hotplug option in OpInstanceSetParams opcode
Hotplug: client support
Add --hotplug option. Only used in OpInstanceSetParams.If this is omitted, modifications become effective after reboot.
Ask user confirmation in case NIC modify + hotplug because it willbe done via removing old NIC (and the corresponding tap) and adding...
Hotplug: cmdlib support
Hotpluging is done by functions invoked by ApplyContainerMods(). Inorder hotpluging to take place the --hotplug option must be passedotherwise the modifications will take place after reboot.
NIC hotplug supports add, remove and modify. The modify is done by removing...
Hotplug: rpc support
Introduce new RPC that eventually invoke hypervisor specifichotplug functions. In order to be generic it has the followingarguments: device type, action, device, extra info, seq.Device type can be NIC or DISK, action can be ADD, REMOVE,...
Introduce hotplug methods (hypervisor inteface)
4 new methods: HotAddDevice, HotDelDevice, HotModDevice, HotplugSupportedAll these are the hypervisor interface with the backend.In general they read current runtime info, do the actual hotplugand update the runtime file....
Extract socket related code from QmpMonitor class
Separate unix socket related code from QmpMonitor class andmake the latter extend the newly introduced one: MonitorSocket
Helper methods that check for hotplug support
Hotplug is currently not supported for:
- KVM < 1.0 - existing devices in the cluster - python-fdsend module is not installed (NIC hotplug) - chroot (Disk hotplug) - security mode other than None (Disk hotplug)...
Use -device with pci info if possible
Extend kvm_cmd with -device option for the case of paravirualDisks and NICs.
Hepler methods for PCI slots and device ids
Device naming:QEMU monitor expects devices to be uniquely named. Device ids derivefrom the following function:kvm_devid = <device_type>-<part of uuid>-pci-<pci_slot>Device ids must be reproduce-able when we want to remove them....
Prepare block_devices runtime entry
With this patch we add another entry in runtime files along withkvm_cmd, kvm_nics, and hvparams. block_devices that used to beencapsulated inside kvm_cmd, live now separately just like nics dobut in tupples of (L{objects.Disk}, dev_path)....
Prepare kvm options to support -device for disks
Newer kvm version support -device driver,... option where availabledrivers can be found by running kvm -device ? command. Currentlyganeti uses `if` property of driver to define the disk type to usewhich is also passed as hvparam. This patch prepares the use of...
Introduce _GenerateKVMBlockDevicesOptions()
Simply move logic that generates block device relatedoptions out of _GenerateKVMRuntime().
Add hotplug related constants
Hotplug: objects and constants additions
Add pci slot in NIC/Disk objects. This slot will be used onlyby hypervisor code. Currently only KVM will use it and store ittemporarily in runtime files.Add HOTPLUG_* constants to define device types an hotplug actions....
DRBD: ensure peers are UpToDate for dual-primary
DrbdAttachNet supports both, normal primary/secondary node operation, and(during live migration) dual-primary operation. When resources are newlyattached, we poll until we find all of them in connected or syncing operation....
Improve error message for replace-disks
In some conditions, replace-disks will fail if the disks are not properlyactivated. Improve the error message suggesting to run activate-disks beforeexecuting replace-disks.
Fixes Issue 606.
Signed-off-by: Michele Tartara <mtartara@google.com>...
Placate warnings on ganeti.outils_unittest.py
Change ovf.py from using 'if foo:' to 'if foo is not None:' checks assuggested by the FutureWarnings the OVF library raises otherwise.This fixes issue 557.
Signed-off-by: Santi Raffa <rsanti@google.com>Reviewed-by: Jose Lopes <jabolopes@google.com>
Fix typo in storage.FileStorage docstring
Don't attemp ipv6 ssh in case of ipv4 cluster
In case of a cluster with primary-ip-version=4, there is no needfor cluster to try ipv6 ssh connections which may timeout.So append '-4' on ssh if cluster is ipv4-only
Signed-off-by: Costas Drogos <costas.drogos@gmail.com>...
Fix corner-case in handling of remaining retry time
Consider a remaining time of 0 as already timed out. Otherwise,there is no guarantee that calling utils.Retry with timeout 0will call the function precisely once; it might run in timeshorter than the resolution of timer....
Add a default to file-driver when unspecified over RAPI
The file-driver value, used by file-based instances, had a default value whenan instance was being created over the CLI, but not when the instance wascreated through the RAPI.
This patch introduces a default value for the remote API and, while doing so,...
Prepare GetLinuxNodeInfo for testing
The names of the input files are not hardcoded anymore, but they are now defaultparameters.
No changes for the callers, but it's now possible to test the function moreeasily.
Allow instance mods if only osparams are given
osparams are now recognized as changes, so changing only those withoutother changes works too now.
(cherry picked from commit 5eae613c2e1e65101c5d5f7d2e8ffd7cc6edc7d5)
Signed-off-by: Thomas Thrainer <thomasth@google.com>...
Merge branch 'stable-2.7' into stable-2.8
Fix batch creation of instances
During batch creation of instances the 'reason' field in opcodes is setto None (but the field is present). This caused problems when adding areasons to the reason trail.
Setting the default value for the 'reason' field to the empty list fixes...
Support multi instance allocs without iallocator
If all instances in the multi allocation request have already theirprimary and secondary node set, there is no need for an iallocator. Thusdon't require it in this case and omit the call to it all together....
Support DSA SSH keys in bootstrap
As outlined in issue 338, Ganeti failed to initialize a cluster if noRSA SSH key is present on the master node. This patch extends Ganetissupport to DSA keys, so clusters with only DSA keys are possible now.
This fixes issue 338....
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>
Support 'viridian' parameter in Xen HVM
This parameter is required to prevent bluescreens in Windows instances.
This fixes issue 233.
Signed-off-by: Heiko Baumann <heibau@googlemail.com>Signed-off-by: Thomas Thrainer <thomasth@google.com>Reviewed-by: Helga Velroyen <helgav@google.com>
Check for luxid permission during verify config
confd no longer needs access to the noded certificate file, but luxiddoes. Change the check to use the right user.
Signed-off-by: Thomas Thrainer <thomasth@google.com>Reviewed-by: Michele Tartara <mtartara@google.com>
Check disk template in right dict when copying
Due to the structure of the code this condition can't possibly be true.We have to look in the new_diskparams dict instead, otherwise it'd bepossible to try to update a non-existing entry.
(The same patch is in stable-2.7 as 106441d already)....
Fix formatting of tuple in error message
The missing str() call caused to raise another exception than the wantedone. Transforming the tuple to string fixes this problem.
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....
Increase maximum HTTP message size
After adding a new KVM parameter, RAPI queries related to KVM have becometoo big, so we need to increase this.
Signed-off-by: Michele Tartara <mtartara@google.com>Reviewed-by: Helga Velroyen <helgav@google.com>
Properly add the UUID to all the disks
Starting from Ganeti 2.8 all the disks need to have a UUID.A function for adding a UUID automatically to disks was present, but it didn'tconsider disks with children (like DRBD).
The function is modified to work recursively....
Add hvparam to disable VNET_HDR on tap devices
IFF_VNET_HDR allows tap devices to extract a VIRTIO_NET_HDR from pktsgoing through the tap iface, enabling segmentation offload for thevirtio nics.
Current (Debian) kernels (3.2 for Debian Squeeze backrports / Wheezy)...
Fix permission errors for split users
Correctly set ownership and permissions for daemon log files, correctthe name of the luxid logfile and set the ownership of the query socketcorrectly.
Make RAPI export device names and UUIDs
Add UUIDs and names of instance's disks and NICs to the list of instancefields that are returned from RAPI.
Signed-off-by: Christos Stavrakakis <cstavr@grnet.gr>Reviewed-by: Helga Velroyen <helgav@google.com>
Rename queryd to luxid
As queryd will, in the future, handle all LUXI request, queue jobs andmost likely perform various other tasks, it is renamed to luxid already.This will safe some headache when upgrading Ganeti installations, as wedon't have to deal with a daemon rename....
Add queryd daemon (split from confd)
queryd is added as a new daemon which handles configuration queries overLUXI. This functionality was removed from confd, which now only queriesover the network.
The queryd user is added to the master group such that it can access...
Conflicts:...
Change method dispatch in ClientOps to enforce luxi.REQ_ALL
ClientOps' handle_request dispatches on the luxi request received. Changethis to first verify if the request is luxi.REQ_ALL. In this way, we catchprogramming errors introducing "secret" luxi requests earlier. This is relevant,...
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....
Add --modify-etc-hosts option for CLI tools
The option will be used by gnt-cluster modify in the following commit.
Add luxiReqQueryNetworks to LuxiOp
When the QueryNetwork was introduced as a method, apparentlyit was forgotten in the Haskell world. Add it here as well.
Signed-off-by: Klaus Aehlig <aehlig@google.com>Reviewed-by: Helga Velroyen <helgav@google.com>
Expose bulk parameter for GetJobs in RAPI client
This patch exposes the bulk argument of the jobs resource onthe RAPI python wrapper, making it possible to retrieve statusinformation about all jobs with a single call.
Signed-off-by: Leon Handreke <lhandreke@google.com>...
Fix RAPI to include missing network fields
Fix RAPI interface to include missing network fields. Specifically, fixinstance queries to include the network name for instance NICs. Also fixnetwork queries to include missing common fields, like uuid and serial....
Add support for querying network timestamps
Add creation and modified timestamps when creating a new network, andextend the available query fields for networks with these fields,namely 'ctime' and 'mtime'.
Signed-off-by: Christos Stavrakakis <cstavr@grnet.gr>...
Add function for checking file access permissions
The CanRead function checks whether a user of the local machine (specifiedby name) can access a given file.
IsUserInGroup is a helper function for CanRead, but might also be usedindependently, so its name does not begin with an underscore....
Cluster verify checks server.pem permissions
Currently, ConfD must be able to access server.pem (though this is likely tochange in the future). If this is not true, all sorts of weird things happen,such as "gnt-node list" printing lots of question marks instead of actual...
Conflicts: NEWS: trivial configure.ac: trivial
Signed-off-by: Klaus Aehlig <aehlig@google.com>...
Disable pylint E1101 on hypothetical import
In some versions of python the module IN does not providethe constant SO_PEERCRED (issue 191). So in commit 069a4ba work around was added. However, this work around stillleaves lint warnings when working with those versions of...
Provide the right fix for the kvm_extra parameter
With the previous adjustment the arguments were boxed into one extraarray. This actually makes the parameter work (with the same caveats).
The manpage is also updated with the limitations.
Signed-off-by: Guido Trotter <ultrotter@google.com>...
kvm: don't pass whole extra as a single argument
If extra is longer than a single word passing it the way it was passedwon't work. Of course this solution is also only partial, as won't takeinto account any form of quoting. :/
gnt-cluster info (py): add enabled disk templates
This fixes issue 485. In the python implementation ofthe cluster config info, the enabled_disk_templateswere missing.
Signed-off-by: Helga Velroyen <helgav@google.com>Reviewed-by: Guido Trotter <ultrotter@google.com>
grow disk: call SetDiskID before blockdev_getsize
Missing this call caused blockdev_getsize to be called on the wrongphysical device, and fail.
This fixes Issue 497.
Signed-off-by: Guido Trotter <ultrotter@google.com>Reviewed-by: Michele Tartara <mtartara@google.com>
Catch DeviceCreationError unhandled exceptions
_CreateBlockDevInner is called twice in TLReplaceDisks. While thisshould be fixed, right now this leaves the DeviceCreationError exceptionunhandled, which causes a problem due to the fact that this exception...
Fix permissions of the queue archive dir
The permissions were set to 0740, but of course being a directory thecorrect permissions are 0750.
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>
Add a force option to the ClusterSetParams Opcode
If set, the op code will, in particular, try to set the master IPon the new netdev, even if shutting down the master IP on the oldnetdev failed.
Export device UUIDs to hooks and OS scripts
Export UUIDs and names of instance NICs and disks to the environmentof OS scripts and instance related hooks.
Signed-off-by: Christos Stavrakakis <cstavr@grnet.gr>Signed-off-by: Klaus Aehlig <aehlig@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>
Conflicts: doc/iallocator.rst...
Ensure the queue socket has the right permissions
RAPI needs to be able to perform queries as well.
Signed-off-by: Guido Trotter <ultrotter@google.com>Reviewed-by: Helga Velroyen <helgav@google.com>
Export connected networks to IAllocator
IAllocators should not put instances on nodes in nodegroups which arenot connected to the network the instance should be connected to.Therefore, export the networks a node group is connected to to theIAllocator, so it can account for this restriction....
Re-activate previously active disks in watcher
The watcher process previously (incorrectly) examined the admin_statefield to figure out if the disks of an instance should be activatedafter a node reboot. This is changed to use the disks_active field of...
Make the disks_active flag queryable
gnt-instance list now also supports the disks_active field.
Consider disks_active in UpgradeConfig
The disks_active flag is updated when masterd reads the configuration.Also, cfgupgrade now removes the disks_active flag during downgrades.
Add disks_active to configuration
This flag tracks if the disks of an instace are supposed to be active.That's the case when an instance is running or when its disks gotactivated explicitly (and in a couple of other cases).It will be used by watcher to re-activate disks after a node reboot....
Workaround missing SO_PEERCRED
This bug happens in a few new distributions, so we workaround it bydefining the constant ourselves, if it's missing.
Signed-off-by: Guido Trotter <ultrotter@google.com>Reviewed-by: Thomas Thrainer <thomasth@google.com>
Add debugging clause to _ExpandCheckDisks error
This has been reported by users, so we should have the extra debuggingavailable.
Stash Xen config file after a failed startup
This is a fix for a minor bug.Currently, a failed Xen VM start results in a stale config file leftbehind on the filesystem.This change introduces a new log directory, where the Xen VM configfile is moved after a failed startup....
Fix owner of the OS log dir
The OS log dir is used by noded, not masterd.
Signed-off-by: Balazs Lecz <leczb@google.com>Reviewed-by: Guido Trotter <ultrotter@google.com>
cmdlib: Cleanup public/private functions
All functions/classes which are used outside of their defining module(with tests as an exception) no longer have a leading underscore.
Signed-off-by: Thomas Thrainer <thomasth@google.com>Reviewed-by: Bernardo Dal Seno <bdalseno@google.com>
cmdlib: Extract instance query related functionality
Split instance.py further by extracting instance querying relatedlogical units and functions to instance_query.py.
cmdlib: Extract instance operation functionality
Split instance.py further by extracting instance operations(start/stop/reboot/etc.) related logical units and functions toinstance_operation.py.
The extracted operations have in common that they affect the operating...
cmdlib: Extract migration related functionality
Split instance.py further by extracting migration related logical unitsand functions to instance_migration.py.
cmdlib: Extract storage related functionality
Split instance.py further by extracting storage related logical unitsand functions to instance_storage.py.
Reformat and define exports in cmdlib/__init__.py
cmdlib/__init__.py now simply defines the interface of the cmdlib moduleby importing all classes which should be visible to clients.
Also don't ignore C0302 (Too many lines in module) any more.
Extract miscellaneous logical units from cmdlib
All remaining classes in init.py are extracted to misc.py.
Extract os related logical units from cmdlib
All LUOs* classes are extracted to operating_system.py.
Extract query related logical units from cmdlib
All LUQuery* classes are extracted to query.py.
Extract backup related logical units from cmdlib
All LUBackup* classes are extracted to backup.py.
Extract instance related logical units from cmdlib
All LUInstance* classes are extracted to instance.py. Common functionsare moved to common.py if used by non-instance logical units as well.Additionally, helper functions which are only used by LUBackup* and...
Extract node related logical units from cmdlib
All LUNode* classes are extracted to node.py. Common functions are movedto common.py if used by non-node logical units as well.
Extract group related logial units from cmdlib
All LUGroup* classes are moved to group.py. Common functions areextracted to common.py.
Extract cluster related logical units from cmdlib
All LUCluster* classes are extracted to cluster.py. Shared functions areextracted to common.py, helper functions only used by LUCluster* areextracted to cluster.py.
Extract test logical units from cmdlib
LUTest* are moved to test.py.
Extract network related logical units from cmdlib
LUNetwork* and associated helper functions are extracted to network.py.
Extract tags related logical units from cmdlib
LUTags* and their base class, TagsLU, are extracted to tags.py. Anadditional shared function, _ShareAll, is extracted to common.py forshared usage.