Commit Graph

285 Commits

Author SHA1 Message Date
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
Dietmar Maurer
df16be460c bin/test/Makefile: run all replication tests 2017-05-31 08:23:47 +02:00
Dietmar Maurer
7f6ff9dd39 PVE::Replication::replicate - implement replicate
The actual volume replication is done in replicate_volume(), which is just
a stub for now.

I also added a regression test replication_test5.pl to verify basic
functions.
2017-05-31 08:23:47 +02:00
Dietmar Maurer
331025d954 ReplicationTestEnv.pm: mock get_ssh_info and ssh_info_to_command 2017-05-31 08:23:47 +02:00
Dietmar Maurer
4550bb78c3 ReplicationTestEnv.pm: mock storage content methods 2017-05-31 08:23:46 +02:00
Dietmar Maurer
f70997ea80 pvesr run: add --verbose flag
We can now pass a $logfunc parameter to replicate() to
produce more verbose logs/output. This is especially useful
for regression testing.
2017-05-31 08:23:46 +02:00
Dietmar Maurer
6e572d46ef replication_test4.pl: Test replication job failure 2017-05-31 08:23:46 +02:00
Dietmar Maurer
c5014e65b2 ReplicationTestEnv.pm: add job tracking log
To generate persistent logs with job state/config changes.
2017-05-31 08:23:46 +02:00
Dietmar Maurer
6269a49c64 replication_test3.pl: regression test for replication to same node 2017-05-31 08:23:46 +02:00
Dietmar Maurer
816c01f85b replication_test2.pl: test replication scheduler 2017-05-31 08:23:46 +02:00
Dietmar Maurer
d0920c29e6 add regression test environment for replication 2017-05-31 08:23:46 +02:00
Dietmar Maurer
892821fd87 pvesr: add pve storage replication tool
Just added code to configure jobs. Replication itself is not
implemented.
2017-05-31 08:23:46 +02:00
Wolfgang Link
c6723ee58b Make a new systemd target.
This will ensure all storages are up before pveproxy is running.
2017-05-03 11:50:53 +02:00
Fabian Grünbichler
2bde88fb3f fix ceph.service for Ceph Jewel >= 10.2.6
having our ceph.service pulled in by ceph.target does not
work anymore, because "systemctl start ceph.target" hangs
forever on ceph-common upgrades. multi-user.target seems to
work as well, and we are ordered after pve-cluster anyway.

only replace the old ceph.service if it is an exact match.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2017-03-13 14:20:14 +01:00
Wolfgang Bumiller
16a264ce0c remove space in service file 2017-03-13 14:18:21 +01:00
Thomas Lamprecht
3a2402368f pveperf: remove outated POD replaced by pve-docs
Remove the POD content and the overwriting makefile rule
'pveperf.1.pod' so that the rule from pve-doc-generator.mk matches

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2017-02-15 11:10:27 +01:00
Wolfgang Bumiller
804e97f9ec spiceproxy: import PVE::SafeSyslog 2017-01-26 12:59:57 +01:00
Dietmar Maurer
be613dfcbc bin/Makefile: export PERLLIB=.. so that doc generator works correctly
Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
2017-01-12 11:53:19 +01:00