]> git.proxmox.com Git - pve-ha-manager.git/log
pve-ha-manager.git
8 years agoFenceConfig: remove strange __die()
Dietmar Maurer [Tue, 15 Mar 2016 10:29:30 +0000 (11:29 +0100)]
FenceConfig: remove strange __die()

8 years agoadd FenceConfig class for external fencing devices
Thomas Lamprecht [Tue, 15 Mar 2016 07:44:28 +0000 (08:44 +0100)]
add FenceConfig class for external fencing devices

Add a FenceConfig class which includes methods to parse a config
file for fence devices in the format specified by dlm.conf, see the
Fencing section in the dlm.conf manpage for more details regarding
this format.

With this we can generate commands for fencing a node from the
parsed config file.

We assume that the fence config resides in the pve cluster fs under
/etc/pve/ha/fence_devices.cfg for the PVE2 environment.
But we can give parse_config and arbitary raw string, this allows
to use fencing also in (regression) tests and simultaion.

A simple regression testing script for the config generation was
also added. This test mainly the parse_config and get_commands
methods. A config file can be passed as argument, else we cycle
through the *.cfg files in the fence_cfgs folder.

Example configs for regression testing are located in
src/test/fence_cfgs directory
Note that not all files are valid examples as some are used to check
the error handling of the parser!

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
8 years agobump version to 1.0-25
Dietmar Maurer [Tue, 8 Mar 2016 10:51:10 +0000 (11:51 +0100)]
bump version to 1.0-25

8 years agoUse config_file from PVE::QemuConfig
Fabian Grünbichler [Mon, 7 Mar 2016 11:42:32 +0000 (12:42 +0100)]
Use config_file from PVE::QemuConfig

update after refactoring

8 years agoLXC refactoring
Fabian Grünbichler [Wed, 2 Mar 2016 12:54:17 +0000 (13:54 +0100)]
LXC refactoring

call config_file in PVE::LXC::Config instead of PVE::LXC

8 years agosimulator: install all virtual resources
Thomas Lamprecht [Wed, 2 Mar 2016 09:35:57 +0000 (10:35 +0100)]
simulator: install all virtual resources

we include it in the source and we also want to allow to use it

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
8 years agobump version to 1.0-23
Dietmar Maurer [Wed, 24 Feb 2016 11:15:48 +0000 (12:15 +0100)]
bump version to 1.0-23

8 years agofix infinite started <=> migrate cycle
Thomas Lamprecht [Wed, 24 Feb 2016 07:33:59 +0000 (08:33 +0100)]
fix infinite started <=> migrate cycle

If we get an 'EWRONG_NODE' error from the migration we have no sane
way out. If we place it then in the started state we also get the
'EWRONG_NODE' error again and it even will place the service in
the migration state again (when it's not restricted by a group) and
thus result in an infinite started <=> migrate cycle.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
8 years agoadd test for infinite started <=> migrate cycle
Thomas Lamprecht [Wed, 24 Feb 2016 10:25:34 +0000 (11:25 +0100)]
add test for infinite started <=> migrate cycle

8 years agoexec_resource_agent: process error state early
Thomas Lamprecht [Wed, 24 Feb 2016 07:33:58 +0000 (08:33 +0100)]
exec_resource_agent: process error state early

We want to give the error state priority over EWRONG_NODE as a
service may be in the error state because of EWRONG_NODE

Change the error message a bit as we now can not distinguish
running and stopped services.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
8 years agoavoid out of sync command execution in LRM
Thomas Lamprecht [Wed, 24 Feb 2016 09:06:52 +0000 (10:06 +0100)]
avoid out of sync command execution in LRM

We are only allowed to execute any command once as else we
may disturb the synchrony between CRM and LRM.

The following scenario could happen:
schedule CRM: deploy task 'migrate' for service vm:100 with UID 1234
schedule LRM: fork task wit UID 123
schedule CRM: idle as no result available yet
schedule LRM: collect finished task UID and write result for CRM
      Result was an error
schedule LRM: fork task UID _AGAIN_
schedule CRM: processes _previous_ erroneous result from LRM
      and place vm:100 in started state on source node
schedule LRM: collect finished task UID and write result for CRM
      This time the task was successful and service is on
      target node, but the CRM know _nothing_ of it!
schedule LRM: try to schedule task but service is not on this node!
=> error

To fix that we _never_ execute two exactly same commands after each
other, exactly means here that the UID of the actual command to
queue is already a valid result.

This enforces the originally wanted SYN - ACK behaviour between CRM
and LRMs.

We generate now a new UID for services who does not change state
the one of the following evaluates to true:
* enabled AND in started state

This ensures that the state from the CRM holds in the LRM and thus,
for example, a killed VM gets restarted.

Note that the 'stopped' command is an exception, as we do not check
its result in the CRM (thus no race here) and we always want to
execute it (even when no CRM is active).

8 years agodo not pass ETRY_AGAIN back to the CRM
Dietmar Maurer [Wed, 24 Feb 2016 06:58:40 +0000 (07:58 +0100)]
do not pass ETRY_AGAIN back to the CRM

This is simply not necessary. Everything can be done inside the LRM.

8 years agocrm: avoid 'started' state after relocate if serive is disabled
Dietmar Maurer [Mon, 22 Feb 2016 11:49:47 +0000 (12:49 +0100)]
crm: avoid 'started' state after relocate if serive is disabled

8 years agofix 'uninitialized value' on online node usage computation
Thomas Lamprecht [Fri, 19 Feb 2016 17:41:03 +0000 (18:41 +0100)]
fix 'uninitialized value' on online node usage computation

This fixes a bug introduced by commit 9da84a0 which set the wrong
hash when a disabled service got a migrate/relocate command.

We set "node => $target", while our state machine could handle that
we got some "uninitialized value" warnings when migrating a disabled
service to an inactive LRM. Better set "target => $target"

Further add a test for this scenario.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
8 years agofix some log formatting
Thomas Lamprecht [Fri, 19 Feb 2016 17:41:02 +0000 (18:41 +0100)]
fix some log formatting

First remove trailing whitespace from log messages on state changes
This needs to touch some regression test, but with no change in
semantics.

Second add a missing paranthese on the "fixup service location"
message. This needs no regression test log.expect changes.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
8 years agobump version to 1.0-22
Dietmar Maurer [Mon, 15 Feb 2016 09:58:20 +0000 (10:58 +0100)]
bump version to 1.0-22

8 years agofix 'change_service_location' misuse and recovery from fencing
Thomas Lamprecht [Fri, 12 Feb 2016 15:14:54 +0000 (16:14 +0100)]
fix 'change_service_location' misuse and recovery from fencing

First rename the change_service_location method from the environment
to an more fitting name, 'steal_service'.

The 'change_service_location' from the virtual hardware class stays
at it is, because there the name fits (those function have not the
same meaning, so it's good that they named different now).

As we misused the config steal method (former
change_service_location) in the stopped state to process the
services from fenced nodes we need another way now.

This is achieved through the private method 'recover_fenced_service'
which is now the only place who has the right to steal a service
from an node.
When a node was successfully fenced we no longer change its services
state to 'stopped', rather we drop that hack and search a new node
in 'recover_fenced_service', if found we the steal the service and
move it to from the fenced to the new (recovery) node and place it
there in the 'started' state, after that the state machine is able
to handle the rest.

If we do not find a node we try again next round as that is better
then placing it in the error state, because so we have still a
chance to recover, which we do not have with the error state.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
8 years agoadd VirtFail resource and use it in new regression tests
Thomas Lamprecht [Wed, 10 Feb 2016 13:13:44 +0000 (14:13 +0100)]
add VirtFail resource and use it in new regression tests

This resource let us test a defined failiure behaviour ofi services.

Through the VMID we define how it should behave, with the folowing
rules:

When the service has the SID "fa:abcde" the digits a - e mean:

a - no meaning but can be used for differentiating similar resources
b - how many tries are needed to start correctly (0=default)
c - how many tries are needed to migrate correctly (0=default)
d - should shutdown be successful (0 = yes, anything else no)
e - return value of $plugin->exists() defaults to 1 if not set

a,b,c should always be set even if b and c have defaults (makes test
purpose clearer)
d and e

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
8 years agotruncate log level in regression tests
Thomas Lamprecht [Wed, 10 Feb 2016 13:13:43 +0000 (14:13 +0100)]
truncate log level in regression tests

this is mainly for formatting (prettiness) purpose but helps when
going through an output of a test.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
8 years agoimprove relocation policy code in manager and LRM
Thomas Lamprecht [Wed, 10 Feb 2016 13:13:42 +0000 (14:13 +0100)]
improve relocation policy code in manager and LRM

Else a few branches would not be taken and the behaviour wasn't
quite straightforward.

Only increment tries if we really retry and log retries

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
8 years agoreplace can_fork with get_max_workers
Thomas Lamprecht [Wed, 10 Feb 2016 10:58:24 +0000 (11:58 +0100)]
replace can_fork with get_max_workers

This patch implements the use of the new max_workers setting from
the datacenter.cfg.

Adding a 'get_max_worker' method to the enviornment allows us to
do that and to replace 'can_fork' with that method.

can_fork isn't needed anymore as get_max_worker may simply return 0
to signal that the respective enviornment can not fork.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
8 years agoimprove verbosity of API status call
Dietmar Maurer [Wed, 10 Feb 2016 06:20:05 +0000 (07:20 +0100)]
improve verbosity of API status call

Display the state of a LRM when it is not in the "active" state
and has some service configured.

This should reduce confiusion when the LRM is active but still has
to wait for its lock. In such a case the user only sees that it's
active and could think it's malfunctioning because no action
happens.

Also displays the LRM mode, so that we can see when we restart the LRM.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
8 years agocleanup: remove resources_config_exists
Dietmar Maurer [Tue, 9 Feb 2016 10:15:21 +0000 (11:15 +0100)]
cleanup: remove resources_config_exists

8 years agoreplace service_config_exists with has_services
Thomas Lamprecht [Mon, 8 Feb 2016 13:39:04 +0000 (14:39 +0100)]
replace service_config_exists with has_services

Remove the "service_config_exists" method from the Environment class
and replace it with a new method in PVE::HA::Tools.
First we do not need this method in the Environment class and second
this can be reused more for checking if a note has any service
configured.

This moves the regression test also a little closer to the real
world behaviour (while maintaining determinism).

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
8 years agofix inf. loop error on orphaned workers
Dietmar Maurer [Tue, 9 Feb 2016 07:56:10 +0000 (08:56 +0100)]
fix inf. loop error on orphaned workers

8 years agobump version to 1.0-21
Dietmar Maurer [Thu, 4 Feb 2016 17:24:03 +0000 (18:24 +0100)]
bump version to 1.0-21

8 years agoFix postinstall script not removing watchdog-mux.socket
Wolfgang Bumiller [Thu, 4 Feb 2016 09:49:53 +0000 (10:49 +0100)]
Fix postinstall script not removing watchdog-mux.socket

watchdog-mux.socket was removed in f8a3fc80af but the
postinstall script used -e instead of -L to test for the
symlink, which fails since the destination is already
removed at that point.

Use -L and remove the dead symlink if it exists.

Reported-by: Alexandre Derumier <aderumier@odiso.com>
8 years agobump versionm to 1.0-20
Dietmar Maurer [Wed, 27 Jan 2016 16:05:46 +0000 (17:05 +0100)]
bump versionm to 1.0-20

8 years agomove upid_wait from PVE2 env to HA::Tools
Thomas Lamprecht [Wed, 27 Jan 2016 12:16:35 +0000 (13:16 +0100)]
move upid_wait from PVE2 env to HA::Tools

We can now use the new wait_upid from PVE::Tools and we output a
"Task still active" every five seconds instead of every second,
so we trash the log less.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
8 years agofix check if a resource migrated correctly
Thomas Lamprecht [Wed, 27 Jan 2016 12:16:34 +0000 (13:16 +0100)]
fix check if a resource migrated correctly

Move the check from exec_resource_agents to the migrate method of
the resource plugins so that we may delete the traces from the
additional method 'is_on_node' which was intended for this
purpose.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
8 years agoadd after_fork method to HA environment and use it in LRM
Thomas Lamprecht [Wed, 27 Jan 2016 12:16:33 +0000 (13:16 +0100)]
add after_fork method to HA environment and use it in LRM

As both the realtime simulator and the real world Environment can
fork but we only need to clean up after a fork in the real world
introduce a after_fork method

In PVE2 it closes the inherited INotify fd and reopens it for the
worker.
Also a cfs_update gets triggered as (other) workers may change the
cluster state.

also use the new introduction HA-Env method to clean up after
we forked an LRM worker.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
8 years agochange include order to register resource plugin correctly
Dietmar Maurer [Wed, 27 Jan 2016 07:24:11 +0000 (08:24 +0100)]
change include order to register resource plugin correctly

8 years agoremove ugly import hack
Dietmar Maurer [Tue, 26 Jan 2016 16:12:52 +0000 (17:12 +0100)]
remove ugly import hack

Not required if we register resources from the Env class.

8 years agouse require to include resources from simulation environment
Dietmar Maurer [Tue, 26 Jan 2016 11:47:28 +0000 (12:47 +0100)]
use require to include resources from simulation environment

Because the may not be installed on a normal system.

8 years agoMove exec_resource_agent from environment classes to LRM
Thomas Lamprecht [Fri, 22 Jan 2016 16:06:42 +0000 (17:06 +0100)]
Move exec_resource_agent from environment classes to LRM

With the changes and preparation work from the previous commits
we can now move the quite important method exec_resource_agent
from the Env classes to the LRM where it get's called.

The main advantage of this is that it now underlies regression
tests and that we do not have two separate methods where it
- does not make sense as agents them self should be virtualized
  not the method executing them
- adds more work as the must (or at least should) be in sync

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
8 years agoPVE::HA::Config: use import flag to load appropritate resources
Dietmar Maurer [Tue, 26 Jan 2016 08:23:54 +0000 (09:23 +0100)]
PVE::HA::Config: use import flag to load appropritate resources

8 years agoAdd virtual resources for tests and simulation
Thomas Lamprecht [Fri, 22 Jan 2016 16:06:39 +0000 (17:06 +0100)]
Add virtual resources for tests and simulation

Introduce a base class for Virtual Resources with almost all methods
already implemented.
Also add a class for virtual CTs and VMs, with the primary
distinction that CTs may not migrate online.

The Resource are registered in the Hardware class and overwrite
any already registered resources from the same type (e.g. VirtVM
overwrites PVEVM) so that the correct plugins are loaded for
regression tests and the simulator.

This makes the way free for adding(deterministic) 'malicious'
resources, so we can make test where, for example, a service fails
a few times to start or migrate.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
8 years agoEnv: add method to get hardware object
Thomas Lamprecht [Fri, 22 Jan 2016 16:06:37 +0000 (17:06 +0100)]
Env: add method to get hardware object

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
8 years agoadd 'haenv' parameter to plugin method 'check_running'
Thomas Lamprecht [Fri, 22 Jan 2016 16:06:38 +0000 (17:06 +0100)]
add 'haenv' parameter to plugin method 'check_running'

This is preparation work and needed when adding virtual resources
for testing/simulation purpose.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
8 years agoSplit up resources and move them to own sub folder
Thomas Lamprecht [Fri, 22 Jan 2016 16:06:35 +0000 (17:06 +0100)]
Split up resources and move them to own sub folder

Implementing every resource in the base 'Resources' class is a bit
messy, especially if more resource agent get added.

This moves each class to a own Perl module in the new 'Resources'
sub folder.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
8 years agoLRM: do not release lock on shutdown errors
Thomas Lamprecht [Mon, 18 Jan 2016 12:50:28 +0000 (13:50 +0100)]
LRM: do not release lock on shutdown errors

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
8 years agobump version to 1.0-19
Dietmar Maurer [Mon, 18 Jan 2016 11:41:30 +0000 (12:41 +0100)]
bump version to 1.0-19

8 years agoremove 'running' from migrate/relocate log message
Thomas Lamprecht [Mon, 18 Jan 2016 10:35:21 +0000 (11:35 +0100)]
remove 'running' from migrate/relocate log message

As relocate is never 'running' and migrate is only 'running
if the resource is a VM this could only generate confusion,
better use an neutral message.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
8 years agoLRM: release lock also on restart
Thomas Lamprecht [Mon, 18 Jan 2016 10:35:20 +0000 (11:35 +0100)]
LRM: release lock also on restart

Wen restarting the LRM (e.g. on a update) we get an new pid and thus
have to wait for our own lock to timeout.
We can (and should) do that as there are no services or all services
are freezed. If they are freezed only our LRM may touch them so we
we can unfreeze them faster with this patch.

The expected log of the restart-lrm test does not change much as the
test system does not need to wait for a timeout.

This let's the LRM start working directly after a restart,
especially usefull on package updates.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
8 years agoTestHardware: correct shutdown/reboot behaviour of CRM and LRM
Thomas Lamprecht [Mon, 18 Jan 2016 09:26:45 +0000 (10:26 +0100)]
TestHardware: correct shutdown/reboot behaviour of CRM and LRM

Instead of shutting down the LRM and then killing the CRM we now
also make a shutdown request to the CRM, that mirrors the real world
behaviour much better and let's us also test the lock release from
the CRM.

To accomplish this we add new sim_hardware commands for stopping and
starting the CRM.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
8 years agorelease LRM agent lock on graceful shutdown
Thomas Lamprecht [Fri, 15 Jan 2016 07:27:35 +0000 (08:27 +0100)]
release LRM agent lock on graceful shutdown

Release the agent lock when we shutdown the LRM and stopped all
services.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
8 years agoCRM: release lock on shutdown request
Thomas Lamprecht [Wed, 13 Jan 2016 14:15:32 +0000 (15:15 +0100)]
CRM: release lock on shutdown request

release the manager lock on a shutdown request, so another CRM slave
can get it and continue to work without waiting for the lock timeout

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
8 years agoresource agents: fix relocate
Thomas Lamprecht [Wed, 13 Jan 2016 14:15:31 +0000 (15:15 +0100)]
resource agents: fix relocate

Previously a relocate from a running VM wasn't possible as we always
tried to migrate online, this patch fixes that.

Also only VMs may migrate online for now Container will always get relocated.

This avoids also confusion from the 'migrate (running)' log message
in case of CTs as the always get relocated.

Fixes test test-shutdown3

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
8 years agoresource agents: generate parameters inside resource classes
Thomas Lamprecht [Wed, 13 Jan 2016 14:15:30 +0000 (15:15 +0100)]
resource agents: generate parameters inside resource classes

The params of resource methods are normally specific for each
resource type.

CTs and VMs have the same interfaces in the needed cases so we could
generate the params in the exec_resource_agent method. This is not
clean because:
 * resource specific stuff shouldn't be in this method
 * this can make problems if we want to add another resource type
   in the future which has a completely different interface

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
8 years agoadd test for container failback
Dietmar Maurer [Wed, 13 Jan 2016 08:04:01 +0000 (09:04 +0100)]
add test for container failback

8 years agoallow to simulate container resources
Dietmar Maurer [Wed, 13 Jan 2016 07:42:25 +0000 (08:42 +0100)]
allow to simulate container resources

8 years agoconvert agent restult to exit code
Dietmar Maurer [Wed, 13 Jan 2016 07:40:20 +0000 (08:40 +0100)]
convert agent restult to exit code

8 years agoadd another test case for failback
Dietmar Maurer [Wed, 13 Jan 2016 06:44:04 +0000 (07:44 +0100)]
add another test case for failback

8 years agobump version to 1.0-18
Dietmar Maurer [Tue, 12 Jan 2016 11:28:18 +0000 (12:28 +0100)]
bump version to 1.0-18

8 years agopve-ha-lrm.service: depend on lxc.service
Dietmar Maurer [Tue, 12 Jan 2016 11:02:23 +0000 (12:02 +0100)]
pve-ha-lrm.service: depend on lxc.service

lxc.service kills all containers at shutdown. So we need to deppend
on that, so that we can cleanly shutdown our containers.

8 years agore-add #DEBHELPER# code to postinst
Dietmar Maurer [Tue, 12 Jan 2016 09:37:50 +0000 (10:37 +0100)]
re-add #DEBHELPER# code to postinst

otherwise the services are not re-started correctly!

8 years agocleanup postinst script
Dietmar Maurer [Tue, 12 Jan 2016 09:29:21 +0000 (10:29 +0100)]
cleanup postinst script

only remove files when necessary - and run systemctl daemon-reload.

8 years agofree cmd pointer after it's execution
Thomas Lamprecht [Mon, 11 Jan 2016 12:20:17 +0000 (13:20 +0100)]
free cmd pointer after it's execution

Quoting the asprintf man page:
> [..]
> This pointer should be passed to free(3) to release the allocated
> storage when it is  no  longer needed.
> [..]

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
8 years agooutput watchdog module name if it gets loaded
Thomas Lamprecht [Mon, 11 Jan 2016 12:20:16 +0000 (13:20 +0100)]
output watchdog module name if it gets loaded

If /dev/watchdog is not present and a WATCHDOG_MODULE env variable
is set, output it's name before trying to load it (helps debugging).

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
8 years agosmall cleanup
Thomas Lamprecht [Mon, 11 Jan 2016 12:20:15 +0000 (13:20 +0100)]
small cleanup

remove the unlink_socket variable and it's check as they wher
always true, as error and the end of the programm can only be
reached when the socket is already set up.
Also unlinking an non existent file does not result in any error.

also some whitespace cleanup in the surrounding area.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
8 years agoremove watchdog-mux.socket
Thomas Lamprecht [Mon, 11 Jan 2016 12:20:14 +0000 (13:20 +0100)]
remove watchdog-mux.socket

The use of an systemd socket unit for the watchdog socket is not
necessary for us it even generates problems as the socket already
runs and accepts input when the watchdog-mux daemon itself is not
running. So the LRM/CRM could successfully open and update the
watchdog even if it was not running!

This patch removes the unit file, adds a postinst script which
handles the removal of the links generated from systemd itself
and removes also the code from watchdog-mux which handled
the systemd socket unit.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
8 years agobump version to 1.0-17
Dietmar Maurer [Mon, 11 Jan 2016 11:25:58 +0000 (12:25 +0100)]
bump version to 1.0-17

8 years agoResources.pm: use PVE::API2::LXC
Dietmar Maurer [Mon, 11 Jan 2016 11:24:02 +0000 (12:24 +0100)]
Resources.pm: use PVE::API2::LXC

8 years agoimprove log messages if service stop fails.
Dietmar Maurer [Fri, 8 Jan 2016 10:24:11 +0000 (11:24 +0100)]
improve log messages if service stop fails.

8 years agoadd service addition and deletion regression tests
Thomas Lamprecht [Thu, 7 Jan 2016 10:34:50 +0000 (11:34 +0100)]
add service addition and deletion regression tests

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
8 years agoadd service relocate regression test
Thomas Lamprecht [Thu, 7 Jan 2016 10:34:49 +0000 (11:34 +0100)]
add service relocate regression test

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
8 years agoSim/Env: fix removing service from old node on migration
Thomas Lamprecht [Tue, 22 Dec 2015 07:52:38 +0000 (08:52 +0100)]
Sim/Env: fix removing service from old node on migration

We only removed the service from the source node on a relocate, we
also want to remove it on a successfull migration else we have it
on two nodes at the same time.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
8 years agoadd test to for previous commit
Thomas Lamprecht [Tue, 22 Dec 2015 07:52:39 +0000 (08:52 +0100)]
add test to for previous commit

This shows why we need always to 'delete' (i.e. setting it to 0)
the service from the old node when relocating or migrating.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
8 years agoadd service migrate/relocate to regression tests
Thomas Lamprecht [Tue, 22 Dec 2015 07:52:37 +0000 (08:52 +0100)]
add service migrate/relocate to regression tests

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
8 years agoadd queue_crm_commands_nolock
Dietmar Maurer [Tue, 22 Dec 2015 08:47:30 +0000 (09:47 +0100)]
add queue_crm_commands_nolock

8 years agoadd service disable/enable to regression tests
Thomas Lamprecht [Tue, 22 Dec 2015 07:52:35 +0000 (08:52 +0100)]
add service disable/enable to regression tests

Allow execution of user triggered service commands in regression
tests, like enable or disable. This is the test equivalent to a
ha-manager action service:id
command.

Also add a test for a disable enable cycle.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
8 years agoSim/Hardware: move set_service_state to base class
Thomas Lamprecht [Tue, 22 Dec 2015 07:52:33 +0000 (08:52 +0100)]
Sim/Hardware: move set_service_state to base class

Move the set_service_state method from the Realtime Hardware class
(RTHardware) to it's base class as the TestHardware could also use
it.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
8 years agoTestHardware: use more informative error message
Thomas Lamprecht [Mon, 21 Dec 2015 11:52:54 +0000 (12:52 +0100)]
TestHardware: use more informative error message

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
8 years agobump version to 1.0-16
Dietmar Maurer [Mon, 21 Dec 2015 09:21:46 +0000 (10:21 +0100)]
bump version to 1.0-16

8 years agocheck_active_workers: fix typo /uuid/uid/
Thomas Lamprecht [Mon, 21 Dec 2015 09:12:47 +0000 (10:12 +0100)]
check_active_workers: fix typo /uuid/uid/

This typo caused a bug where resource_command_finished was never
called as $w->{uuid} is not existing and thus always undefined.
Use the correct $w->{uid} instead.

Also fix a comment where used 'uuid' to avoid confusion.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
8 years agoavoid warning about uninitialized value
Dietmar Maurer [Wed, 16 Dec 2015 09:38:27 +0000 (10:38 +0100)]
avoid warning about uninitialized value

8 years agobump version to 1.0-15
Dietmar Maurer [Wed, 16 Dec 2015 09:34:22 +0000 (10:34 +0100)]
bump version to 1.0-15

8 years agocorrectly stop all resources on shutdown
Dietmar Maurer [Wed, 16 Dec 2015 09:30:37 +0000 (10:30 +0100)]
correctly stop all resources on shutdown

And wait for all worker tasks before exit.

8 years agolrm: catch repeated calls to shutdown_request
Dietmar Maurer [Wed, 16 Dec 2015 08:32:46 +0000 (09:32 +0100)]
lrm: catch repeated calls to shutdown_request

8 years agoimplement restart-lrm test
Dietmar Maurer [Wed, 16 Dec 2015 07:37:16 +0000 (08:37 +0100)]
implement restart-lrm test

8 years agonew test for node shutdown
Dietmar Maurer [Wed, 16 Dec 2015 07:21:21 +0000 (08:21 +0100)]
new test for node shutdown

8 years agocorrectly reset node status on power on/off
Dietmar Maurer [Wed, 16 Dec 2015 07:14:07 +0000 (08:14 +0100)]
correctly reset node status on power on/off

8 years agolrm: only freeze services if lrm is in 'restart' mode
Dietmar Maurer [Wed, 16 Dec 2015 06:41:39 +0000 (07:41 +0100)]
lrm: only freeze services if lrm is in 'restart' mode

8 years agorename is_poweroff to is_node_shutdown
Dietmar Maurer [Wed, 16 Dec 2015 05:46:34 +0000 (06:46 +0100)]
rename is_poweroff to is_node_shutdown

8 years agolrm: implement different behavior for shutdown and restart
Dietmar Maurer [Wed, 16 Dec 2015 05:31:56 +0000 (06:31 +0100)]
lrm: implement different behavior for shutdown and restart

We want to keep resources running at service restart (freeze), but
want to stop them at them at shutdown.

Actual stoping service will follow in the next patch.

8 years agoHA Env: add 'is_poweroff' function
Thomas Lamprecht [Mon, 14 Dec 2015 14:29:59 +0000 (15:29 +0100)]
HA Env: add 'is_poweroff' function

This function returns true if we do an shutdown/poweroff and thus the
services should not get freezed but fenced if the node does not
comes back up fast enough.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
8 years agoTestHardware: add 'reboot' and 'shutdown' command
Dietmar Maurer [Tue, 15 Dec 2015 09:26:35 +0000 (10:26 +0100)]
TestHardware: add 'reboot' and 'shutdown' command

8 years agoHardware: remove unnecessary lock in get_node_info
Thomas Lamprecht [Mon, 14 Dec 2015 14:29:53 +0000 (15:29 +0100)]
Hardware: remove unnecessary lock in get_node_info

This lock is not needed asthe status gets written with
file_set_contents from PVE::Tools which is atomic (fuse bug does
not apply here) so we do not need to be scared that we read
inconsistent data.

This also prevents a deadlock if any function needs to know if the
simulated node is quorate in a locked context, like
sim_hardware_cmd is.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
8 years agoset RELEASE=4.1
Dietmar Maurer [Thu, 3 Dec 2015 10:15:20 +0000 (11:15 +0100)]
set RELEASE=4.1

8 years agobump version to 1.0-14
Dietmar Maurer [Thu, 3 Dec 2015 10:10:04 +0000 (11:10 +0100)]
bump version to 1.0-14

8 years agoallow to configure watchdog module in /etc/default/pve-ha-manager
Dietmar Maurer [Thu, 3 Dec 2015 10:07:39 +0000 (11:07 +0100)]
allow to configure watchdog module in /etc/default/pve-ha-manager

All watchdog modules are blacklisted, so we cannot load them via /etc/modules.
Instead, watchdog-mux loads it at startup.

8 years agobump version to 1.0-13
Dietmar Maurer [Fri, 30 Oct 2015 10:17:09 +0000 (11:17 +0100)]
bump version to 1.0-13

8 years agoHA API: Fix permissions
Thomas Lamprecht [Fri, 30 Oct 2015 09:55:44 +0000 (10:55 +0100)]
HA API: Fix permissions

Integrate permission in the HA API so that not only root may do
changes.
-) create/edit/update actions need the 'Sys.Console' privileges on
   the root (/) path
-) read actions need the 'Sys.Audit' privilege on the root (/) path

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
8 years agobump version to 1.0-12
Dietmar Maurer [Thu, 29 Oct 2015 09:22:03 +0000 (10:22 +0100)]
bump version to 1.0-12

8 years agorefactor and reuse code in vm_is_ha_managed and service_is_ha_managed
Dietmar Maurer [Thu, 29 Oct 2015 09:19:14 +0000 (10:19 +0100)]
refactor and reuse code in vm_is_ha_managed and service_is_ha_managed

8 years agoexec_resource_agent: return valid exit code instead of die's
Thomas Lamprecht [Fri, 23 Oct 2015 12:04:25 +0000 (14:04 +0200)]
exec_resource_agent: return valid exit code instead of die's

Switch from die's to logging and return the respective exit codes.
This adds the possibility to handle (i.e.: fix) some errors outside
of the forked exec_resource_agent worker.

This does not changes behaviour for now, as the die returned an 255
exit code. We didn't checked on that exit code explicitly and so we
are safe to use the new exit codes, it results in the same behaviour
for the other code (most important the CRM Manager class).

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
8 years agoUse new exitcodes instead of integers
Thomas Lamprecht [Fri, 23 Oct 2015 12:04:24 +0000 (14:04 +0200)]
Use new exitcodes instead of integers

Use the new exitcodes introduced in the previous commit to gain
some readability.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
8 years agoAdding constants to gain more readability
Thomas Lamprecht [Fri, 23 Oct 2015 12:04:23 +0000 (14:04 +0200)]
Adding constants to gain more readability

Add constants to make some code easier to understand, especially the
execution of resource agents and their return codes.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
8 years agobump version to 1.0-11
Dietmar Maurer [Wed, 21 Oct 2015 06:59:07 +0000 (08:59 +0200)]
bump version to 1.0-11

8 years agoadd workaround for bug #775
Dietmar Maurer [Wed, 21 Oct 2015 06:57:30 +0000 (08:57 +0200)]
add workaround for bug #775