Add finally: mosock.close() in _PassFds
Signed-off-by: Dimitris Aragiorgis <dimara@grnet.gr>
Some fixes in _GenerateKVMBlockDevicesOptions()
Do not hide error in CalculateDeviceUri()
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...
Return link_name in blockdev_assemble rpc
Until now this RPC returned only dev_path. Since we use it inhotplug we have to know the simlink of the device so that wepass it to the corresponding hypervisor command and include itin block_devices entry in runtime files....
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...
block_devices = (disk, link, uri)
Do not pass BlockDev instance to hypervisor. Instead calculate thedrive_uri (if any) in backend level and pass only the string tohypervisor.
Hypervisor should not be aware of the entire block device but onlythe final path it can be reached....
Introduce _GenerateKVMBlockDevicesOptions()
Simply move logic that generates block device relatedoptions out of _GenerateKVMRuntime().
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....
Use 'DTS_LVM' when possible
This patch replaces all usages of the utility function'GetLvmDiskTemplate' by the new 'DTS_LVM' constantto make it consistant with the usage of other DTS_*constants.
Additionally, it provides a unit tests to ensureconsistancy between DTS_LVM and the mapping of disk...
iallocator: use lookup by disk template
So far, the iallocator requested storage informationabout all enabled disk templates but discarded all butthe LVM information, even if it was allocating spacefor a non-LVM instance. With this patch, it now onlyasks for the one that is relevant for...
utils/storage.py: storage info lookup by disk template
This patch improves the handling of storage informationbefore and after a call to the RPC 'node_info'. Itadds a function to not only call for all storageinformation on the cluster (as it is used right now),...
Replace GetLvmDiskTemplates by 'DTS_LVM'
To reach consistency by how we manage differentcategorizations of disk templates, this patchintroduces the set of disk templates which are lvm-based:'DTS_LVM'.
Signed-off-by: Helga Velroyen <helgav@google.com>...
If possible, replace symbolic links in place
Naive 'ln -s -f a b' will put the link inside 'b', if'b' is (a symlink to) a directory; so, during upgrades,the links in $(sysconfdir) cannot be updated this way.Removing and readding works, however leaves the risk...
Make information about GNU ln available to programs
Propagate the information on whether we have the GNU version of lnto all programs by making it available as a constant.
Signed-off-by: Klaus Aehlig <aehlig@google.com>Reviewed-by: Helga Velroyen <helgav@google.com>
Hs2Py constants: hail, opcode, and SSH
Add hail, opcode, and SSH related constants to the Haskell to Python constant generation.
Signed-off-by: Jose A. Lopes <jabolopes@google.com>Reviewed-by: Thomas Thrainer <thomasth@google.com>
Hs2Py constants: node daemon setup
Add node daemon setup related constants to the Haskell to Python constant generation.
Hs2Py constants: opcodes
Add opcode related constants to the Haskell to Python constant generation.
Hs2Py constants: dynamic devices
Add dynamic devices related constants to the Haskell to Python constant generation.
Hs2Py constants: SSCONF
Add SSCONF related constants to the Haskell to Python constant generation.
Hs2Py constants: 'defaultEnabledHypervisor'
Add 'defaultEnabledHypervisor' to the Haskell to Python constant generation.
Hs2Py constants: 'hvcGlobals' and 'ndcGlobals'
Add 'hvcGlobals' and 'ndcGlobals' to the Haskell to Python constant generation.
Hs2Py constants: 'ispecsMinmaxDefaults'
Add 'ispecsMinmaxDefaults' to the Haskell to Python constant generation.
Hs2Py constants: assorted constants
Add some assorted constants to the Haskell to Python constant generation.
Hs2Py constants: remove comments
Remove several comment from 'lib/constants.py' because these have been moved to Haskell.
Hs2Py constants: 'maxUdpDataSize'
Add 'maxUdpDataSize' constant to the Haskell to Python constant generation.
Hs2Py constants: UID pool
Add UID pool related constants to the Haskell to Python constant generation.
Add assorted constants to the Haskell to Python constant generation.
Hs2Py constants: HVST and disk state
Add HVST and disk state related constants to the Haskell to Pythonconstant generation.
Hs2Py constants: backend and logical disks
Add backend and logical disks related constants to the Haskell toPython constant generation.
Hs2Py constant: DRBD and dynamic disk
Add DRBD and dynamic disk parameter constants to the Haskell to Pythonconstant generation.
Hs2Py constants: nics
Add nics related constants to the Haskell to Python constantgeneration.
Hs2Py constants: assorted, idisk, and inic
Add assorted, idisk, and inic related constants to the Haskell toPython constant generation.
Hs2Py constants: node verify
Add node verify constants to the Haskell to Python constant generation.
Hs2Py constants: SSL, job queue, and locks
Add SSL, job queue, and locks related constants to the Haskell to Python constant generation.
Hs2Py constants: VNC
Add VNC related constants to the Haskell to Python constant generation.
Hs2Py constants: '/etc/hosts' and job queue
Add '/etc/hosts' and job queue related constants to the Haskell to Python constant generation.
Hs2py constants: query resources
Add query resources related constants to the Haskell to Python constant generation.
Hs2Py constants: HT related constants
Add HT related constants to the Haskell to Python constant generation.
Hs2Py constants: add import/export config
Add import/export config constants to the Haskell to Python constant generation.
Hs2Py constants: network related
Add network related constants to the Haskell to Python constant generation.
Remove useless comments from 'lib/constants.py'.
Hs2Py constants: 'diskTransferConnectTimeout'
Add 'diskTransferConnectTimeout' constant to the Haskell to Python constant generation.
Hs2Py constants: 'jobIdsKey', 'runparts' and 'rpc'
Add several groups of constants to the Haskell to Python constant generation.
Hs2Py constants: scripts and actions
Add script and action related constants to the Haskell to Pythonconstant generation.
Hs2Py constants: reboot behaviour
Add reboot behaviour constants to the Haskell to Python constant generation.
Hs2Py constants: assorted and HVS
Add asserted and HVS related constants to the Haskell to Python constant generation.
Hs2Py constants: add network mirrored disk templates
Add network mirrored disk template constants to the Haskell to Pythonconstant generation.
Hs2Py constants: add SSH key files
Add SSH key file constants to the Haskell to Python constantgeneration.
Hs2Py constants: add export versions
Add export version constants to the Haskell to Python constantgeneration.
Hs2Py constants: add CPU pinning
Add CPU pinning constants to the Haskell to Python constantgeneration.
Hs2Py constants: add 2 more constants
Add 2 more constants to the Haskell to Python constant generation.
Hs2Py constants: add several groups of constants
Add several groups of constants, namely, console types, security, I/Ocompression, import/export, hooks, and hkr related, to the Haskell toPython constant generation.
Signed-off-by: Jose A. Lopes <jabolopes@google.com>...
Hs2Py constants: storage related groups
Add several groups of storage related constants to the Haskell to Python constant generation.
Hs2Py constants: add DRBD and RBD
Add DRBD and RBD related constants to the Haskell to Python constant generation.
Hs2Py constants: add 'RIE' related
Add remote import/export related constants to the Haskell to Python constant generation.
Hs2Py constants: add 'osApiVersions'
Add constant 'osApiVersions' to the Haskell to Python constantgeneration. This patch fixes the type of this constant, by changingfrom 'List' to 'Set', therefore, 'Ganeti.Query.Server' is updatedaccordingly.
Hs2Py constants: add 'ReplaceDisksMode' related constants
Add constants related to the Haskell type 'ReplaceDisksMode'. Thedata type declaration for 'ReplaceDisksMode' is also moved from'Ganeti.OpParams' to 'Ganeti.Types' because it used to be used only by...
Hs2Py constants: add RPC timeout constants
Add RPC timeout related constants to the Haskell to Python constantgeneration. The Haskell data type 'RpcTimeout' is moved from'Ganeti.Rpc' to 'Ganeti.Types' so it can be used by'Ganeti.HsConstants' without causing circularity problems with...
Hs2Py constants: add node parameter related constants
Add node parameter related constants to the Haskell to Python constantgeneration. This patch also fixes a type inconsistency betweenHaskell and Python, namely, 'ndsParameterTypes' and'ndsParameterTitles' become 'Map's instead of 'Tuple's, which allows...
Hs2Py constants: constants related to 'Ganeti.Htools.Types'
Add constants related to the Haskell types defined in'Ganeti.Htools.Types' to the Haskell to Python constant generation.
Hs2Py constants: add local disk status
Add constants related to local disk status to the Haskell to Pythonconstant generation. A new Haskell type 'LocalDiskStatus' is addedsimilarly to the constants that have been added previously in otherHs2Py patches....
Hs2Py constants: add 'fileDriver'
Add constant 'fileDriver' to the Haskell to Python constantgeneration. The constant 'FILE_DRIVER' is also moved to theappropriate place in 'lib/constants.py'.
Hs2Py constants: add Luxi constants
Add Luxi related constants to the Haskell to Python constantgeneration. A new Haskell type is added 'Ganeti.Types.PythonChar' towrap the Python character type.
Hs2Py constants: update forgotten 'SOCAT_ESCAPE_CODE'
Update constant 'SOCAT_ESCAPE_CODE' to retrieve its value from thegenerated 'lib/_constants.py'. The Haskell counterpart of thisconstant, namely, 'socatEscapeCode', has already been added.
Hs2Py constants: add more constants
Add more constants to the Haskell to Python constant generation.
Hs2Py constants: add 'Ganeti.Confd' types
Hs2Py constants: add 'Ganeti.Confd' types.
Hs2Py constants: add confd requests
Add confd request related constants to the Haskell to Python constantgeneration.
Add --resume option to 'gnt-cluster upgrade'
This option will resume an upgrade of the Ganeti version ofa cluster that got interrupted by a reboot of the master node,or similar event.
Signed-off-by: Klaus Aehlig <aehlig@google.com>Reviewed-by: Thomas Thrainer <thomasth@google.com>
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.
Provide utility function to check a configuration version
In order for 'gnt-cluster upgrade --resume' to determine whether the configurationis already upgraded, it needs to compare whether a configuration version is compatiblewith a Ganeti target version. Provide a utility function for this....
Fix typo in doc string
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>...
Provide an inverse to UnescapeAndSplit
With utils.UnescapeAndSplit, we have a function to parsearbitrary non-empty string lists encoded as strings. Alsoprovide the appropriate encoding function.
Signed-off-by: Klaus Aehlig <aehlig@google.com>Reviewed-by: Michele Tartara <mtartara@google.com>
Specify the intent-to-upgrade path
During a Ganeti upgrade, 'gnt-cluster upgrade --to' documents thefact that an upgrade is going on in a file, in case of a power failureon the master node. Specify the full file name in pathutils.
Hardcode default access mode to kernelspace
Hardcode constants.KERNELSPACE as the default access method forKVM disk templates, rather than allowing a change to the RBD defaultaccess mode to affect all disk templates for KVM.
At some point in the future it might make more sense to have this...
Handle scenarios where access is not set
It should not be possible to reach _GenerateKVMRuntime without havingthe access method set, but if it does happen this commit makes surethe default value is used anyway.
Signed-off-by: Raffa Santi <rsanti@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.
Provide the DIRVERSION as a constant
Depending on configure options, the version string used in the nameof the version specific directory differs. Provide this string alsoas a constant, as it is needed for the upgrade procedure, in order tobe able to roll back....
Provide time constants related to upgrades
During upgrades, gnt-cluster needs to wait for all jobsin the queue to finish. Provide constants for timeout andpolling interval.
Signed-off-by: Klaus Aehlig <aehlig@google.com>Reviewed-by: Jose Lopes <jabolopes@google.com>
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...
Provide means of submitting jobs to a drained queue
During an upgrade, the job queue needs to be drained in order to avoidnew jobs coming to the cluster. Nevertheless, the upgrade processneeds to carry out some maintenance, like redistributing the new...
Expose sharedir in pathutils
This path is needed to construct the link targetfor $(sysconfdir)/ganeti/share for a different version.The latter will happen in the automated upgrade procedure.
Provide path to ensure-dirs in pathutils
Provide the canonical path to cfgupgrade in pathutils
This is the version-independent path for cfgupgrade, that willalways refer to the cfgupgrade of the currently installed version.
Expose the list of online nodes at ssconf
Ganeti's ssconf contains the list of nodes currently consideredonline. Expose this data at the ssconf interface.
Also export PKGLIBDIR in pathutils
Add predicate whether to call cfgupgrade --downgrade
Provide a predicate that, given the current version and theversion to go to, tells whether it is appropriate to callcfgupgrade --downgrade.
Add utility function to recognize upgrade ranges
Upgrading is possible within the same major version to any equalor higher minor version. Downgrading is possible within the samemajor version to the previous minor version. Moreover, automaticupgrades are only supported from version 2.10 onwards. Add a utility...
Also provide the program version
Conceptionally, the versions of the program, the protocols, and theconfiguration are three different things, even though, currently thereis a tight coupling. So export the version as well, as the upgradesare designed to make decisions based on the version....
Add utility function to parse version strings
The new 'gnt-cluster upgrade' command will get a Ganeti version asargument. So provide a function able to parse it.