879 Commits

Author SHA1 Message Date
Fabian Grünbichler
362fd3ca3d VZDump: handle timelocal year correctly
while this is unlikely to cause any problems, it is unnecessary to
substract 1900 here - timelocal handles 4-digit years perfectly well.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2018-03-07 11:36:31 +01:00
Dominik Csapak
f453b40319 Graphite.pm: fix whitespace
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2018-03-05 14:21:50 +01:00
Dominik Csapak
53b0885084 fix #1683: do not send non-numeric values to graphite
the graphite daemons which accept the data (carbon), only
accepts numeric values, and logs all invalid lines

since that were about 5 values per vm/ct this generated lot of noise
in the carbon log

so we check with a regex if a value is numeric, and
additionally we have a blacklist of keys which seem to be numeric but
are either boolean (e.g. template) or a state (e.g. pid)

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2018-03-05 14:21:50 +01:00
Fabian Grünbichler
49863189e7 pveversion: use AptPkg::Version, not Dpkg::Version
to avoid an extra dependency

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2018-02-16 15:06:28 +01:00
Fabian Grünbichler
c2931e3a3e pveversion: sort kernel packages by version
instead of lexically by package name

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
Reviewed-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2018-02-16 11:17:00 +01:00
Thomas Lamprecht
759e598cef APT API: versions: add new pve packages
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2018-02-15 10:49:47 +01:00
Thomas Lamprecht
e8e751663e APT API: versions: split up long line and refactor
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2018-02-15 10:49:47 +01:00
Dominik Csapak
c5628a2e7b add 'service' parameter to syslog api call
so that we can filter the journal by service

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Reviewed-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2018-01-25 13:36:37 +01:00
Dominik Csapak
e8c6a71f35 use pve-i18n package
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2018-01-25 13:36:37 +01:00
Dominik Csapak
fdf74e410b 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
6c3ea03d96 correct the upgradecmd for xtermjs
use the pveupgrade command directly without bash inbetween,
the incorrect quoting led to '--shell' not being passed to
pveupgrade and closing the connection

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Reviewed-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Tested-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2018-01-18 10:05:54 +01:00
Wolfgang Bumiller
c6f0412f7a cleanup
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2017-12-14 09:07:00 +01:00
Dominik Csapak
6b45e0505b remove (near)full status for storages
since this is not a good default, we do not want the user
to have to configure those limits for each storage, and
a warning triangle was confusing for multiple users,
we remove this again

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Acked-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2017-12-13 14:51:07 +01:00
Wolfgang Link
9fe22a12ba 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
Wolfgang Link
b7d6723b1c Indentation cleanup.
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
019ae4fe6a add xtermjs to pveproxy dirs
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2017-12-12 08:34:07 +01:00
Dominik Csapak
de9b5cd0aa add termproxy api call for nodes
and add dependency for pve-xtermjs

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2017-12-12 08:34:07 +01:00
Thomas Lamprecht
6b14e21186 api: nodes/subscription: implement reasonable access rights
Allow users which have Sys.Audit on a specific node to get the
subscription status and those with Sys.Modify to set and check
(update) it.

This mirrors the required permissions from other node specific
actions, e.g., APT (package management).

We always showed the Subscription Panel and all its elements in the
WebUI, so no need for change there.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2017-12-12 07:52:18 +01:00
Thomas Lamprecht
5da07e19fd Fix #1589: auth_handler: raise exception on init_request error
cfs_* methods cann now die (rightfully so) when the IPCC endpoint is
not connected, or another grave IPCC error arised.

As we did not catch those problems in the RPCEnvironments
init_request method, which loads the user config, this got
propagated to the anyevents auth_handler call in its
unshift_read_header method where then all errors where processed in
the same way => with an unauthorized response logging an logged in
user out.

So catch this error and raise an internal server errror exception
instead. Anyevent needs some minor modifiaction in a separate patch
to handle PVE::Exceptions correctly, so this is the partial fix for
bug #1589

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2017-12-11 14:53:18 +01:00
Fabian Grünbichler
ab59186163 pveceph: add missing use statement 2017-11-30 11:31:35 +01:00
Thomas Lamprecht
69feda64dc ceph: create mon: fix & improve check if IP is in public net
If a CIDR gets passed to Net::IP it is expected to not be from the
middle of  an subnet, i.e., 192.168.1.12/24 is *not* OK but
192.168.1.0/24 would be OK.

As the Network/interfaces files also accepts CIDR notation for the
'address' param (now also for IPv4) this let to problems in our node
monitor IP detection code, which used the interface file and Net::IP to
find any address from the ceph public network.

So change to our newer helper PVE::Network::get_local_ip_from_cidr to
get all configured and ready (=up) IPs from this network.

Also handle the case where multiple networks where returned, add a
parameter to allow specifying one of those and ask the user to do so.

If no public network is configured and no mon-address parameter was
passed, we fall back to the remote node IP of the node, as was done
previously. We expect that the user only overwrites the mon-address
if he knows what he do and omit checks here.
2017-11-28 16:46:31 +01:00
Thomas Lamprecht
62c8aab29f ceph: create pool: check for quorum at start
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2017-11-28 16:13:50 +01:00
Emmanuel Kasper
65a5984c01 Add each host SSL fingerprint to each node status
Signed-off-by: Emmanuel Kasper <e.kasper@proxmox.com>
Reviewed-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2017-11-28 16:13:50 +01:00
Thomas Lamprecht
31fcad7651 fix #1578: api/resource hastate: fallback to resource cfg state
With ignored or still queued services we have no hastate for a
service in the manager status available.

As we use hastate in the web UI to determine if a service is
configured for HA this could lead to confusion there.
For example, the VM/CT 'Manage HA' window thinks tries to add the
service again if its in the 'ignored' state, and then the backend
errors out because it is already configured.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2017-11-28 15:59:58 +01:00
Dominik Csapak
4d44cddb75 make ssh connection transparent
do not use an escape character for the host shell

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2017-11-17 10:37:31 +01:00
Dominik Csapak
bbac93738d remove unecessary semicolons
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2017-11-14 13:27:07 +01:00
Dominik Csapak
ae2bf8126c add default 'unknown' status for vms and containers
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2017-11-14 13:27:07 +01:00
Dominik Csapak
26f6f09c48 include a 'status' field for storages
by default it is unknown, if the storage is >= 60% full, it is
'nearfull', if it is >= 90% full, it is 'full'

if we have any other information, it is 'available'

we can use this information for the tree

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2017-11-14 13:27:07 +01:00
Dominik Csapak
71440a9457 add status to node stats
by default it is unknown,
if it is a standalone node its online
else it is either 'online' or 'offline' depending on the corosync status

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2017-11-14 13:27:07 +01:00
Dominik Csapak
84505fb832 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
cac372930a 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
Alwin Antreich
7f9a9a1613 Add %-used and min_size to "pveceph lspools" command
Signed-off-by: Alwin Antreich <a.antreich@proxmox.com>
2017-10-31 08:21:32 +01:00
Alwin Antreich
5bee4fcb01 Fix: #1542, use percent_used key instead of calculation
Signed-off-by: Alwin Antreich <a.antreich@proxmox.com>
2017-10-31 08:21:32 +01:00
Dominik Csapak
d7faccb044 make bluestore the default on the api
with this we also have to send '0' to from the frontend, when the
bluestore checkbox is not checked

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2017-10-20 12:01:41 +02:00
Fabian Grünbichler
fc8c3307bc ceph: disable OSD unit in destroyosd
while OSDs units should only be runtime enable and disappear on reboots,
this serves as an additional safeguard to ensure no leftover units can
exist.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2017-10-10 12:17:17 +02:00
Fabian Grünbichler
2995f3aec2 ceph: correctly parse 'pg dump' output
Reported-By: Waschbüsch IT-Services GmbH <service@waschbuesch.it>
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2017-10-10 12:16:43 +02:00
Dietmar Maurer
7e76bca9fd PVE/API2/Subscription.pm - use new PVE::Subcription class 2017-10-03 12:54:29 +02:00
Wolfgang Link
56e7fd9a47 Clean up unnecessary code.
The jobid is already parsed by the file parser.
2017-09-25 15:45:28 +02:00
Thomas Lamprecht
cd75e8b0d1 remove obsolete Posix use clause
besides the cleanup purpose this fixes an actual problem, perls POSIX
module has the following caveat:

`Everything is exported by default (with a handful of exceptions).
This is an unfortunate backwards compatibility feature and its use is
strongly discouraged. You should either prevent the exporting (by
saying "use POSIX ();", as usual) and then use fully qualified names
(e.g.  "POSIX::SEEK_END"), or give an explicit import list. If you do
neither and opt for the default (as in "use POSIX;"), you will import
hundreds and hundreds of symbols into your namespace.'

see `perldoc POSIX`

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2017-09-25 15:18:25 +02:00
Thomas Lamprecht
35f7dec5a3 use log method from base VZDump::Plugin
we copied our log method over there to resolve a cyclic dependency,
now use it here to reduce code duplication.
As we are below pve-guest-common in the dpendency hierachy we may use
it, but it does not may (or at least should) use us.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2017-09-22 09:34:09 +02:00
Thomas Lamprecht
893a8ca941 vzdump/pigz: use ProcFSTools for core count, not sysconf
A "sysconf(84)" is not really descripitve. There is no POSIX const
entry for _SC_NPROCESSORS_ONLN (number of processors online) as its
not standard but an adoption of glibc.
Better just use our proven ProcFSTool's cpuinfo method for getting
the desired information.

This is kept only for backwards compatibillity as we guaranteed that
we use #cpus/2 if 'pigz' is set to 1, else I would have removed this
alltogether and just directly passed 'pigz' to the command...

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2017-09-20 12:34:22 +02:00
Dominik Csapak
52b3ac0385 ceph: do not automatically use wal if only journal is given
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2017-09-07 12:35:14 +02:00
Fabian Grünbichler
6a230e9869 ceph/destroypool: move image check into worker
vdisk_list can potentially take very long, and we don't want
the API request to time out.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2017-09-07 11:38:20 +02:00
Fabian Grünbichler
fb0c40568d ceph: make create/destroypool API paths async
in order to get task log entries and easily accessible
task/error logs.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2017-09-07 11:38:20 +02:00
Fabian Grünbichler
729a222b31 ceph/destroypool: refactor to use get_storages
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2017-09-07 11:38:20 +02:00
Fabian Grünbichler
f155897d11 ceph/destroypool: optionally remove storages
only storages which don't have the 'monhost' option set are removed

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2017-09-07 11:38:20 +02:00
Fabian Grünbichler
6b4e48c917 ceph/createpool: optionally add storages
introduce new API parameter 'add_storages'. if set, one
storage each is configured using the created pool:
- for containers using KRBD
- for VMs using librbd

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2017-09-07 11:38:20 +02:00
Fabian Grünbichler
ba621054dc ceph: create/destroypool: shorten variable name
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2017-09-07 11:38:20 +02:00
Fabian Grünbichler
eacbbbe645 ceph: add get_storages helper
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2017-09-07 11:38:20 +02:00
Fabian Grünbichler
62f55bcf05 ceph: add add_storage helper
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2017-09-07 11:38:20 +02:00