302 Commits

Author SHA1 Message Date
Thomas Lamprecht
73ed0af158 cleanup: move bin/test to toplevel
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2018-06-20 13:04:51 +02:00
Thomas Lamprecht
6d820e34f2 cleanup: rename bin/init.d to services
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2018-06-20 13:04:51 +02:00
Fabian Grünbichler
2f6e5f3437 test: replication: adapt test data
otherwise the checks in write_config fail

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2018-05-14 13:58:11 +02:00
Fabian Grünbichler
0d7c2683ac test: replication: mock cfs_(write|lock)_file
which is needed since the HA recovery series

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2018-05-14 13:57:26 +02:00
René Jochum
57a9d4cb67 Extend the .gitignore(s)
Signed-off-by: René Jochum <rene@jochums.at>
2018-05-04 14:50:04 +02:00
Fabian Grünbichler
4a57db5592 pveupdate: add ACME certificate renewal
renew certificate if an acme config entry and a custom certificate
exists on the local node and the certificate expires soon.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2018-05-02 11:34:52 +02:00
Fabian Grünbichler
1a9df9c828 add pvenode CLIHandler
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2018-05-02 11:34:52 +02:00
Thomas Lamprecht
6720a01c78 pve-daily-update.service: add Wants/After for pve-cluster.service
Else systemd may start this to early on boot, before pve-cluster is
up and ready, if it missed and update because the node was offline.
This fails the services as it cannot do any IPC with pmxcfs

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2018-03-23 11:52:42 +01:00
Thomas Lamprecht
3877d4bff5 pveupdate: replace cron job with systemd timer
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2018-03-12 15:14:13 +01:00
Thomas Lamprecht
7755aa883c services: remove obsolete init.d scripts
They all have a systemd service file so no need for them anymore

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2018-03-12 14:19:41 +01:00
Thomas Lamprecht
0d6bb692f5 buildsys: add %.1.pod make target to reduce duplication
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2018-03-12 14:19:41 +01:00
Thomas Lamprecht
bb195e69b7 remove obsolete (rgmanager era) HA resource agent
This was used by rgmanager which was superseeded in 2015 with our
ha-manager for PVE 4.0

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2018-03-12 14:19:41 +01:00
Dietmar Maurer
d916c09d2b pveupdate - always run check for available updates 2017-12-21 10:17:56 +01:00
Wolfgang Link
64d39c2ef2 Send an email when a replication job fails.
A email notification will be send for each job when the job fails.
This message will only send when an error occurs and the fail count is on 1.

Reviewed-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Acked-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2017-12-13 14:51:07 +01:00
Dominik Csapak
4114aeac32 fix #1539: add missing shellquote for proxied commands of pvesh
if we do not do this, passing arguments with spaces
(e.g., pvesh set YYY --param "one word")
leads to ssh calls like this:
ssh REMOTE pvesh set YYY --param one word

which cannot be parsed correctly

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2017-10-31 08:28:10 +01:00
Philip Abernethy
66f7b0f74e Use run_cli_handler instead of deprecated run_cli 2017-10-18 15:32:52 +02:00
Wolfgang Bumiller
b03b47491f test: mock PVE::Cluster::cfs_update
Because the replication's purge_old_state() function now
fails if cfs_update() fails, and since it tries to access
the actual local pmxcfs it should never have been called by
tests anyway.
2017-10-18 15:31:00 +02:00
Wolfgang Bumiller
3fc44aca8f init: shorter pve-guests.service Description 2017-09-11 15:53:41 +02:00
Thomas Lamprecht
57de747b0c rename pve-manager.service to pve-guests
the name 'pve-manager' collides with our pve-manager package name,
which - from the user point of view - provides mainly the API and
WebUI.
An user could thus think that restarting 'pve-manager' would restart
the WebUIs server, which is relatable.
But, the pve-manager.service does not controls the WebUI or its
server but is responsible for starting all guest with 'onboot=1' in
their config on system boot and to stop all remaining running guests
on system shutdown.

Thus rename it to pve-guests and adapt its description. This may not
seem as ideal name at first glance, but its better than the current
option. Further it leads to log messages like:
 > Starting PVE guests (Service providing start-on-boot and stop-all-on-shutdown)
 > [...]
 > Started PVE guests (Service providing start-on-boot and stop-all-on-shutdown)
 > [...]
 > Stopping PVE guests (Service providing start-on-boot and stop-all-on-shutdown)

which makes it clearer what happens, or what this service is for.

Alias the new service to the old pve-manager.service for legacy
reasons. While our services do not depend on it an user could have
made an own service which used pve-manager.service as synchronisation
point.

Linitian then complains about init.d/pve-manager not having a related
systemd service file. Instead of renmaning it just drop it.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2017-09-11 09:34:02 +02:00
Thomas Lamprecht
e5ea71e1b9 pve-manager.service: move open-iscsi ordering to pve-storage.target
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2017-09-11 09:34:02 +02:00
Thomas Lamprecht
685b04b0bb pve-manager.service: allow logging STDERR and STDOUT
The API calls are not to chatty but may give helpfull hints about
what gets tried to be done.

This may help an Admin to figure out which guest delays his host
shutdown.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2017-09-11 09:34:02 +02:00
Thomas Lamprecht
0fe0d92471 pve-manager.service: refuse manual start/stop
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2017-09-11 09:34:02 +02:00
Thomas Lamprecht
a26ddafe22 pve-manager.service: do not allow stop to timeout
This services is responsible for bringing up 'onboot' marked guests
on host power-on and stop _all_ guests gracefully on host shutdown
(be it reboot, shutdow, halt, ..)

It's type is set to 'oneshot', which implies a TimeoutStartSec of
'infinity', by default. With Jessies Version of Systemd the
TimeoutStopSec defaulted to TimeoutStartSec, if not set – so also
'infinity'.
But, Debian Stretchs Version of Systemd makes TimeoutStopSec defaults
to 'DefaultTimeoutStopSec' if it was not set, which is by default 90
seconds – much less than infinity.

This may cause non-gracefull shutdowns of guests, as after the 90
seconds systemd sends a SIGKILL to the pvesh 'stopall' process.
This may end in a bad guest state then. But besides that it can also
lead to a hanging shutdown in some cirumstancesm, as some guest still
operated on storages, so systemd-shutdown - the binary which gets
exec'ed by systemd to become the new PID 1 cannot finish its
sync/umount/shutdown procedure. It has a watchdog armed on sync, if
that triggers you may even get a fully shut down system.
Else it can possibly hang forever, at least until the power plug gets
pulled or similar actions are taken.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2017-09-11 09:34:02 +02:00
Fabian Grünbichler
040f1aeb6c ceph: ensure mgr starts after pve-cluster
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2017-07-31 15:45:32 +02:00
Wolfgang Bumiller
103ddb8868 buildsys: use CC, CPPFLAGS and CFLAGS
pvemailforward is a tiny oneliner, but for the sake of best
practices, let's use the build tools from the environment.
For example, with dpkg-buildpackage this will make us use
-D_FORTIFY_SOURCE=2 etc.
2017-07-19 08:57:31 +02:00
Dietmar Maurer
b4f31a66df replication: fix regression tests 2017-06-29 07:46:56 +02:00
Wolfgang Bumiller
12c206a5ab tests: mock PVE::Cluster::get_members and adapt fail test
Commit 3385399339c94 ("replication: keep retrying every 30 minutes in
error state") changed the retry behavior to not stop after the 3rd error
and then stick to half-hour intervals. This needs to be reflected in the
tests. The numbers here match. (1900 + 30*60 = 3700).

Commit fd844180a7efa ("replication: don't sync to offline targets on
error states) changed the retry behavior to check whether the target
node is online. If this is not the case we fail right away. This
introduced a dependency on PVE::Cluster::get_members which we now need
to mock. Tests currently use node names "node{1,2,3}", so I just mock
those 3.
2017-06-28 06:05:44 +02:00
Wolfgang Bumiller
5b35845009 tests: update pvesr_lock_path variable location 2017-06-27 15:16:41 +02:00
Dietmar Maurer
2ca8059196 pvesr.timer: set AccuracySec=1
So that the user can predict when a job will/shpuld be started. I think
this will not have much impact on the cluster wide power consumption.
2017-06-23 11:41:37 +02:00
Dietmar Maurer
eaae2b5bb5 pvesr.service: add ConditionPathExists=/usr/bin/pvesr
And explicitly set type to 'oneshot', but I am not sure if it makes
any difference to 'simple'.
2017-06-23 10:44:54 +02:00
Wolfgang Link
0dfd4a9413 add systemd timer unit to trigger pvesr run 2017-06-23 10:20:34 +02:00
Dietmar Maurer
2aa029571c PVE/API2/Replication.pm: add $verbose parameter run_jobs() 2017-06-20 08:58:48 +02:00
Dietmar Maurer
d092dc4f83 use new replication helpers from pve-guest-common 2017-06-12 06:59:21 +02:00
Dietmar Maurer
810c6776d9 PVE::Replication - remove dependency to PVE::LXC/PVE::QemuServer
So that we can move the whole class to package pve-guest-common.
2017-06-12 05:59:51 +02:00
Dietmar Maurer
b9da11aa2b PVE::Replication - pass guest_class to run_replication
So that we can (re)use methods from PVE::AbstractConfig.
2017-06-12 05:59:51 +02:00
Dominik Csapak
d30ab14062 fix wrong variable syntax
{$PACKAGE} expands to '{ACKAGE}', meaning we shipped a dir:
/usr/share/doc/{ACKAGE}/examples

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2017-06-09 14:00:21 +02:00
Wolfgang Bumiller
72741c0b94 tests: override GuestHelper's lockdir
Otherwise the user running the tests may either create (and
end up being the ownderof) the system wide
/var/lock/pve-manager/* files, or the tests will fail (or
loop endlessly) if the user doesn't have access to them.
2017-06-09 12:06:30 +02:00
Dietmar Maurer
f842e812e0 replication: add replication log files 2017-06-07 17:27:00 +02:00
Dietmar Maurer
91ee6a2fec replication: improve stale volume detection, allow sync from parent snapshot
We pass a list of storage to scan for stale volumes to prepare_local_job().
So we make sure that we only activate/scan related storages.

Snapshot rollback may remove local replication shapshots. In that case
we still have the $conf->{parent} snapshot on both sides, so we
can use that as base snapshot.
2017-06-07 17:26:56 +02:00
Dietmar Maurer
356fbf797f replication: save list of used storage IDs 2017-06-07 11:30:52 +02:00
Dietmar Maurer
9b24b5d4ed use new PVE::ReplicationState::replication_snapshot_name() 2017-06-07 09:40:08 +02:00
Dietmar Maurer
e137f69fd8 replication: add last_node to replication state
So that we know which node produced the state. This is not always
the local node, because we copy the state on migrate.
2017-06-06 06:49:05 +02:00
Dietmar Maurer
c364b61f8e PVE::Replication - do not pass time to logfunc
This is simply not neccessary.
2017-06-06 06:36:03 +02:00
Dietmar Maurer
d255af0128 PVE::Replication - use new PVE::ReplicationState class 2017-06-02 12:28:43 +02:00
Wolfgang Bumiller
dc213d136f replication: use a dedicated lock file
Otherwise $update_job_state's file_set_contents() call
drops our lock.
2017-06-02 06:10:55 +02:00
Dietmar Maurer
c4ca87e508 make check: run replication_test6.pl 2017-05-31 15:29:53 +02:00
Dietmar Maurer
495aa710f2 replication - allow removal of jobs with target on local node 2017-05-31 13:54:40 +02:00
Dietmar Maurer
20f5ac242c replication_test5.pl: add test for job removal 2017-05-31 08:23:47 +02:00
Dietmar Maurer
3c54bc912b PVE::API2Tools::resolve_proxyto - new helper
Call proxyto_callback if that method is defined.
2017-05-31 08:23:47 +02:00
Dietmar Maurer
39c41c9dc5 ReplicationTestEnv.pm: avoid warning about undefined value 2017-05-31 08:23:47 +02:00