5
0
mirror of git://git.proxmox.com/git/pve-ha-manager.git synced 2025-01-24 06:03:55 +03:00

596 Commits

Author SHA1 Message Date
Thomas Lamprecht
ffb4bc0d8a bump version to 2.0-8
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-03-06 08:07:09 +01:00
Thomas Lamprecht
6b10f92d23 d/control: do not track qemu-server and pve-container dependency
While it would be correct to have them tracked here we cannot do this
at the moment, as with those two also depend on pve-ha-manager, and
with dpkg packaged under strech there's an issue with such cyclic
dependencies and trigger cycle detection only resolved for buster[0]

Currently, the issue exists on the following condition:

* update of pve-ha-manager plus either pve-container or qemu-server
* but _no_ update of pve-manager in the same upgrade cycle

[0]: 7f43bf5f93

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-03-06 08:07:09 +01:00
Thomas Lamprecht
b65075d6a7 bump version to 2.0-7
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-03-04 10:37:35 +01:00
Thomas Lamprecht
9698b69403 d/control: bump version dependency to pve-doc-generator
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-02-22 13:31:32 +01:00
Christian Ebner
2dbc366995 1891 Add zsh command completion for ha-manager CLI tools
Add the zsh command completion generation for the ha-manager CLI tools.

This adds the automatic generation of the autocompletion scripts for zsh

Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
2019-02-22 11:44:13 +01:00
Thomas Lamprecht
6b68528bc6 api: delete resource: refactor and cleanup indentation
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-01-26 12:05:07 +01:00
Thomas Lamprecht
60d1b1cacf fix #1602: allow to delete 'ignored' services over API
service_is_ha_managed returns false if a service is in the resource
configuration but marked as 'ignore', as for the internal stack it is
as it wasn't HA managed at all.

But user should be able to remvoe it from the configuration easily
even in this state, without setting the requesttate to anything else
first.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-01-25 09:31:45 +01:00
Thomas Lamprecht
a9a49e32c1 fix #1794: VM resource: catch qmp command exceptions
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-01-25 09:27:28 +01:00
Thomas Lamprecht
2eb4a7efca api: resource migrate: add description for node parameter
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-01-24 14:19:36 +01:00
Thomas Lamprecht
7e92211a2c fix #1842: do not pass forceStop to CT shutdown
The vm_shutdown parameter forceStop differs in behaviour between VMs
and CTs. While on VMs it ensures that a VM gets stoppped if it could
not shutdown gracefully only after the timeout passed, the container
stack always ignores any timeout if forceStop is set and hard stops
the CT immediately.
To achieve this behaviour for CTs too, the timeout is enough, as
lxc-stop then does the hard stop after timeout itself.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-01-23 09:43:17 +01:00
Thomas Lamprecht
a2b2fffaa8 fence cfg: count_devices: improve comment
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-01-13 13:17:12 +01:00
Thomas Lamprecht
89d5a77854 fence cfg parser: check command explicit, mark fence_all as todo
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-01-13 13:07:00 +01:00
Thomas Lamprecht
9a77e05914 fence config parser: output all errors at once
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-01-13 12:45:45 +01:00
Thomas Lamprecht
8937a758df fence config parser: early return on ignored devices
We do not support all of the dlm.conf possibilities, but we also do
not want to die on such "unkown" keys/commands as an admin should be
able to share this config if it is already used for other purposes,
e.g. lockd, gfs, or such.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-01-13 12:45:45 +01:00
Thomas Lamprecht
98dca1a462 FenceConfig: move line parsing out to closure
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-01-13 12:45:45 +01:00
Thomas Lamprecht
92cfcee1ab FenceConfig: whitespace cleanup
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-01-13 12:45:45 +01:00
Thomas Lamprecht
800a2de6a3 FenceConfig: early return if file is empty
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-01-13 12:45:45 +01:00
Thomas Lamprecht
1c2561110f d/lintian-overrids: add repeated-trigger-name override
in this package we provide api functions, thus we want to activate
the pve-api-update trigger, so that packages like pve-manager get
notified about it. But we also use api functions directly so we setup
an interest in the pve-api-update trigger. This results in an lintian
error (lintian version from buster or newer) which we can override:

> [...]
> This tag is also triggered if the package has an activate trigger
> for something on which it also declares an interest. The only (but
> rather unlikely) reason to do this is if another package also
> declares an interest and this package needs to activate that other
> package. If the package is using it for this exact purpose, then
> please use a Lintian override to state this.
-- https://lintian.debian.org/tags/repeated-trigger-name.html

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-01-08 17:35:59 +01:00
Thomas Lamprecht
3220c3391c sim: show sent emails in regression tests
its good to check if any regression regarding sendmail happened, as
it can be annoying if a sendmail loop happens.
2019-01-08 17:32:05 +01:00
Thomas Lamprecht
7488b3cc2c fence config: allow to pass arguments to fence agents via short-opts
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-01-08 15:28:06 +01:00
Thomas Lamprecht
a57a3b7809 d/control: add missing pve-container dependency
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-01-08 15:23:56 +01:00
Thomas Lamprecht
7583bf275c fencing: fixup run_fence_jobs
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-01-08 15:23:04 +01:00
Thomas Lamprecht
7655c92c81 fixup changelog line length and typos
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-01-07 13:35:34 +01:00
Thomas Lamprecht
e3e02f4688 bump version 2.0-6
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-01-07 13:00:00 +01:00
Wolfgang Bumiller
0354cbe945 fixup parse_sid call
This call was missed in the commit moving it from
PVE::HA::Tools to PVE::HA:Config.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
Fixes: 0087839aa530 ("Tools: remove dependency on PVE::Cluster")
2019-01-07 12:10:40 +01:00
Thomas Lamprecht
d2236278ac followup code cleanup
addresses a few nits from Fabians review at:
https://pve.proxmox.com/pipermail/pve-devel/2018-December/035061.html
https://pve.proxmox.com/pipermail/pve-devel/2018-December/035085.html

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-01-07 12:07:05 +01:00
Thomas Lamprecht
7a20d688d8 lrm: explicitly log shutdown_policy on node shutdown
Makes regression test a bit more telling and it helps to be verbose
for an user here too.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-01-07 11:17:30 +01:00
Thomas Lamprecht
ba15a9b908 fix #1378: allow to specify a service shutdown policy
Allow an admin to set a datacenter wide HA policy which can change
the way we handle services on a node shutdown.

There's:

* freeze: always freeze servivces, independent of the shutdown type
  (reboot, poweroff)
* failover: never freeze services, this means that a service will get
  recovered to another node if possible and if the current node does
  not comes back up in the grace period of 1 minute.
* default: this is the current behavior, freeze on reboot but do not
  freeze on poweroff

Add to tests, shutdown-policy1 which is based of the reboot1 test,
but enforces no freeze with a failover policy, and shutdown-policy2
which is based on the shutdown1 test but with a explicit freeze
policy. You can compare (diff) each tests log result to the test it's
based on to see what changes.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-01-07 11:17:30 +01:00
Thomas Lamprecht
ed408b4491 Env: add get_ha_settings method
Add get_ha_settings, a method which returns the datacenter wide HA
settings

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-01-07 11:17:30 +01:00
Rhonda D'Vine
b9350791a3 Add missing Build-Depends
Signed-off-by: Rhonda D'Vine <rhonda@proxmox.com>
2018-12-17 09:41:11 +01:00
Thomas Lamprecht
c974828745 install simulator executable into bin not sbin
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2018-10-17 11:51:04 +02:00
Thomas Lamprecht
1e07d70c29 Tools: add note about indirect include of Config module
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2018-10-17 11:41:44 +02:00
Fabian Grünbichler
728d9a2a97 build: actually ship SOURCE file
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2018-10-17 11:20:41 +02:00
Fabian Grünbichler
6ea95574cc build: bump compat level to 10
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2018-10-17 11:20:41 +02:00
Fabian Grünbichler
1116ca25b8 build: restructure packaging
use dpkg-buildpackage and debhelper properly, add missing dependencies and
embed used perl modules from libpve-common-perl to make pve-ha-simulator
standalone.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2018-10-17 11:20:41 +02:00
Fabian Grünbichler
0087839aa5 Tools: remove dependency on PVE::Cluster
by moving parse_sid to PVE::HA::Env, with the default implementation in
PVE::HA::Config.

the bash completion methods use PVE::HA::Config (and PVE::Cluster), but
the corresponding use statements are only in PVE::CLI::ha_manager, where the
bash completion is actually used.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2018-10-17 11:20:41 +02:00
Fabian Grünbichler
6529b6a4e2 Tools/Config: refactor lrm status json reading
to avoid unnecessary dependency on PVE::Cluster in PVE::HA::Tools.

reading the LRM status file was the only instance of reading from the
CFS via this method.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2018-10-17 11:20:41 +02:00
Fabian Grünbichler
5f52cd3c42 sim: don't install PVE::HA::Config
it is not needed anymore by the simulator.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2018-09-28 15:26:26 +02:00
Fabian Grünbichler
dd970f9ea6 sim: don't install real resources
they are not needed, the simulator contains its own (simulated)
resources.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2018-09-28 15:26:21 +02:00
Fabian Grünbichler
7d33cb12de groups: register groups directly
and use PVE::HA::Groups to parse the config when testing/simulating.

this allows us to drop the dependency on PVE::HA::Config, which would
otherwise pull in a lot of additional depdendencies that we don't want
in the simulator.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2018-09-28 14:06:59 +02:00
Fabian Grünbichler
f503a7bf77 pve-ha-tester: use correct lib path
since we want to test the version from the current working tree, and not
the installed one.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2018-09-28 14:06:59 +02:00
Fabian Grünbichler
e649331eab remove unused use statements
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2018-09-28 14:06:59 +02:00
Fabian Grünbichler
745fd425c4 build: remove leftover PHONY declaration
simdeb is already declared PHONY on its own

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2018-09-28 14:06:59 +02:00
Dominik Csapak
2799edd464 document api result for ha resources
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2018-09-17 12:43:54 +02:00
Thomas Lamprecht
c253924fd3 bump version to 2.0-5
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2018-02-07 11:20:28 +01:00
Thomas Lamprecht
9cdf16b1c8 buildsys: use correct git revision for SOURCE file 2018-02-07 10:38:51 +01:00
Thomas Lamprecht
724bd3f311 do not do active work if cfs update failed
We ignored if the cluster state update failed and happily worked with
an empty state, resulting in strange actions, e.g., the removal of
all (not so) "stale" services or changing the all but the masters
node state to unknown.

Check on the update result and if failed, either do not get active,
or, if already active, skip the current round with the knowledge
that we only got here because the update failed but our lock renew
worked => cfs got already in a working and quorate state again -
(probably just a restart)

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Reviewed-by: Dominik Csapak <d.csapak@proxmox.com> 
Tested-by: Dominik Csapak <d.csapak@proxmox.com>
2018-01-30 09:33:16 +01:00
Thomas Lamprecht
3df1538094 move cfs update to common code
We updated the CRM and LRM view of the cluster state only in the PVE2
environment, outside of all regression testing and simulation scope.

Further, we ignored if this update failed and happily worked with an
empty state, resulting in strange actions, e.g., the removal of all
(not so) "stale" services or changing the all but the masters node
state to unknown.

This patch tries to improve this by moving out the update in a own
environment method, cluster_update_state, calling this in the LRM and
CRM and saving its result.
As with our introduced functionallity to simulate cfs rw or update
errors we can also simulate failures of this state update with the RT
system.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Reviewed-by: Dominik Csapak <d.csapak@proxmox.com> 
Tested-by: Dominik Csapak <d.csapak@proxmox.com>
2018-01-30 09:33:16 +01:00
Thomas Lamprecht
da6f041699 move start/end hooks to common code
We called them at similar times anyways, and have them under the
regression test cover with this change.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Reviewed-by: Dominik Csapak <d.csapak@proxmox.com> 
Tested-by: Dominik Csapak <d.csapak@proxmox.com>
2018-01-30 09:33:16 +01:00
Thomas Lamprecht
ada4b9a830 Revert "wrap possible problematic cfs_read_file calls in eval"
This reverts commit bf7febe3771d6f9a2aef97bcd6eab4ece098c5aa.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Reviewed-by: Dominik Csapak <d.csapak@proxmox.com> 
Tested-by: Dominik Csapak <d.csapak@proxmox.com>
2018-01-30 09:33:16 +01:00