Commit Graph

108 Commits

Author SHA1 Message Date
Dietmar Maurer
bed5fdfcc9 use new timestamp renderer for /nodes/<nodename>/time
Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
2018-07-11 11:27:13 +02:00
Dietmar Maurer
f57cbe5d0b PVE/API2/Nodes.pm: document return properties for cluster node list.
Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
2018-07-10 14:16:23 +02:00
Dominik Csapak
c6bb589141 startall: refactor and fix error message
for vms, it showed:
Starting VM 100 failed: status

instead of showing the actual status

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2018-06-27 10:52:10 +02:00
Dominik Csapak
3d0fcc467a correct node free calculation
avail - used is wrong
total - used = free

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2018-05-14 11:54:16 +02:00
Fabian Grünbichler
036475f89a add certificates API endpoints
to allow retrieval of certificate information, and uploading or removing
of custom certificate files.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2018-05-02 11:34:52 +02:00
Fabian Grünbichler
c4f78bb7c6 add node configuration file and API
this currently only contains a description and the node-specific ACME
configuration, but I am sure we can find other goodies to put there.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2018-05-02 11:34:52 +02:00
Dominik Csapak
341422727c 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
5b46e4322e 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
Dominik Csapak
4b168c2772 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
Emmanuel Kasper
16efab9e10 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
Dominik Csapak
cb1b1712c4 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
b8ac8b0cec allow width and height parameter for vncshell
so that novnc can request a different screen size

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2017-06-02 09:19:07 +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
Fabian Grünbichler
23b54109a4 fix start on boot
fix the fix for #1024

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2017-03-24 09:52:28 +01:00
Thomas Lamprecht
1c8dc310b3 remove backup locks when starting all VMs on boot
If on bootup one of our VMs is locked by an backup we safely can
assume that this backup job does not run anymore and that the lock
has no reason anymore and just hinders uptime of services.

As at this time we (the node) have quorum so we may safely assume
that we have a consistent view of the cluster and all our VMs really
belong to us. We just need to ensure that we do not run into an
automatic backup jobs, so execute our code with VZDumps lock or
timeout.
Log in the Task and Sys log that we removed the lock, so that an
admin easily sees that there may be need for cleaning leftovers from
an interrupted backup.

Addresses bug #1024

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2017-03-16 09:04:21 +01:00
Thomas Lamprecht
b2bb6d7749 get_filtered_vmlist: save VM conf in own subhash
small refactoring in get_filtered_vmlist: save a VMs config in its
own subhash to avoid collisions with other data which we want to save
in the vmid list, for now this is only `type` but in the next patch
I want to save also the class

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2017-03-16 09:04:09 +01:00
Thomas Lamprecht
ae9d10ca2c include also HA VMs if a vm list is explicit specified
Else the user would not had specified them explicit

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2017-03-16 09:02:05 +01:00
Dominik Csapak
e890b92d67 use login instead of bash
since bash does not play well with utf8 encoded input,
eg. pressing ALTGR + M on an english intl keyboard layout int novnc
does not enter the mu symbol but makes bash think you pressed alt+5,
we should use login without authorization when logging in as root

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2017-03-09 10:28:27 +01:00
Dominik Csapak
b0d4b407d8 keep locale for vncshell and spiceshell
use the new keeplocale parameter from run_command and do not delete the
LANG and LANGUAGE variable for the vncshell

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2017-03-09 10:26:44 +01:00
Thomas Lamprecht
f5c1dde5f4 migrateall: use get_filtered_vmlist
instead of using get_start_stop_list in a rather hacky way use the
new get_filtered_vmlist method and adapt the loop, as now only one
level is required.

most changes  are just an indent shift left as we lost an unnecessary
loop level

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2017-03-02 10:45:14 +01:00
Thomas Lamprecht
b72cdbb752 refactor get_start_stop_list
we used get_start_stop_list for assembling a list of VMIDs for
stopall, startall and migrateall.

While get_start_stop_list did already some filtering we did some
more in the specific startall and stopall calls.
Add a new private helper which does all the filtering and just
assemble the startup order in the get_start_stop_list method.

Move the template and ha managed filtering in the new
get_filtered_vmlist method, this allows us to remove the filtering
from the API calls them self and we do not load the vms config twice
(it was cached, but nonetheless unnecessary)

get_filtered_vmlist is also intended to be used by migrateall in a
next patch

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2017-03-02 10:43:37 +01:00
Dominik Csapak
2a498506e0 add vmid filter to (start/stop/migrate)all
this is a simple filter which allows us to limit the actions to specific
vmids

this makes it much simpler to start/stop/migrate a range of vms

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2017-01-05 15:55:59 +01:00
Dietmar Maurer
3947d0a069 startall: remove timeout, wait forever 2016-09-09 10:31:21 +02:00
Dominik Csapak
e781363f19 add disk api entry point
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2016-09-07 11:16:55 +02:00
Dominik Csapak
6f242111c3 fix #621: allow template download to glusterfs
removes the check for dir or nfs storage,
because a few lines below we check for
the content type vztmpl
which should only be allowed when we have a
location where we put templates, thus we should
be able to download them there

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2016-09-05 06:54:40 +02:00
Fabian Grünbichler
95f99e8c5e aplinfo: use explicit defined checks
a checksum of '0' can never be correct, but this makes the code clearer
2016-08-24 13:08:45 +02:00
Fabian Grünbichler
79be6db38a aplinfo: use fh for both digests
for consistency, because Digest::MD5 cannot handle filenames directly..
2016-08-24 13:08:22 +02:00
Fabian Grünbichler
62180d0f1d update descriptions, error messages 2016-08-24 10:18:27 +02:00
Fabian Grünbichler
3b81e495cd aplinfo: improve checksum handling
instead of calling md5sums, use perl's Digest::MD5.
also support SHA512 via perl's Digest::SHA, to enable a
transition away from MD5.
2016-08-24 10:09:12 +02:00
Fabian Grünbichler
c351eda952 aplinfo: replace system() with run_command/rename 2016-08-24 09:48:15 +02:00
Caspar Smit
d6c493923a Fixed a small typo
Signed-off-by: Caspar Smit <casparsmit@supernas.eu>
Reviewed-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2016-03-31 10:56:49 +02:00
Caspar Smit
92c11ee1ca Allow migrate-all button on HA enabled VMs
Signed-off-by: Caspar Smit <casparsmit@supernas.eu>
Reviewed-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2016-03-31 10:56:22 +02:00
Caspar Smit
6677f6402e Skip templates when using the start all VMs button
Refactored and now using PVE::QemuConfig and PVE::LXC::Config
Moved the next if.. statements into the corresponding branches

Signed-off-by: Caspar Smit <casparsmit@supernas.eu>
Reviewed-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2016-03-31 10:51:11 +02:00
Caspar Smit
17e3b3b27f Allow non-root to use start/stop/migrate all buttons
Signed-off-by: Caspar Smit <casparsmit@supernas.eu>
Reviewed-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2016-03-31 10:50:34 +02:00
Fabian Grünbichler
bbcfdc08cc use PVE::Storage::config(), not cfs_read_file() 2016-03-30 10:35:58 +02:00
Fabian Grünbichler
7141ae254a Use methods from PVE::QemuConfig
use config_file and load_config from PVE::QemuConfig
2016-03-08 11:53:33 +01:00
Fabian Grünbichler
e93408d600 LXC refactoring
call load_config in PVE::LXC::Config instead of PVE::LXC
2016-03-03 10:44:02 +01:00
Thomas Lamprecht
01b753b6b1 syslog: allow since/until parameters
allow the since/until parameters which journalctl understands
We use a really simple regex to check a valit date (time) stamp.

This can be done as this API call gets mainly used by the GUI where
we have full controll over what we send and additional journalctl
has already a good timestamp parser which can handle that.
2016-03-02 06:24:55 +01:00
Dietmar Maurer
05b252dc5c PVE::API2::Nodes::Nodeinfo: import raise_param_exc 2016-03-01 09:22:39 +01:00
Wolfgang Link
82282acf4f add pveam download
With this function you can download templates from the repositories.
2016-02-26 11:37:11 +01:00
Thomas Lamprecht
89ceb8026a use max_workers from datacenter.cfg for stopall/migrateall
If set limit the maximal worker count to the new datacenter.cfg
setting 'max_workers'.

For stopall we prefer this over the cpu count if it's set.

For migrateall we prefer the parameter but allow now to ommit
the parameter and then we use the new setting if set.
if both are not set we throw an error.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2016-02-11 11:13:55 +01:00
Thomas Lamprecht
10a9a736ed fix PVE::HA use clause so HA resources get registered
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2016-01-27 17:11:21 +01:00
Wolfgang Bumiller
675946f221 fix #871: netstat: include veth devices
Include container's veth devices in /nodes/{node}/netstat
2016-01-25 10:59:48 +01:00
Dietmar Maurer
37bec89547 improve log messages at sytem shutdown 2016-01-22 11:24:17 +01:00
Thomas Lamprecht
efedd8c36f make startall wait up to 60 seconds for quorum
Previously we waited 10 seconds, in PVE 4 system sometimes need more
time to initialize all services so the didn't execute the startall
command even if a few seconds later cfs quorum was etablished.
This is a background process started from the pve-manager init
script, thus waiting doesn't interferes with other processes, so
wait long enough.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2015-11-10 07:48:20 +01:00
Emmanuel Kasper
6bbdf981d1 Use protected mode to be able to execute root system commands
Signed-off-by: Emmanuel Kasper <e.kasper@proxmox.com>
2015-11-06 10:06:11 +01:00
Dietmar Maurer
cdb5a20942 report: change return type to string 2015-11-03 18:14:51 +01:00
Emmanuel Kasper
34ada77a13 Add REST endpoint for /report call 2015-11-03 18:10:44 +01:00
Thomas Lamprecht
3625a09137 Fix check if vm is ha managed in get_start_stop_list
The check used was completely wrong and so the startall and stopall
API calls touched HA managed service, which they shouldn't.

Using the vm_is_ha_managed call from the HA stack fixes that.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2015-10-20 09:50:00 +02:00
Thomas Lamprecht
04b2004b36 fix lxc config key in get_start_stop_list sub
When adding the new LXC config format we forgot to adapt the
get_start_stop_list and do s/pve.startup/onboot/

This fixes that qemu VMs were started always before LXC CTs,
irregardless of the defined order.

This also let's us simplify the surrounding code and reduce code
reuse.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2015-10-20 09:46:16 +02:00