Commit Graph

89 Commits

Author SHA1 Message Date
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
Thomas Lamprecht
1aaca6fde7 api: ceph/metadata: add structured node versions
include the version as string and as parts, as we do the split
already. Also include the build commit, so if we re-release a ceph
version, we can differ here too.

Use node as key, to make the new entry a bit more general, could be
easily expanded with other infos, if required.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-11-15 18:36:37 +01:00
Thomas Lamprecht
2a8e514947 statd: adapt ceph update error message
"getting ceph services" sound a bit vague, like the download of those
failed, or the like..

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-11-15 11:33:47 +01:00
Thomas Lamprecht
a6dff455f6 statd: refactor out updating ceph metadata
makes no sense to do half in line and half in a extra update_method

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-11-15 11:30:14 +01:00
Thomas Lamprecht
5e82aaac89 status plugins: add update_all and foreach_plug helper
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-11-14 19:24:24 +01:00
Thomas Lamprecht
b25f645957 remove some useless empty lines
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-11-13 17:05:44 +01:00
Thomas Lamprecht
0dd73a7fec statd: refactor update_node_status
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-11-13 08:42:00 +01:00
Thomas Lamprecht
7887310045 statd: cleanup update_node_status
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-11-13 08:40:13 +01:00
Alexandre Derumier
a36565ba37 pvestatd : broadcast sdn transportzone status
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2019-09-03 10:28:55 +02:00
Dominik Csapak
cc8c253f23 add the css/images from proxmox widget toolkit
add the dirs to the proxy and the css file to the index template

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2019-08-13 15:38:39 +02:00
Thomas Lamprecht
c195a3c2d6 pveproxy: allow to request debug sources directly over GET parameter
Avoids the need to stop the current pveproxy and restart it in debug
mode, if one wants to get the debug un-minified sources for ExtJS,
for example.

For a local PVE instance the following URL would ensure you load the
debug sources:
https://localhost:8006/?debug#v1:0:18:4:25:19::8:20:28

For convenience allow to omit the parameters value, and default to
true, iow, ?debug and ?debug=1 are the same, one could force it off -
even if the server was started in debug mode - by using ?debug=0

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-07-09 15:07:41 +02:00
Dominik Csapak
4e76dbd7b3 ceph: refactor broadcast_ceph_services and get_cluster_service
and use the broadcast when a service is added/removed
we will use 'get_cluster_service' in the future when we generate a list
of services of a specific type

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2019-06-04 14:56:24 +02:00
Thomas Lamprecht
a78fd21f7f followup code cleanup for: broadcast ceph service data to cluster
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-05-27 15:52:12 +02:00
Dominik Csapak
fea391967a broadcast ceph service data to cluster
so that we have a list of all existing ceph services in the cluster

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2019-05-27 15:52:12 +02:00
Thomas Lamprecht
180a86d39a pvecfg: adapt version and release semantic
Wit commit a74ba607d4 we switched over
to using the dpkg-dev provided helpers to set package version,
architecture and such in the buildsystem.

But unlike other repositories we used the version also for giving it
back over the API through the during build generated PVE::pvecfg
module, which wasn't fully updated to the new style.

This patch does that, and also cleans up semantics a bit, the
following two changed:

release is now the Debian release, instead of the "package release"
(i.e., the -X part of a full package version).
version is now simply the full (pve-manager) version, e.g., 6.0-1 or
the currently for testing used 6.0-0+1

This allows to do everything we used this information for even in a
slightly easier way (no  string concat needed anymore), and fits also
with the terminology we often used in our public channels (mailing
lists, forum, website)

Remove some cruft as we touch things.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-05-26 16:11:43 +02:00
Fabian Grünbichler
5ea29d1398 pvestatd: rotate auth keys if necessary
as a fallback to ensure rotation even if no logins happen on a given
cluster.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2019-03-18 12:23:53 +01:00
Stoiko Ivanov
a642f8a01b pveproxy, spiceproxy: new read_proxy_conf location
read_proxy_conf was moved to the new PVE::ApiServer::Utils so that it
can be reused by other apiservers (e.g., PMG one). Use that one, so
that we can remove it here later

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-02-26 07:32:22 +01:00
Stoiko Ivanov
9503511809 remove default values from pveproxy ssl config
they are in PVE::APIServer::AnyEvent

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
2019-02-26 07:32:22 +01:00
Stoiko Ivanov
f0ea5afcd7 pveproxy: honor_cipher_order by default
change the default from client preference to server preference, but leave it
configurable.

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
2019-02-20 07:15:38 +01:00
Stoiko Ivanov
a33abad12d pveproxy: add configurable COMPRESSION
disabling http compression is considered good practice and certain TLS-testing
scripts/sites lower the security rating if it's enabled.

compression is still on by default for the potential speed/performance gain.

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
2019-02-20 07:15:38 +01:00
Stoiko Ivanov
1f7809624b pveproxy: add configurable HONOR_CIPHER_ORDER
fix #2069 (the report includes rationale and also information on test-cases).

Tested by:
* running testssl.sh [0]
* enabling this setting (our default cipherlist prefers AES256,
  chromium on stretch AES128)

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
2019-02-20 07:15:38 +01:00
Stoiko Ivanov
bbb0c700bd fix typo in comment (ssl-config)
Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
2019-02-19 17:17:17 +01:00
Rhonda D'Vine
5878f07454 Update default CIPHERS to a more current list
The default CIPHERS allowed for a fair amount of not really considered
secure anymore connections.  This updated cipher list is taken from
mozilla: https://wiki.mozilla.org/Security/Server_Side_TLS

Signed-off-by: Rhonda D'Vine <rhonda@proxmox.com>
2018-10-17 07:56:32 +02:00
Dominik Csapak
f4aa76c549 fix #1393: use language from datacenter.cfg for gui
if we do not have a language cookie, try to read
the language from the datacenter.cfg and fall back to 'en'

also set it into the 'Proxmox' object, so that the gui can show it
in the LoginWindow

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2018-08-17 11:01:44 +02:00
Thomas Lamprecht
b2682f33ce pveproxy: add link to extjs for api-viewer
allows us to remove the external loading of extjs from the cloudflare
cdn in pve-docs easier with having the external hosted version in
mind.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2018-07-27 11:09:21 +02:00
Dominik Csapak
411967db91 use pve-i18n package
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2018-01-25 13:36:37 +01:00
Dominik Csapak
f90908cb16 add proxmox-widget-toolkit to pve gui
we will use components from proxmox-widget-toolkit rather than
directly from pve-manager

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Reviewed-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2018-01-23 10:15:09 +01:00
Dominik Csapak
03f09f9ab0 add xtermjs to pveproxy dirs
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2017-12-12 08:34:07 +01:00
Dominik Csapak
54165ad3ce add ver get parameter for js/css files to improve cache behaviour
we do not set an Expire header for our js files, and certain browsers
do not even make the request then (on which we would answer
with a correct 304 not modified)

so to force the browser to load a new version of the gui when we change
something, we add the package version as a get parameter

when doing this, the browsers still cache the file, until the get
parameter changes, which is exactly what we want

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Reviewed-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2017-11-07 08:55:02 +01:00
Dominik Csapak
1faeea016b do not use PVE::API2 in spiceproxy.pm
we do not need it there and withouth this we save ~30MB memory for
this daemon and its workers

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2017-11-07 08:51:15 +01:00
Dominik Csapak
7f3b89a012 change to debian font-awesome
instead of having font-awesome copied into the repository,
depend on the debian package 'fonts-font-awesome', which provides all we
need

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2017-06-12 10:26:29 +02:00
Fabian Grünbichler
0fcced161f use physical NIC regexp
because in >= Stretch, most systems don't have ethX devices any more.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2017-06-08 15:00:59 +02:00
Wolfgang Bumiller
127470f417 statd: rebalance: don't use CpuSet::max_cpuids
We're already limiting CPUs to lxc/cpuset.effective_cpus,
so let's use the highest cpuid from that set as a maximum to
initialize the container count array.
2017-04-20 12:18:55 +02:00
Dietmar Maurer
507869563a use 'U' to encode undefined values for RRD graphs
rrdtools 1.5 and newer seems to require this.
2017-03-17 11:27:18 +01:00
Dietmar Maurer
9af88cbb9a pveproxy: do not serve /usr/share/vncterm - no longer required
Note: We removed the java applet
2017-03-14 07:21:09 +01:00
Dominik Csapak
184825e190 use Template::Toolkit instead of [ExtJs|Touch|NoVnc]Index.pm
this makes it easier to change the html if needed and seperates
it from the perl code

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2017-03-09 10:34:30 +01:00