History | View | Annotate | Download (27.1 kB)
hypervisors: use maximum memory for all operations
Signed-off-by: Guido Trotter <ultrotter@google.com>Reviewed-by: Iustin Pop <iustin@google.com>
Merge branch 'devel-2.5'
Conflicts: lib/cmdlib.py - trivial
Signed-off-by: Guido Trotter <ultrotter@google.com>...
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
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)...
Abstract xen's 'xm' command as a constant
xen: abstract instance config file naming
Adapt non-KVM hypervisors to new migration RPCs
Signed-off-by: Andrea Spadaccini <spadaccio@google.com>Reviewed-by: Michael Hanselmann <hansmi@google.com>
Migration: warn the user about hv version mismatch
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_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.
Signed-off-by: Michael Hanselmann <hansmi@google.com>Reviewed-by: Iustin Pop <iustin@google.com>
Changed NET_PORT_CHECK to REQ_NET_PORT_CHECK, to improve consistency
I originally made this change because I needed the OPT_NET_PORT_CHECK,and I am committing it even if I don't need anymore OPT_NET_PORT_CHECKbecause IMO it improves the consistency of the name of the wrappers....
Add "reboot_behavior" hypervisor flag
During instance installations, you do not want the instance to rebootand start again with the same parameters, as that will most likelyre-start the install process. Therefore, when the instance requests areboot it should instead shutdown. This flag allows this to be...
Most boring patch ever
s/'/"/ in (hopefully) the right places.
Signed-off-by: Iustin Pop <iustin@google.com>Reviewed-by: Michael Hanselmann <hansmi@google.com>
Adding a wrapper around "xm console"
The wrapper will connect to the console, and check in the background ifthe instance is paused, unpausing it as necessary.
Signed-off-by: Stephen Shirley <diamond@google.com>Reviewed-by: Michael Hanselmann <hansmi@google.com>
Reverts the patch series about console wrappers
This reverts commits 030a9cb8022b83bf43ec14dfbafd943299bc01c4 andae082df0000a785b693b2f4aa434650a81a94bdf.
There are two problems:
- Makefile.am breakage, which is trivial to revert- unittest breakage, which honestly I'm not sure how to fix and how...
Add gnt-instance start --pause
Creates the instance, but pauses execution before booting. This combinedwith 'gnt-instance console' unpausing instances means that the entireboot process can be viewed and monitored.
Signed-off-by: Stephen Shirley <diamond@google.com>...
Make root_path an optional hypervisor parameter
This will allow us an easy migration to pv-grub, because a set root_pathconfused pv-grub.
Signed-off-by: René Nussbaumer <rn@google.com>Reviewed-by: Iustin Pop <iustin@google.com>
Use new console information in hypervisor abstraction
This makes use of the new way of returning console information from themaster daemon. Unittests are included.
Signed-off-by: Michael Hanselmann <hansmi@google.com>Reviewed-by: René Nussbaumer <rn@google.com>
Add missing paramter and unittests for this case
While git-am'ing the blockdev_prefix patch, I modified the hv_xen.pyfile but forgot to amend the patch :(, so here it is.
Furthermore, to detect such inconsistencies in the future, a unittest isadded that cross-checks the default parameters in constants.py and the...
Adding blockdev_prefix to hypervisor options
Allows to install Red Hat based systems, for example Oracle Linux.Tested with OEL.
The hypervisor by default offers a device named 'sda'. If the SCSImodule is already loaded, the disk device can't be created due to naming...
Introduce new IPAddress classes
This patch unifies the netutils functions dealing with IP addresses tothree classes:- IPAddress: Common IP address functionality- IPv4Address: IPv4 specific functionality- IPv6address: IPv6-specific functionality
Furthermore it adds methods to check whether an address is a loopback...
Rename migration type to migration mode
This is in preparation for the rename of the opcode 'live' parameter to'mode'.
Signed-off-by: Iustin Pop <iustin@google.com>Reviewed-by: René Nussbaumer <rn@google.com>
Add a migration type global hypervisor parameter
Since migration live/non-live is more stable (e.g.) for Xen-PVM versusXen-HVM, we introduce a new parameter for what mode we should use bydefault (if not overridden by the user, in the opcode).
The meaning of the opcode 'live' field changes from boolean to either...
Introduce lib/netutils.py
This patch moves network utility functions to a dedicated module.
Signed-off-by: Manuel Franceschini <livewire@google.com>Reviewed-by: Iustin Pop <iustin@google.com>
Introduce utils.IsValidIP{4,6}()
This patch introduces functions to check for valid IPv4 and IPv6addresses and converts IsValidIP() to return True if it is either a IPv4or a IPv6 address.
For now we do not change the functional behavior and replace IsValidIP...
Update FinalizeMigration docstring
This is used not only for aborted migrations, so the docstring shouldreflect that.
Fix two race conditions in reboot instance
If the instance crashes between backend.InstanceReboot checks the listof running instances and the execution of hv_xen.RebootInstance,ini_info will be None. And if the instance doesn't reboot fast enough,new_info will be None. Both cases lead to “TypeError: unsubscriptable...
Add a hypervisor constant for migration support
This variable can be used by other tools to determine in a generic waywhether a given hypervisor supports migration or not.
Extend the hypervisor API with name-only shutdown
Currently the ShutdownInstance method of the hypervisors takes a fullinstance object. However, when doing instance shutdowns from the nodeonly, we don't have a full object, just the name.
To handle this use case, we add a new ‘name’ argument to the method,...
Merge remote branch 'origin/stable-2.1' into devel-2.1
Fix missing bridge for xen instances
Xen instances nic definitions miss the target bridge.
This bug was introduced in commit 503b97a9.
Signed-off-by: Alessandro Cincaglini <alessandro.ciancaglini@gmail.com>Reviewed-by: Iustin Pop <iustin@google.com>Reviewed-by: Guido Trotter <ultrotter@google.com>...
Merge branch 'devel-2.0' into devel-2.1
Conflicts: lib/backend.py - trivial merge...
Ensure all int/float conversions are handled right
int()/float() can raise either ValueError (in case of int("a")), orTypeError (in case of int(None)). We had many bugs over time due tothis, and a recent one was just diagnosed, so we go over the codebase...
Fix unused imports or add silences where needed
In some cases pylint doesn't parse the import correctly, so we addsilences; but there are also many cases of unused imports, which wesimply remove.
Signed-off-by: Iustin Pop <iustin@google.com>Reviewed-by: Olivier Tharan <olive@google.com>
hv_xen/_GetConfigFileDiskData: remove unused arg
The disk template is not needed, all that's used is the disk data. Assuch, remove this parameter from the function.
Add use_localtime parameter for xen-hvm and kvm
Currently xen-hvm and kvm use different real time clock by default. Toreduce confusion, this patch adds an optional use_localtime parameter.
If the real time clock on the instance is set to local time, the...
Migration: add check for listening target
This patch adds a check for listening on the remote port in Xen and KVMmigrations. This will be generating a single “load of migration failed”message for KVM, but otherwise not prevent the migration. For Xen (which...
hypervisors: switch to using HV_MIGRATION_PORT
This changes KVM to use HV_MIGRATION_PORT instead of KVM_MIGRATION_PORTand enables passing the port for Xen migrations.
Since KVM_MIGRATION_PORT is not used anymore, we stop exporting it fromconstants.py....
Introduce HV_MIGRATION_PORT hypervisor parameter
This parameter will replace the direct use of KVM_MIGRATION_PORT and theimplicit use of the Xen migration port.
While it doesn't make sense to change this at instance level, we don'thave any other infrastructure for cluster-wide hypervisor parameters, so...
hypervisors: change MigrateInstance API
Currently the $hypervisor.MigrateInstance takes the instance name. Thispatch changes it to take the instance object, such that other instanceproperties (especially hvparams) are available to it.
Signed-off-by: Iustin Pop <iustin@google.com>...
hv_xen: Convert to utils.Retry
Xen: Ignore the retry argument in stop instance
Commit 4ad4511 changed the KVM hypervisor to send multiple shutdownrequests to the monitor, but it didn't change this for the Xenhypervisor. We simply remove the return on retry model, since we do wantto send multiple shutdown signals for both Xen and KVM (even if the...
Code and docstring style fixes
Found using pylint and epydoc.
Signed-off-by: Michael Hanselmann <hansmi@google.com>Reviewed-by: Guido Trotter <ultrotter@google.com>
Hypervisors: Add retry= to StopInstance
Currently some hypervisors need the stop operations to be retried morethan once, while other ones only do it in one pass. With this changewe'll handle retries outside the hypervisor code, but telling whetherthis is the first try or not....
VNC password: move to hv param and use in kvm
Signed-off-by: Guido Trotter <ultrotter@google.com>Reviewed-by: Olivier Tharan <olive@google.com>
Add support for using the bootloader in xen-pvm
This patch adds three optional parameters: - 'use_bootloader', whether use or not the bootloader - 'bootloader_path', absolute path to the bootloader - 'bootloader_args', extra arguments to the bootloader...
Even more style fixes
Signed-off-by: Michael Hanselmann <hansmi@google.com>Reviewed-by: Luca Bigliardi <shammash@google.com>
Implement the KERNEL_PATH parameter for xen-hvm
For the xen-hvm hypervisor, the KERNEL_PATH parameter is needed buttoday is hardcoded to a constants in the xen hypervisor library (argh!).
This patch moves this to a hypervisor constant with the default value...
Move HVM's device_model to a hypervisor parameter
This moves yet another hardcoded value to a hypervisor parameter. Iremoved the 64/32 difference as it doesn't seem valid to me - it's moreof a local site config rather than arch config.
Merge branch 'next' into branch-2.1
Fix pylint warnings
Xen: NIC parameters
Add a node powercycle command
This (somewhat big) patch adds support for remotely rebooting the nodesvia whatever support the hypervisor has for such a concept.
For KVM/fake (and containers in the future) this just uses sysrq plus a‘reboot’ call if the sysrq method failed. For Xen, it first tries the...
Xen: add ancillary files
Move to data-based hvparam checks instead of code
Currently the hypervisor parameters are checked using hard-coded snippets ineach hypervisor. However, most parameter checks fall into three cases: - file check - directory check - string value in a set...
Merge commit 'origin/next' into branch-2.1
Move more hypervisor strings into constants
This patch adds constants for the mouse and boot order strings; whilethere are still some issues remaining, we're trying to cleanup hardcodedstrings from the hypervisors.
Since the formatting of frozensets is currently wrong, we also add an...
Fix Xen soft reboot via polling
This patch fixes the Xen soft reboot ("xm reboot") via polling for a specifictime for either changed domain ID or decreased CPU run-time.
This sould prevent the race-conditions discussed on the mailing list forreboots....
Xen: Remove one hardcoded constant
s/"vnc_bind_address"/constants.HV_VNC_BIND_ADDRESS/
Reviewed-by: imsnah
Fix xen-hvm and KERNEL_ARGS
xen-hvm doesn't have KERNEL_ARGS, and I just changed blindly all oldextra_args to HV_KERNEL_ARGS. This makes xen-hvm work again.
Remove the extra_args parameter in instance start
This patch removes the extra_args parameter and instead switches theinstance to the HV_KERNEL_ARGS hypervisor option.
This is a big change, but it's a needed cleanup, this extra parameter onall RPC calls is not generic and we also need to have a persistent value...
Simplify a little the hypervisor routines
Instead of “instance.hvparams”, we use a shorter “hvp” name to make readabilitybetter.
Show more details for failed xen commands
This patch also logs the output of the xm commands in case of failures;some corner cases were forgotten in the last redo.
Some small fixes
This patch removes the admin_ram LUQueryInstances field (is brokenanyway) and fixes the VNC address checks in the Xen Hypervisor.
Xen-HVM: Improve the invalid disk/nic type error
Copy the message from the KVM one, adding a missing 'the' and a list ofpossible values, to help the user in his decision.
Reviewed-by: iustinp
Rename the device type constants
These are not HVM specific, so have been given an HT generic name.
s/HT_HVM_VNC_BASE_PORT/VNC_BASE_PORT/g
The VNC base port has nothing to do with HVM itself, and is general toVNC itself, so we're removing the HT_HVM prefix to the constant.
Export the cpu nodes and sockets from Xen
This is a hand-picked forward patch of commit 1755 on the 1.2 branch(hand-picked since the trees diverged too much since then):
The patch changed the xen hypervisor to compute the number of cpu sockets/nodes and enables the command line and the RAPI to show this...
Get rid of constants.HT_HVM_DEFAULT_BOOT_ORDER
Confusingly, as a leftober from 1.2, there was aconstants.HT_HVM_DEFAULT_BOOT_ORDER constant, with a value opposite tothe default HV_BOOT_ORDER hv param that got enabled only ifHV_BOOT_ORDER was set to None. Since setting it to None is very...
GetShellCommand: get hvparams and beparams
Sometimes the hypervisor will use the instance hv and/or be parametersto determine the best shell command. This is not possible, though,currently, as the instance hv/beparams are not filled, so we have topass the filled versions separately....
Actually mark drives as read-only if so configured
This patch correctly marks the drives as read-only for Xen, and raisesand exception for KVM since it doesn't support read-only drives.
Reviewed-by: ultrotter
Xen: use utils.WriteFile for the instance configs
Also raise HypervisorError rather than OpExecError.
Xen: use utils.Readfile to read the VNC password
KVM and Xen: add the HV_ROOT_PATH parameter
This parameter allows a different path to be passed to the instancekernel. The new parameter is mandatory, and by default has the value ofthe old hardcoded value for both kvm and xen.
Beta1 clusters will need to have this parameter added for their...
KVM: implement GetShellCommandForConsole
This is a class method, because it calls _InstanceSerial, which isanother class method. The patch changes it to classmethod for all thehypervisor classes.
Xen and KVM: correct a typo when checking args
A missing 'be' was present in the error string for both xen and kvm,when the kernel or initrd path was not absolute.
Xen: implement auxiliary migration functions
These are used, for the xen hypervisor, to copy the xen config file tothe remote node. This breaks migration for instances which have beenmigrated, but not restarted, with the old code, for which the configfile was just lost....
Fix some more pylint errors
Two are real errors (invalid names) and one is style error (overridingname from outer scope).
Xen: use epydoc in MigrateInstance docstring
Forward port the live migration from 1.2 branch
This is forward port via copy (and not individual patches cherry-pick)of the latest code on the 1.2 branch related to the migration.
The changes compared to 1.2 are the fact that we don't need theIdentifyDisks step anymore (the drbd rpc calls are independent now), and...
Simplify hypervisor block_devices structure
This is a partial forward-port of commit 1136 on the 1.2 branch:
The hypervisor doesn't need to be passed the whole block device structure, so we'll just give it the block device name on the local node, and the name as seen by the instance. This will make it easier to...
Fix some pylint-detected issues
Two bad indentation cases and a missing variable.
cleanup: xen hypervisor
Wrong indentation and uniformize one method signature.
Reviewed-by: amishchenko
Fix epydoc format warnings
This patch should fix all outstanding epydoc parsing errors; as such, weswitch epydoc into verbose mode so that any new errors will be visible.
Change Xen hypervisor to not use iv_name
Currently the iv_name is very linux-specific, and will break with themulti-disk changes.
The patch changes this to generate sdX names based on the disk index inthe disks structure, instead of relying on the iv_name....
Convert hv_xen.py to use the logging module
Change hypervisors to use the beparams
This patch changes the hypervisor functions to use the beparams dictinstead of the instance attributes.
Implement the new hypervisor API in base/xen
This patch adds the new methods CheckParameterSyntax and theValidateParameters in the base and xen hypervisors. It also changes thexen hypervisor to use the new hvparams field on instance.
Merge r1607 from branches/ganeti/ganeti-1.2
Use a default vnc_bind_address if None is specified
merge r1540 from branches/ganeti/ganeti-1.2
Allow access to HVM serial console
Merge r1536 from branches/ganeti/ganeti-1.2
Add HVM device type flags 2/3
Xen: remove two end-of-line semicolons
It's python, isn't it?
hypervisor: add live migration support
This is just the hypervisor-level migration (e.g. “xm migrate”) not thewhole node coordination work.