(2.10) Make hotplug related method raise HotplugError
Hotplug is not supported by default and thus we raiseHotplugError() for hotplug related methods.If a hypervisor wants to support it, we must override VerifyHotplugSupport()and implement the Hot* method....
(2.10) block_devices -> kvm_disks renaming
and a couple more styple fixes.block_devices are misleading so rename them to kvm_disk (just like kvm_nics)
Signed-off-by: Dimitris Aragiorgis <dimara@grnet.gr>Signed-off-by: Thomas Thrainer <thomasth@google.com>...
(2.10) Some fixes in _GenerateKVMBlockDevicesOptions()
(2.10) 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,...
(2.10) Extract socket related code from QmpMonitor class
Separate unix socket related code from QmpMonitor class andmake the latter extend the newly introduced one: MonitorSocket
(2.10) 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....
(2.10) Use -device with pci info if possible
Extend kvm_cmd with -device option for the case of paravirualDisks and NICs.
Signed-off-by: Dimitris Aragiorgis <dimara@grnet.gr>Signed-off-by: Thomas Thrainer <thomasth@google.com>Reviewed-by: Thomas Thrainer <thomasth@google.com>...
(2.10) 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)...
(2.10) Helper 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....
(2.10) 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)....
(fix) Remove uri slot from block_devices
In stable-2.10 we have userspace access mode for rbd. Backendcalculates uri along with link and dev_path. Thus we havethree items in block_devices and kvm_disks tuples.
We this patch we remove the third value....
(2.10) Introduce _GenerateKVMBlockDevicesOptions()
Simply move logic that generates block device relatedoptions out of _GenerateKVMRuntime().
NOTE: Back-port corresponding commit from stable-2.10
- 2.8 does not have user-space access support for rbd
Signed-off-by: Dimitris Aragiorgis <dimara@grnet.gr>
(2.10) 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 use...
(2.9) Make NIC setup more flexible in case of Xen
For every NIC write down a file that contains NIC'sinfo (MAC, mode, link, network details), that canbe sourced by any vif script. The file location is:/var/run/ganeti/xen-hypervisor/nic/<domname>/<nicidx>....
Add support for blktap2 file-driver
Newer Xen versions use blktap2 instead of blktap. This patch adds supportfor it in Ganeti.
Fixes Issue 638.
Signed-off-by: Michele Tartara <mtartara@google.com>Reviewed-by: Thomas Thrainer <thomasth@google.com>
Xen handle domain shutdown
Update Xen backend to properly recognize when a domain has beenshutdown by the user and to properly cleanup a shutdown domain whenGaneti requests Xen to stop this domain.
Partial cherry-pick from 9d22cc90609e3ee8f0f2b34b793a3daced3c0e61...
Fix error printing
Fixes issue 616.
Signed-off-by: Jose A. Lopes <jabolopes@google.com>Reviewed-by: Michele Tartara <mtartara@google.com>
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.
Signed-off-by: Michele Tartara <mtartara@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>
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)...
Merge branch 'stable-2.7' into stable-2.8
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. :/
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....
Merge stable-2.7 into stable-2.8
Conflicts: INSTALL NEWS configure.ac src/Ganeti/Query/Group.hs test/hs/Test/Ganeti/Objects.hs test/hs/Test/Ganeti/Query/Query.hs
Signed-off-by: Michele Tartara <mtartara@google.com>Reviewed-by: Helga Velroyen <helgav@google.com>
kvm: use -machine type,accel= for newer qemu
-enable-kvm and -disable-kvm are deprecated in favor of accel=kvm passedas a machine specification. This fixes compatibility with newer qemuversions.
Signed-off-by: Guido Trotter <ultrotter@google.com>Reviewed-by: Helga Velroyen <helgav@google.com>
kvm: Move parameter validation before use
We had parameter validation when the runtime is generated, but in themiddle of the function. Move up, before any parameter is accessed.
Signed-off-by: Guido Trotter <ultrotter@google.com>Reviewed-by: Thomas Thrainer <thomasth@google.com>
kvm: Use -display none rather than -nographic
Newer versions of kvm (from 1.4) don't support -nographic with-daemonize. When -display exists, use -display none instead.
This fixes Issue 389.
gnt-instance: new hypervisor parameter 'vif_type'
This patch fixes issue 247. It empowers the user to specifyexplicitly the vif type of a nic configuration of a Xen HVMinstance. This includes the option of setting it to '' on thecommandline, causing Ganeti to leave out the 'type' parameter...
Merge branch 'devel-2.7'
Remove network_type slot (Issue 363)
This slot was not used by Ganeti so the same info can beprovided via tags. In order not to break configuration datawe add a FromDict() method in Network config object thatremoves the deprecated network_type (if found) and then invoke...
Make use of HooksDict() for networks
This can be used in hypervisor code as well. For consistencyexport *NETWORK_NAME and not *NETWORK throughout the code.
Signed-off-by: Dimitris Aragiorgis <dimara@grnet.gr>Reviewed-by: Guido Trotter <ultrotter@google.com>
hv_kvm: Error messages, punctuation, other style fixes
- Capitalize acronyms such as “QMP” or “SPICE”- Remove punctuation from error messages- Improve error reporting when sending a monitor command failed- Put “or” at end of line- Fix indentation for a concatenated string...
hv_kvm: Add TODO regarding monitor commands
Monitor calls should be replaced with QMP once KVM >= 0.14 is required.
Signed-off-by: Michael Hanselmann <hansmi@google.com>Reviewed-by: Guido Trotter <ultrotter@google.com>
hv_xen: Fix epydoc error
“utils.RunCmd” is re-exported from “utils.process.RunCmd”. Epydocdoesn't fully understand this, so we have to refer to the original.
Signed-off-by: Michael Hanselmann <hansmi@google.com>Reviewed-by: Iustin Pop <iustin@google.com>
Switch KVM to multi-error verify results
This uses the new _FormatVerifyResults helper function to returnmultiple errors.
Signed-off-by: Iustin Pop <iustin@google.com>Reviewed-by: Michael Hanselmann <hansmi@google.com>
Make LXC fail verification if cgroup is not mounted
Since LXC now relies on cgroup memory limits to enforce memory, let'smake hypervisor verification (and thus cluster-verify) return errorswhen the cgroup filesystem is not mounted.
Signed-off-by: Iustin Pop <iustin@google.com>...
Add a helper function for hypervisor verification
This will allow easier multi-error results from hypervisors; rightnow, we only report the first error, which is not nice.
hv_lxc: fix whitespace errors
The latest lxc patches included a few whitespace style errors, that makelint fail. This patch fixes those.
LXC: add support for the memory controller
Add support for the memory resource controller, useful to actually placememory limits on instances.
Support is still optional, in case the kernel doesn't have it compiledin, or in the case of Debian has it dependent on a kernel command-line...
LXC: adapt hv for newer lxc userspace tools
Currently hv_lxc depends on the behavior and output of older LXC tools,which have since changed, making it unable to function in currentdistributions (e.g. Debian wheezy).
Adapt the tools and expectation for the output and make it into a...
Fix logging arguments formatting
This fixes: “ganeti/hypervisor/hv_kvm.py:93: [W1201, _GetTunFeatures]Specify string format arguments as logging function parameters”, andalso updates the copyright years.
Signed-off-by: Iustin Pop <iustin@google.com>Reviewed-by: Michele Tartara <mtartara@google.com>
hv_kvm: Refactor getting TAP features, add tests
Split retrieving supported features into a dedicated function which canbe mocked. Tests are added for both “_ProbeTapVnetHdr” and“_GetTunFeatures”.
Signed-off-by: Michael Hanselmann <hansmi@google.com>...
hv_kvm: Original error message, keyword parameter
- Include original error message when creating TAP interface failed- Pass keyword parameter as such
hv_xen: Fix issues with migration, add tests
Commit 3d942d8 broke instance migration (“self._cmd” was set to None).This patch fixes that issue, refactors “MigrateInstance” for testing andadds those tests.
kvm: fix bug while fetching -device list
_GetKVMOutput expects the command to succeed, but unfortunately on someversions of kvm "-device ?" will output a correct list of devices, whileexiting with an error code.
To fix this we accept failure in that case (note that this doesn't...
hv_xen: Split StopInstance
Signed-off-by: Michael Hanselmann <hansmi@google.com>Reviewed-by: Helga Velroyen <helgav@google.com>
hv_xen: Abstract running Xen commands
Instead of using the “XEN_CMD” constant in multiple places, that is nowall in a single place and can easily be changed for unit tests (througha parameter given to the constructor).
Signed-off-by: Michael Hanselmann <hansmi@google.com>Reviewed-by: Bernardo Dal Seno <bdalseno@google.com>
hv_xen: Remove config after shutdown was successful
If stopping an instance failed, the configuration would already be goneand other operations depending on it (e.g. migration) would no longerwork. With this patch the configuration file is only removed once the...
hv_xen: Simplify writing configuration
Instead of calling _WriteConfigFileStatic from both derived classes,those now only return the content (minus the “do not edit” header). Theconfiguration is then written by the base class, XenHypervisor.
hv_xen: Prepare for unit tests, remove {static,class}method
Unit tests will have to specify a custom Xen configuration directory (atemporary directory). To this end “hv_xen.XenHypervisor” and its twoderived classes are modified to have fewer static and class methods. A...
hv_xen: Factorize and test disk configuration
The “_GetConfigFileDiskData” function is moved to module level andcleaned up (module-level constants for letters and file I/O drivers).
Until now only 24 disks would be supported (e.g. “sda” to “sdx”), when...
hv_xen: Refactor getting node information, add tests
Refactor and add tests for getting node (Domain-0) information.
hv_xen: Refactor running & parsing "xm list", add tests
This patch refactors “_RunXmList” and adds some tests.
hv_*: Always return from Verify, style fixes
Change all “Verify” methods in hypervisor abstractions to explicitelyreturn None if no problem was detected. Remove punctuation from errormessages. Update docstrings with “@return” and some small mistakes.
hv_xen: Compose file name outside error handling
In _ReadConfigFile, the filename should be prepared outside thetry/except block. Fixes bad code formatting, too.
hv_base: Remove empty constructor
Fix format string of KVM output
This fixes a missing 's' in the format string andthe wrong quotes. Those bugs were introduced incommit 6e043e60.
Signed-off-by: Helga Velroyen <helgav@google.com>Reviewed-by: Iustin Pop <iustin@google.com>
hv_xen: Add test for CPU pinning configuration
Add a unittest for a function formatting CPU pinning information forXen's configuration.
Signed-off-by: Michael Hanselmann <hansmi@google.com>Signed-off-by: Guido Trotter <ultrotter@google.com>Reviewed-by: Guido Trotter <ultrotter@google.com>
kvm: deduplicate 'get output' code
We had the same code twice, and were about to add a third time. Betterto collapse it into just one function.
Signed-off-by: Guido Trotter <ultrotter@google.com>Reviewed-by: Michael Hanselmann <hansmi@google.com>
kvm: extract a regexp matching out of a for loop
kvm: remove last version-based feature detection
This was left behind because it required a different kvm invocation.Now that we can add new ones cheaply (two constants) it's easy to getrid of it. Differently than in other cases we support old version which...
Make Xen config path a build-time option
Stop hardcoding the path in “hv_xen.py”.
Check if KVM machine version is supported
If machine version is passed as an hv param, a check is madein target node whether this version is included in the supportedones derived from kvm -M ? command.
Signed-off-by: Dimitris Aragiorgis <dimara@grnet.gr>...
kvm: make kvm path configurable as an hv parameter
This fixes Issue 225.
make _{Generate,Execute}KVMRuntime accept kvm help
Currently kvm --help is called twice at instance startup, this makessure it's called only once.
kvm: make auxiliary functions accept a kvm path
This will be used to be able to customize the path in an hv parameter.
Also fix two comments that still mentioned version-based checking.
Add KVM machine version as hv param
This is needed in case an instance must be booted with an exact type ofmachine version (due to e.g. outdated drivers). If this hv paramexplicitly defined (during instance creation/modification) then the kvmprocess will be started having this version for the -M option. Otherwise...
kvm: simplify _GetMachineVersion
Use a multiline regexp rather than a single line one, and then splitlines in the code.
Allow -soundhw option to kvm
For all of us that love to listen to music on our kvm virtual machines,the -soundhw option is paramount.
kvm: support usb devices
All in one go, comma separated usb devices of all types.
kvm: Add kvm_extra parameter
As requested in Issue 261 and many other times.
kvm: Add -vga option
As requested in Issue 69.
kvm: use help based feature detection
As discussed on the list some people backport features to different kvmversions, making the version based detection system unreliable. Wechange wherever we can to detection on the help output.
This also fixes Issue 250...
Add a non negative int hypervisor parameter check
...and use it for a few parameters for which it makes sense.
kvm: always pass -usb
This will be the default anyway and it was a mistake to pass it only ifthe mouse was specified.
kvm: abstract getting --help output
This will be used later, for now nothing changes.
kvm: allow setting smp cores, threads, sockets
This was requested in Issue 322.Note that maxcpus is not implemented yet, as it should be considered ina cpu-hotplug global context.
kvm: add serial console speed
The serial port speed changed between versions of qemu (what didn't?), sothe old hardcoded default doesn't do anymore. Upgrade it to a parameter.
Add machine version in kvm runtime file
kvm -M ? returns the supported machines (e.g. pc-1.1).Add _GetDefaultMachineVersion() function to get the default value.
Upon kvm runtime file creation (this is in _GenerateKVMRuntime() invokedonly in StartInstance()) append this info in kvm_cmd. During...
Remove fixed FIXME
This was fixed in stable-2.6, commit 053c356
Signed-off-by: Guido Trotter <ultrotter@google.com>Reviewed-by: Iustin Pop <iustin@google.com>
Fix error during cluster initialization due to hv_kvm
Commit 141d148 was a bit too enthusiastic. The three parameters added tothe list of parameters to be checked default to a value not evaluatingto false, leading to a failure on cluster initialization....
Add test for SPICE parameter list, add missing ones
“_SPICE_ADDITIONAL_PARAMS” is supposed to be the full list ofSPICE-related KVM hypervisor parameters with the exception of“HV_KVM_SPICE_BIND”. The new test checks if all parameters starting with“HV_KVM_SPICE_*” are included. Three previously missing parameters are...
hv_kvm: List of SPICE parameters should be module-global
This list is static at runtime and doesn't need to be recreated everytime.
Move _BuildNetworkEnv() at top-level
Signed-off-by: Dimitris Aragiorgis <dimara@grnet.gr>Reviewed-by: Iustin Pop <iustin@google.com>
Fixes to pass pep8 (make lint)
Pass netinfo in rpcs
If a nic has a network field then encapsulate a network object innetinfo slot for every rpc. This is needed to pass network info toscripts managing nics (kvm-vif-bridge).
Introduce _BuildNetworkEnv().
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>...
Merge branch 'devel-2.6' into master
Conflicts (both trivial): htools/Ganeti/Daemon.hs (_writePidFile rename)...
Fix type error in kvm/GetMigrationStatus
Commit 6a1434d7 (“Make migration RPC non-blocking”) changed fromraising HypervisorErrors to returning MigrationStatusobjects. However, these objects don't have an "info" attribute, sothey can't pass a reason back (which is in itself a bug); but the KVM...
Merge branch 'devel-2.6' into submit
Conflicts: Makefile.am (reordering, fixed) htools/Ganeti/Confd/Server.hs (hlint fixes on master) htools/Ganeti/Daemon.hs (hlint)...
Fix gnt-instance console with xl
- Rename xm-console-wrapper to xen-console-wrapper- Pass the xen command to use as a parameter
Merge branch 'devel-2.6'
Conflicts: lib/hypervisor/hv_xen.py: trivial
Fix live migration under xl
Until now the only way to make live migration work in conjunction with"xl" was to add ssh known_hosts keys for every node's secondary ip onevery other node.
With this command we remove the target key verification: this is not...
Don't check for xend port when using xl
If the toolstack is set to "xl" we shouldn't ping xend for livenessbefore attempting a live migration.
Signed-off-by: Guido Trotter <ultrotter@google.com>Reviewed-by: Michael Hanselmann <hansmi@google.com>Reviewed-by: Iustin Pop <iustin@google.com>
Add support for cpu_cap and cpu_weight Xen params
This patch adds support for Xen's CPU scheduler 'cpu_cap' and'cpu_weight' parameters.
Ganeti default values (cap: 0=unlimited, weight: 256) are Xen defaults.
cpu_cap is not validated correctly because of actual Ganeti limitation...