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...
Merge remote branch 'google/stable-2.6' into stable-2.6-ippool-hotplug-esi
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>
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...
Merge branch 'stable-2.6' into stable-2.6-ippool-hotplug-esi
Merge branch 'stable-2.6-hotplug' into stable-2.6-ippool-hotplug-esi
Fix a minor bug in hypervisor
Signed-off-by: Dimitris Aragiorgis <dimara@grnet.gr>
Conflicts: lib/cmdlib.py tools/cfgupgrade
Refactor hotplug implementation
Remove pci_pool from hotplug_info. Hypervisor decides the pci slotbased on current occupations.
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...
Fix gnt-instance console with xl
- Rename xm-console-wrapper to xen-console-wrapper- Pass the xen command to use as a parameter
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>
Conflicts: lib/cmdlib.py
Fixes to pass pylint (make lint)
Maintain backwards compatibility in kvm runtime
Introduce _GenerateKVMBlockDevicesOptions()
In case hotplug is enabled per instance then the runtime filecontains one more field: block_devices. In this case kvm_cmdis extended with block device options during _ExecuteKVMRuntime()....
Merge branch 'stable-hotplug'
Conflicts: lib/cli.py lib/client/gnt_instance.py lib/cmdlib.py lib/objects.py lib/opcodes.py lib/rpc.py
Hotplug: KVM support
KVM >= 1.0 is needed.
Introduce new methods: HotAddNic/HotDelNic
Both qemu monitor interface for hotplugging. If a device hashotplug info (idx, pci) then: - it gets named after it (e.g. virtio-net-pci.%d % idx ). - it gets placed to the pci slot (hex(pci)) of bus 0....
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
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...
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.
Support xl as a xen interface command
xm and xl are mostly compatible, there is just a change in migrate,which for now we simple bridge by comparing the command string.
Also XEN_CMD is now set during configure time. This will then be fixedin Ganeti 2.7 when we make it an hvparams....
Remove some duplicate code in the Xen config writing
Should be straightforward; the only difference from before is that wewill remove the 'auto' file even during migration finalise.
Signed-off-by: Iustin Pop <iustin@google.com>Reviewed-by: Michael Hanselmann <hansmi@google.com>
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.
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.
Signed-off-by: Guido Trotter <ultrotter@google.com>...
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.
Signed-off-by: Guido Trotter <ultrotter@google.com>Reviewed-by: Michael Hanselmann <hansmi@google.com>
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 xen
Signed-off-by: Guido Trotter <ultrotter@google.com>Reviewed-by: René Nussbaumer <rn@google.com>
Implement memory ballooning in kvm
xen: add the "maxmem" parameter in instances config
This is set to the same amount as the memory for now, but will allowstarting instances with less memory than their maximum.
Implement memory ballooning in the fake hv
No-op memory ballooning in chroot and lxc
Currently they have no memory limits set.
Hypervisor: allow ballooning of instance memory
This new hypervisor call sets the memory of an instance to a new value,through ballooning.
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
Signed-off-by: Michael Hanselmann <hansmi@google.com>Reviewed-by: Iustin Pop <iustin@google.com>
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)
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....
hv_xen: Report memory used by hypervisor
- Report memory used by hypervisor (“mem_hv” as per resource model design document, “xmem” in htools)- Also report number of CPUs available to Dom0- Some other, small changes
Signed-off-by: Michael Hanselmann <hansmi@google.com>...
hv_xen: Export number of CPUs for Dom0
This will be stored in the node object and used for calculations.
Signed-off-by: Michael Hanselmann <hansmi@google.com>Reviewed-by: René Nussbaumer <rn@google.com>
hv_xen: Use constant for “Domain-0” name
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)....
xen: abstract a few hardcoded strings as constants
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.
xen: changes to facilitate "xl" support (xen 4.1)
- Copy the xl config file, in case there's any- Start instances by config file, not name (also xm compatible)- Start paused domains with p and not --paused (also xm compatible) Add a fixme for migration (changes are not xm compatible)...
xen: abstract instance config file naming
Abstract xen's 'xm' command as a constant
Adapt non-KVM hypervisors to new migration RPCs
Signed-off-by: Andrea Spadaccini <spadaccio@google.com>Reviewed-by: Michael Hanselmann <hansmi@google.com>
Add memory transfer progress info to migration
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:
Added SPICE TLS option and related cert paths
Fix two pylint errors
- hv_kvm.py: silence F0401, that is raised if pylint does not find the affinity module- rlib2.py: change disable-msg to disable
hv_kvm: bugfix
Signed-off-by: Tsachy Shacham <tsachy@google.com>Signed-off-by: René Nussbaumer <rn@google.com>Reviewed-by: René Nussbaumer <rn@google.com>
hv_xen: fix use of CPU pinning constants
… to be consistent with hv_kvm
Signed-off-by: Tsachy Shacham <tsachy@google.com>Signed-off-by: Iustin Pop <iustin@google.com>Reviewed-by: Iustin Pop <iustin@google.com>
hv_kvm: fix hardcoded KVM command string
hv_kvm: support for CPU pinning
Signed-off-by: Tsachy Shacham <tsachy@google.com>Signed-off-by: Iustin Pop <iustin@google.com>[iustin@google.com: fixed some small code and style issues]Reviewed-by: Iustin Pop <iustin@google.com>
Add SPICE compression and streaming options
Add the following SPICE audio/image compression and video streamingdetection hypervisor options:
Add SPICE support to gnt-instance console
Also update related unit tests.
Make KVM use the QXL vga driver with SPICE
Enable by default the QXL paravirtualized graphic card if SPICE isenabled. The QXL driver is VESA compatible, so it degrades gracefully ifthe guest OS does not have QXL drivers.
Signed-off-by: Andrea Spadaccini <spadaccio@google.com>...
Use a loop to check SPICE parameters dependency
Use a loop to check if the user specified any SPICE option and SPICEsupport is disabled.
Added password for SPICE sessions
Added an optional parameter called spice_password_file that allowsthe user to protect the SPICE login with the password contained inthe specified file.
Draft implementation of QMP connection
Basic implementation of the QMP connection and related tests.
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)....
hv_xen: Support for CPU pinning
Signed-off-by: Tsachy Shacham <tsachy@google.com>Signed-off-by: Michael Hanselmann <hansmi@google.com>Reviewed-by: Michael Hanselmann <hansmi@google.com>
PEP8 style fixes
Identified using the “pep8” utility.
hv_kvm: initial support for CPU pinning
Signed-off-by: Tsachy Shacham <tsachy@google.com>Reviewed-by: Michael Hanselmann <hansmi@google.com>
hv_base: Support for multiple CPU mask
Handle network interfaces without IPs
If the user specified a network interface with no IPs, he would receivean unhelpful "list index out of range" error. Fixed that.
Signed-off-by: Andrea Spadaccini <spadaccio@google.com>Signed-off-by: Guido Trotter <ultrotter@google.com>...
Fixed potential unreferenced variable usage
I noticed a path in the code that would use spice_ip_version even ifit was not initialized. This patch fixes it.
Added basic support for SPICE
Implemented the following parameters:- spice_bind- spice_ip_version
Fixed an error in the documentation of _GetKVMVersion
Fixed an epydoc compilation error that I introduced with last commit.