Commit Graph

124 Commits

Author SHA1 Message Date
Christoph Heiss
4845cca7e2 expose font-logos via API server and load in UI
Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
Reviewed-by: Dominik Csapak <d.csapak@proxmox.com>
Tested-by: Dominik Csapak <d.csapak@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-10-23 17:26:08 +02:00
Thomas Lamprecht
147d67c495 makefile: convert to use simple parenthesis
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-05-29 18:24:00 +02:00
Thomas Lamprecht
80cb7dda78 drop local hosted sencha-touch source, depend on libjs-sencha-touch
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-05-28 18:37:59 +02:00
Thomas Lamprecht
8829bad31f pveproxy: sort base dir mappings
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-05-28 18:25:34 +02:00
Thomas Lamprecht
6219f6c898 pveproxy: fix detecting mobile if enforced
Fixes: f16342f37 ("proxy: cleanup getting index method")
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-05-28 18:25:24 +02:00
Thomas Lamprecht
f16342f37e proxy: cleanup getting index method
- improve variable definition/use locality
- avoid some if's for some (mostly boolean) assignments, just use an
  expression

As long as we don't go overboard with code golfing it to extremely
terse, shorter code is always more readable, especially if
definition/use happens not dozens of lines apart.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-04-22 09:47:30 +02:00
Thomas Lamprecht
919cfa29e1 proxy: sort directory registration calls
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-04-18 08:21:28 +02:00
Thomas Lamprecht
bc9172758c proxy: group and sort use statements
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-04-18 08:20:51 +02:00
Stefan Sterz
28a93d3ed1 pveproxy/template: switch to using the "auto" theme per default
the auto theme uses media queries to detect a users preferred theme,
switch to using it per default instead of the light theme.

Signed-off-by: Stefan Sterz <s.sterz@proxmox.com>
2023-03-14 15:11:42 +01:00
Stefan Sterz
5137b16fd2 pveproxy/template: add support for switching themes
load the dark theme only if requested through a cookie, also adds
support for the "auto" theme that uses the dark theme based on a
media query.

this requires a bump of the widget toolkit so the dark-theme css file
is available.

Signed-off-by: Stefan Sterz <s.sterz@proxmox.com>
2023-03-08 17:55:41 +01:00
Fiona Ebner
7060a39316 cluster resources: add cgroup-mode to node properties
so the frontend has the information readily available.

Suggested-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
2022-11-15 14:08:55 +01:00
Fiona Ebner
955912c54e pvestatd: broadcast static node information
Planned to be used for static resource scheduling in the HA manager.

It's enough to broadcast the values whenever they are outdated or not
set in the node's local kv store, because pmxcfs will re-broadcast the
local kv store whenever the quorate partition changes. This is already
relied upon for the 'ceph-versions' kv pair.

Suggested-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
2022-11-15 14:07:56 +01:00
Fabian Grünbichler
d017de1f91 subscription: switch to Proxmox::RS::Subscription
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2022-09-06 11:02:59 +02:00
Dominik Csapak
c61c192e17 fix #4026: add 'repeat-missed' option for jobs
like systemd-timers 'persistent'. so that the user can configure it to not be
run after powering up when it was previously missed

this reverses the default behaviour to not run missed jobs after pvescheduler
was started, since most of the time that's not the desired behaviour

since we don't use it for updated schedules anymore, rename
'updated_job_schedule' to 'update_last_runtime'

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Reviewed-by: Fabian Ebner <f.ebner@proxmox.com>
2022-06-17 17:21:56 +02:00
Thomas Lamprecht
7658f01078 minor code style clenaup and comment wording
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2022-05-28 09:12:21 +02:00
Fabian Grünbichler
ed59fcff47 fix #3789: pass disable TLS 1.2/1.3 options
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2022-01-13 13:42:58 +01:00
Fabian Grünbichler
64672c2803 fix #3745: handle overridden TLS key location
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2022-01-13 13:42:58 +01:00
Fabian Grünbichler
ff65c92931 fix #3790: pass TLS 1.3 ciphersuites if set
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2022-01-13 13:42:58 +01:00
Thomas Lamprecht
7de8b7301c pvescheduler: use private sub instead of code-ref
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-11-23 08:59:49 +01:00
Thomas Lamprecht
9c1943935c pvescheduler: fix potential stall on full shutdown
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-11-23 08:59:18 +01:00
Thomas Lamprecht
d4eb0c1993 pvescheduler: record some todos and small cleanup
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-11-22 20:25:34 +01:00
Thomas Lamprecht
427a5cb429 pvescheduler: make jobs tracking more flexible, rework stop
Avoid hard-coding the current implication of the replication stack to
not get started again until the old worker is done..

We still apply the same check, but changing that to let the jobs have
control is rather easy now.

Also rework the stop logic, send terminate to _all_ workers and make
the timeout a actual shared one (not first gets all, remaining get
kill) and send a kill to the stuck, leftover ones in one go at the
end, including some logging so that the admin can actually know about
this non-ideal situation.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-11-22 20:15:30 +01:00
Thomas Lamprecht
7d546fb5fd pvescheduler: do not delay restart artifically
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-11-22 20:14:40 +01:00
Dominik Csapak
983ad9b91b pvescheduler: implement graceful reloading
utilize PVE::Daemons 'hup' functionality to reload gracefully.

Leaves the children running (if any) and give them to the new instance
via ENV variables. After loading, check if they are still around

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2021-11-22 17:19:12 +01:00
Dominik Csapak
4af87395e9 pvescheduler: reworking child pid tracking
previously, systemd timers were responsible for running replication jobs.
those timers would not restart if the previous one is still running.

though trying again while it is running does no harm really, it spams
the log with errors about not being able to acquire the correct lock

to fix this, we rework the handling of child processes such that we only
start one per loop if there is currently none running. for that,
introduce the types of forks we do and allow one child process per type
(for now, we have 'jobs' and 'replication' as types)

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2021-11-22 17:19:12 +01:00
Dominik Csapak
b8981dbd60 pvescheduler: catch errors in forked childs
if '$sub' dies, the error handler of PVE::Daemon triggers, which
initiates a shutdown of the child, resulting in confusing error logs
(e.g. 'got shutdown request, signal running jobs to stop')

instead, run it under 'eval' and print the error to the sylog instead

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2021-11-22 17:19:12 +01:00
Thomas Lamprecht
727673eb4f jobs: code/style cleanups
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-11-15 16:12:42 +01:00
Fabian Ebner
db101be037 pvescheduler: simplify code for sleep time calculation
Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2021-11-11 21:04:34 +01:00
Wolfgang Bumiller
6b2028cb73 depend on and use libjs-qrcodejs
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-11-11 08:37:31 +01:00
Wolfgang Bumiller
a6a681b950 pvestatd: broadcast version info
broadcast the built-in, statically available version info, e.g.:
{
   "release" : "7.0",
   "repoid" : "3ce05d40",
   "version" : "7.0-14"
}

We can expand this by more actual package version info in the future,
but that certainly needs more elaborate update control mechanisms as
the oneshot at boot we have now.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-11-10 21:44:32 +01:00
Dominik Csapak
fa7d54564a pvescheduler: run jobs from jobs.cfg
PVE/Jobs is responsible to decide if the job must run (e.g. with a
schedule)

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2021-11-10 16:11:00 +01:00
Thomas Lamprecht
6385fb8183 replace systemd timer with pvescheduler daemon
The whole thing is already prepared for this, the systemd timer was
just a fixed periodic timer with a frequency of one minute. And we
just introduced it as the assumption was made that less memory usage
would be generated with this approach, AFAIK.

But logging 4+ lines just about that the timer was started, even if
it does nothing, and that 24/7 is not to cheap and a bit annoying.

So in a first step add a simple daemon, which forks of a child for
running jobs once a minute.
This could be made still a bit more intelligent, i.e., look if we
have jobs tor run before forking - as forking is not the cheapest
syscall. Further, we could adapt the sleep interval to the next time
we actually need to run a job (and sending a SIGUSR to the daemon if
a job interval changes such, that this interval got narrower)

We try to sync running on minute-change boundaries at start, this
emulates systemd.timer behaviour, we had until now. Also user can
configure jobs on minute precision, so they probably expect that
those also start really close to a minute change event.
Could be adapted to resync during running, to factor in time drift.
But, as long as enough cpu cycles are available we run in correct
monotonic intervalls, so this isn't a must, IMO.

Another improvement could be locking a bit more fine grained, i.e.
not on a per-all-local-job-runs basis, but per-job (per-guest?)
basis, which would improve temporary starvement  of small
high-periodic jobs through big, less peridoci jobs.
We argued that it's the user fault if such situations arise, but they
can evolve over time without noticing, especially in compolexer
setups.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2021-11-10 16:11:00 +01:00
Thomas Lamprecht
e8c41dc561 statd: rebalance_lxc_containers: use grep instead of for+next-if
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-10-20 17:01:48 +02:00
Thomas Lamprecht
b707257a16 statd: rebalance_lxc_containers: code bload reduction
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-10-20 16:47:06 +02:00
Oguz Bektas
911a8e4f48 pvestatd: fix rebalancing cpusets for cgroupv2
currently we only check the entry for cgroup v1 to decide if cores
should be rebalanced. extend the check to include cgroup v2 entries.

reported in forum [0]

[0]: https://forum.proxmox.com/threads/hard-set-streams-for-lxc-container.97768/

Signed-off-by: Oguz Bektas <o.bektas@proxmox.com>
Tested-By: Aaron Lauterer <a.lauterer@proxmox.com>
2021-10-20 16:47:06 +02:00
Stoiko Ivanov
36ad2b3c0e proxy: fix wildcard address use
This patch fixes a regression for hosts disabling ipv6 via kernel
commandline ('ipv6.disable=1')introduced in commit
e224b7d2e6
(disabling IPv6 via sysctl did not exhibit these problems)

by hardcoding the address to '::', pveproxy and spiceproxy failed to
start with:
'unable to create socket - Address family not supported by protocol'

This patch depends on the commit in pve-common, which tries first
binding to '::' and then falling back to '0.0.0.0', and needs a
versioned dependency bump on libpve-common-perl.

With this patch the listening addresses are (`ss -tlnp |grep 8006` output)
* ipv6 disabled via kernel cmdline: '0.0.0.0:8006'
* sysctl net.ipv6.conf.all.disable_ipv6=1: '*:8006'
* sysctl net.ipv6.bindv6only=1: '[::]:8006'
* else: '*:8006'

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
2021-05-07 18:15:43 +02:00
Oguz Bektas
e224b7d2e6 fix #417: proxy: allow settnig LISTEN_IP for pveproxy and spiceproxy
The $host variable is set to "::0" by default to listen on wildcard
(with 'Domain' => PF_INET6).

If 'LISTEN_IP' is defined in /etc/default/pveproxy, that IP will be used
instead.

Signed-off-by: Oguz Bektas <o.bektas@proxmox.com>
2021-04-23 17:13:45 +02:00
Dominik Csapak
ce251651a4 pvestatd: fix container cpuset scheduling
Since pve-container commit

c48a25452dccca37b3915e49b7618f6880aeafb1

the code to get the cpuset controller path lives in pve-commons PVE::CGroup.
Use that and improve the logging in case some error happens in the future.
Such an error will only be logged once per pvestatd run,
so it does not spam the log.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2020-12-03 16:33:50 +01:00
Wolfgang Bumiller
eacb5482e5 pvestatd: cgroupv2 support
This uses the newly introduced PVE::LXC::CGroup's
cpuset_controller_path() method to find the controller path,
so we need to depend on the newer pve-container package.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2020-04-04 20:19:02 +02:00
Dominik Csapak
0496138e44 ceph: factor out get/broadcast ceph versions to ceph::services
which also removes some dead code
(the my $local_last_version variable was never used)

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2020-04-01 17:15:41 +02:00
Fabian Grünbichler
9a5a1655f1 pveproxy: use new cookie extraction method
we only care about the regular cookie case for the index.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2020-01-29 10:27:06 +01:00
Stefan Reiter
00b58c8c35 Broadcast supported CPU flags
pvestatd will check if the KVM version has changed using
kvm_user_version (which automatically clears its cache if QEMU/KVM
updates), and if it has, query supported CPU flags and broadcast them as
key-value pairs to the cluster.

If detection fails, we clear the kv-store and set up a delay (120s), to not
try again too quickly.

Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
2020-01-14 11:59:48 +01:00
Alexandre Derumier
7405805780 pvestatd: fix require PVE::Network::SDN
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2019-11-26 17:08:23 +01:00
Stefan Reiter
e2509f4e37 Fix #2476: Fix auto-ballooning QMP command
Commit 0dd73a7fec (statd: refactor update_node_status) changed $target
in pvestatd's auto_balloning sub into a variable:

    my $target = int($res->{$vmid});

but then uses it in a string as a parameter to the $log function:

    $log->("BALLOON $vmid to $target (%d)\n", $target - $current);

This surprisingly causes the variable to be incorrectly converted into a
JSON string by perl's to_json (called in QMPClient after mon_cmd):

    {"value":"1234"}

instead of

    {"value":1234}

which causes QEMU to report the parameter as invalid:

    "Invalid parameter type for 'value', expected: integer"

This behaviour is made even trickier, since $target internally is still
considered more of an 'int' (although that's a weak claim in perl
anyway), showing up without quotes in Dumper et. al. - but the perldoc
for to_json scheds some light:

    simple scalars
        Simple Perl scalars (any scalar that is not a reference) are the
        most difficult objects to encode: this module will encode undefined
        scalars as JSON "null" values, scalars that have last been used in a
        string context before encoding as JSON strings, and anything else as
        number value

So coerce to_json to treat $target as an integer by using it as one and
everything is fine again.

Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
2019-11-21 14:23:58 +01:00
Stefan Reiter
7a108020b3 refactor: vm_mon_cmd is now Monitor::mon_cmd
Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
2019-11-20 18:25:49 +01:00
Thomas Lamprecht
2112d31092 statd: increase RSS difference required for restart
it seems that we have a reference leak or the like somewhere in the
(graphite?) status plugin, while the recent transaction based update
mechanism made it slightly better, it's still bad with a lot of VMs..

Until we can track that down, or abandon perl for good, avoid to
frequent restarts by allowing statd to grow 15 MB of memory usage
after initial calibration (it's memory usage at the 10th cycle)

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-11-18 19:07:24 +01:00
Thomas Lamprecht
cc3d280b98 statd: report memory usage in KB
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-11-18 19:04:29 +01:00
Thomas Lamprecht
87be2c19e3 ext. metric: move to a transaction model
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-11-18 19:04:29 +01:00
Fabian Grünbichler
3ac3653e63 use PVE::DataCenterConfig
to make sure that the corresponding cfs_read_file works() works.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2019-11-18 12:25:35 +01:00
Thomas Lamprecht
f1f4bfefc7 move common metric server management part to own module
For now it only handles the plugin registration and the two recently
integrated helpers.
But, this is a prepartation to move the external metrics server
update mechanic from a stateless always-newly-connect-send-disconnect
to a statefull transaction based mechanis; see later patches

keep the PVE::Status::Plugin use in pvestatd, as we read the cfs
hosted status.cfg there, and the parser is defined by the common
status plugin base module.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-11-16 16:19:42 +01:00