History | View | Annotate | Download (83.4 kB)
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().
Signed-off-by: Dimitris Aragiorgis <dimara@grnet.gr>
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. :/
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.
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>
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>
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”.
hv_kvm: Original error message, keyword parameter
- Include original error message when creating TAP interface failed- Pass keyword parameter as such
Signed-off-by: Michael Hanselmann <hansmi@google.com>Reviewed-by: Iustin Pop <iustin@google.com>
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_*: 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.
Signed-off-by: Michael Hanselmann <hansmi@google.com>...
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>
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...
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...
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...
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)....
hv_kvm: Use pu.CONF_DIR variable
… instead of using SYSCONFDIR directly.
Signed-off-by: Michael Hanselmann <hansmi@google.com>Reviewed-by: Bernardo Dal Seno <bdalseno@google.com>
Migrate lib/hypervisor/*.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”...
Merge branch 'devel-2.6'
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 'explicitely' common typo
It seems that 'explicitely' is wrong, and that the right form is'explicitly'. This is just fixing the typo plus adjusting affectedparagraphs.
Signed-off-by: Iustin Pop <iustin@google.com>Reviewed-by: Guido Trotter <ultrotter@google.com>
Merge commit 'v2.5.2' into stable-2.6
Conflicts: NEWS (trivial, merged the entries)...
Fix boot=on flag for CDROMs
This generalises commit 4304964a to cdroms too, since they havesomewhat the same logic. We just abstract the needs_boot_flag into aseparate variable, and then reuse it in the cdrom section.
Note that the logic of what 'if=' type to pass to KVM was very...
KVM: only pass boot flag once
This addresses issue 230: passing two methods of booting to KVM can,depending on the KVM version, confuse it.
Note that commit 4304964a introduced a partial fix for this (but onlyfor disks, and keyed on KVM versions). However, it didn't fix cdrom...
Add support for -cpu option in KVM
This adds supports for the (non-validated) cpu parameter to KVM.
Signed-off-by: Iustin Pop <iustin@google.com>Reviewed-by: Iustin Pop <iustin@google.com>
Fixed typos, formatting, etc and added a comment
This patch only touches comments and man pages.
Signed-off-by: Bernardo Dal Seno <bdalseno@google.com>Reviewed-by: Iustin Pop <iustin@google.com>
Fix epydoc raises L{...} usage
For epydoc raise statement, it already expects an exception which willbe hyperlinked; if passing an L{…} construct, it will instead breakthe formatting (the @raise will not be recognised, but merged into theprevious paragraph)....
Merge branch 'stable-2.5' into stable-2.6
Signed-off-by: Iustin Pop <iustin@google.com>...
Move KVM keymap from GenerateRuntime to ExecuteRuntime
Per issue 243, "side-effects" are GenerateRuntime are bad as theyexecute only on the initial node of the instance. By moving thewrite-out of the keymap file to ExecuteRuntime, it will be done bothat start and at migrate time....
Add the keymap directory to the list of runtime KVM dirs
Commit 4f580fef added the keymap support, but missed that thisdirectory needs to be ensured/created at hypervisor init time.
Merge branch 'devel-2.5'
Merge branch 'stable-2.5' into devel-2.5
KVM: don't add -nographic using spice
This fixes issue 222.
Signed-off-by: Guido Trotter <ultrotter@google.com>Reviewed-by: Michael Hanselmann <hansmi@google.com>Reviewed-by: Iustin Pop <iustin@google.com>
Open VDI Port when spice_use_vdagent is enabled
To use the features spice agent provides, a dedicated virtio-serialchannel must be created in qemu-kvm. The communication between the agentand the other spice components takes place over this channel.
hypervisors: start instances with max available mem
If we have available more than MINMEM but less than MAXMEM, start a newinstance with that value, rather than MAXMEM.
kvm: always start in paused state
Currently kvm starts in a frozen state if cpu pinning is set.This is useful for other purposes as well (eg. ballooning before theinstance uses the memory), so we move the functionality out of the cpupinning code.
Note that before the "continue" command was executed in a finally after...
Implement memory ballooning in kvm
Signed-off-by: Guido Trotter <ultrotter@google.com>Reviewed-by: René Nussbaumer <rn@google.com>
Conflicts: NEWS: trivial
Signed-off-by: Guido Trotter <ultrotter@google.com>Reviewed-by: Andrea Spadaccini <spadaccio@google.com>
KVM: support version reported by 1.0
This of course was working for all the rcs, but broke with 1.0 itself.
In addition: - split between running kvm --version and parsing its output - unittest parsing for various known --help outputs - updated NEWS file...
hv_kvm: Make string containing regex a raw string
hv_kvm: Style fixes
Change a few lines to match rest of code.
hv_kvm.QmpMessage: Use dict.get
No need to look up the key twice.
serializer: Remove JSON indentation and dict key sorting
Serializing to JSON using “simplejson” is significantly slower whenindentation and/or sorting of dictionary keys is used. In simplejson 1.xthe difference isn't that big, but with simplejson 2.x the difference...
Add a balloon device to all kvm instances
This can be used to resize their memory (for now only manually, asganeti doesn't do the job yet)
Signed-off-by: Guido Trotter <ultrotter@google.com>Reviewed-by: Iustin Pop <iustin@google.com>
kvm: get more accurate info from qmp, if possible
kvm: make qmp connections more robust
Currently qmp fails at connect() time if there are socket errors. (eg.if the instance was started without qmp). Add some better checking.
Also in the only place where we use it avoid hiding the error connectingto the socket as a failure to read the password file....
hypervisors: use maximum memory for all operations
Conflicts: lib/cmdlib.py - trivial
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.
Revert "Implementation of TLS-protected SPICE connections"
This reverts commit b6267745ede04b3c943bc02e004bdb9347e0f564.This commit will be readded on master.
Revert "Add tls_ciphers and use_vdagent options"
This reverts commit 3e40b5879fa0070d6dd0e689dcfc31f20198a5a8.This commit will be readded on master.
Add memory transfer progress info to migration
Signed-off-by: Andrea Spadaccini <spadaccio@google.com>Reviewed-by: Michael Hanselmann <hansmi@google.com>
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
Fix interaction between CPU pinning and KVM migration
CPU pinning requires the KVM hypervisor to start in the paused state, inorder to retrieve information, and immediately unpauses it.
This does not play well with live migration, as the unpausing was done...
Add tls_ciphers and use_vdagent options
Implementation of TLS-protected SPICE connections
Added support for TLS-protected SPICE connections: