Commit Graph

4631 Commits

Author SHA1 Message Date
Thomas Lamprecht
cc95254ea1 node config: allow - in config property keys
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-11-26 13:27:30 +01:00
Thomas Lamprecht
f5ad0c97f7 followup: be slightly more verbose on error or renew
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-11-26 13:23:45 +01:00
Dominik Csapak
784a50cca0 renew pve-ssl.pem when it nearly expires
but only if the cert is issued by the ca in /etc/pve/pve-root-ca.pem
(by checking the issuer and openssl verify)

this way we can reduce the lifetime of the certs without having
to worry that they ran out

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2019-11-26 13:13:04 +01:00
Thomas Lamprecht
6159470e4d api: network reload: more granular OVS change check
Just because OVS is installed it doesn't mean that OVS interface
(changes) are configured - so check for that.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-11-26 11:43:43 +01:00
Dominik Csapak
009d20a811 gui: node network: enable apply config button
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2019-11-26 10:13:12 +01:00
Thomas Lamprecht
e86024b727 allow to set 'migrate' shutdown policy in datacenter options
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-11-25 19:54:44 +01:00
Thomas Lamprecht
ba3c982ed0 ui: lxc: switch reboot and stop button to match VMs
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-11-25 06:40:50 +01:00
Thomas Lamprecht
52bdf49f20 ceph tools: adapt version to accept -pveX too
this is a precautional measure

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-11-23 17:59:17 +01:00
Dominik Csapak
29a6f85885 fix #2462: ACMEAccount: make tos in get_tos optional
the code returns undef in case there is no 'tos', and the code
calling this api call handles a non-existing tos already, but
fails in that case becasue of the failing return value verification

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2019-11-22 12:19:27 +01:00
Thomas Lamprecht
70830683ad bump version to 6.0-15
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-11-21 15:16:33 +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
Thomas Lamprecht
6fba05b2b6 api/ceph: skip merging metadata if hostname is undefined
It's a bit hard to figure out the exact constellation required for
this to happen, but we saw it in live systems when one node was dead
in a three node cluster.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-11-21 10:57:50 +01:00
Thomas Lamprecht
ae253364d5 ceph/api: cleanup comment on extra line
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-11-21 10:57:21 +01:00
Thomas Lamprecht
6a38955e18 bump version to 6.0-14
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-11-20 20:46:21 +01:00
Thomas Lamprecht
176a62d392 followup: vm QGA type: handle a explicit set virtio type
as else we'd show "Unknown" if one set the type explicitly to
"virtio", either over API/CLI or editing the configuration directly

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-11-20 20:45:30 +01:00
Matt Dunwoodie
5a6c563c06 Add 'type' option to AgentFeatureSelector
This adds an extra field to the AgentFeatureSelector that reflects the
change in qemu-server.

Changes since previous version:

 * Use map rather than if/else if/else for type display string.
 * Use Proxmox.Utils.unknownText for unknown type (should not occur with
   regular use).
 * Keep existing fields as boxLabel rather than fieldLabel, as they
   look crammed with fieldLabel.
 * Use __default__ for default option, to save space and replicate
   behaviour in other places.
 * Store option in advancedItems as it is a special case.

Even though the map only contains one item, it will be easily added to
in the future. There is only one item as there is no need to have a
string for "virtio" as it is not displayed because of __default__.

Signed-off-by: Matt Dunwoodie <ncon@noconroy.net>
2019-11-20 20:45:30 +01:00
Oguz Bektas
6aee12f1fc lxc: add reboot button
to right-click menu and dropdown menu

Signed-off-by: Oguz Bektas <o.bektas@proxmox.com>
2019-11-20 20:28:53 +01:00
Oguz Bektas
2f13fde351 lxc: refactor stop button
move stopBtn into shutdownBtn as a menu item.

we can remove the setDisabled() call for stopBtn near the end, since when
shutdownBtn is disabled, so is stopBtn.

Signed-off-by: Oguz Bektas <o.bektas@proxmox.com>
2019-11-20 20:28:53 +01:00
Thomas Lamprecht
1ff3fef0b0 fix #844: allow to pre-delay start-all-marked guests on boot
Add a simple ExecStartPre command which reads the local node config,
and if a delay is set the helper sleeps that long then exists.

The systemd-unit approach was chosen as this ensures that we really
only delay when doing the startall on node boot. The pve-guests
service does not allows manual stops, starts or restarts, it can only
be pulled in by the multi-user.target

Mark this command with "-" to tell systemd that errors of it should
not cause an abort, it's a best-effort approach.

The journal from a 2 second delay would look like:
> Nov 19 13:13:48 dev6 systemd[1]: Starting PVE guests...
> Nov 19 13:13:48 dev6 pve-startall-delay[2318]: Delaying on-boot 'startall' command for 2 second(s).
> ...
> Nov 19 13:13:50 dev6 pve-guests[2339]: <root@pam> starting task UPID:dev6:00000924:00000529:5DD3DC7E:startall::root@pam:

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-11-20 20:20:58 +01:00
Dominik Csapak
f36240c507 gui: pci passthrough: consider domain in PCISelector
but remove the default domain '0000' before sending to the backend,
and add it if no domain is given in the config

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2019-11-20 19:43:31 +01:00
Thomas Lamprecht
4b527db9e5 d/control: bump version dependency to qemu-server
for mon_cmd refactoring

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-11-20 19:43:31 +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
cd3b6b0177 allow to run some tests in parallel
the replication test are not yet ready for that, but the others can
be run in parallel

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-11-19 15:02:50 +01:00
Thomas Lamprecht
f1ea8ca4f1 followup: cleanup/refactor mail test
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-11-19 15:02:50 +01:00
Dominic Jäger
ce84a9506d Fix #352: Limit the length of backup logs for mails
When creating a backup the log part can make the mail too big to be
transferred. To ensure delivery, two measures are taken:
1. Always omit the status lines
2. Omit the whole log part if a mail becomes (too) big

Additionally, add a check for missing log files.

Co-developed-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Signed-off-by: Dominic Jäger <d.jaeger@proxmox.com>
2019-11-19 15:02:50 +01:00
Thomas Lamprecht
1b025c2fa0 api: node/config: allow to return only a specific config property
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-11-19 12:04:52 +01:00
Thomas Lamprecht
db2ce4886c status/graphite: fix memory leak, avoid cyclic closure reference
The data passed to this closure was never free'd, depending on the
count of VM/CTs one could get >1 MB of RSS (!) memory leaked per
statd status cycle update run...

We could also use Scalar::Util's weaken, to weak a copy of this
variable, but as a simple undef works lets do that with a comment..

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-11-19 09:11:47 +01:00
Thomas Lamprecht
1e4ae7d44c fixup: graphite: use correct variable in closure
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-11-19 09:10:54 +01:00
Thomas Lamprecht
e35f1d37d7 Ext. Metrics: module global variable does not help with memory leak
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-11-18 19:15:13 +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
83cab72f62 bump version to 6.0-12
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-11-18 12:25:35 +01:00
Fabian Grünbichler
0721bc786c d/control: bump versioned b-d on libpve-guest-common-perl
otherwise the replication tests fail to load datacenter.cfg

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2019-11-18 12:25:35 +01:00
Fabian Grünbichler
82afbfdd2c d/control: add (build-)depends on libpve-cluster-api-perl
it contains PVE::API2::ClusterConfig

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2019-11-18 12:25:35 +01:00
Fabian Grünbichler
f02546f772 d/control: add (build-)depends on libpve-cluster-perl
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2019-11-18 12:25:35 +01:00
Fabian Grünbichler
33cd5dfefe test: also mock cfs_read_file
needed for tests to work without a functional running pmxcfs instance.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2019-11-18 12:25:35 +01:00
Fabian Grünbichler
57f110df07 pveproxy.service: take over pvecm call from pve-cluster.service
to ensure certificate/key is present prior to loading them.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2019-11-18 12:25:35 +01:00
Fabian Grünbichler
516a7948cd use PVE::RRD for RRD data
refactored from PVE::Cluster. same code, same semantics, different file.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2019-11-18 12:25:35 +01:00
Fabian Grünbichler
fe57e096cc test: mock PVE::SSHInfo module
since it is now used for getting a cluster node's migration IP address.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2019-11-18 12:25:35 +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
Fabian Grünbichler
0f9ac2dfc5 takeover CertCache from pve-cluster
same code, same semantics, different file/module

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
e1c6aaeb16 makefile: sort perlsources module list
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-11-16 16:10:24 +01:00
Thomas Lamprecht
df598da578 ui: ceph/Services: do some housekeeping
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-11-16 14:31:31 +01:00
Thomas Lamprecht
f4643f1782 bump version to 6.0-12
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-11-15 19:04:53 +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
3248590d53 api: ceph version: actually get full version
add and change the return signature for the wantarray case, which can
safely done as this is only used once (statd), and there only the
first elemen, the full version string, is used - so no breakage
potential there

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-11-15 18:35:39 +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