Commit Graph

130 Commits

Author SHA1 Message Date
Thomas Lamprecht
f9b08743a5 api/nodes journal: add and enforce parameter conflicts
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-05-15 15:16:22 +02:00
Thomas Lamprecht
952280b49a api/nodes: add journal to index
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-05-15 15:15:51 +02:00
Dominik Csapak
1d397a8394 node: add journal api
this uses the new journalreader instead of journalctl, which is a bit
faster and can read from/to cursor and returns a start/end cursor

also you can give an unix epoch as time parameters

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2019-05-15 12:09:26 +02:00
Thomas Lamprecht
fc1da3b020 api: handle undefined shellcmd parameter better
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-04-24 11:27:52 +00:00
Thomas Lamprecht
57d56896c8 fix #263: only include node rrd stats if user has Sys.Audit
It makes sense to not give users without Sys.Audit permissions to
much information over a node and this is relatively easy and cheap to
check and enforce at those two points.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Tested-by: Oguz Bektas <o.bektas@proxmox.com>
2019-04-16 12:28:42 +00:00
Tim Marx
c3b04731bb add pveceph install to shell api
Signed-off-by: Tim Marx <t.marx@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-02-28 13:21:21 +01:00
Thomas Lamprecht
d4a25f0b88 followup: fix whitespace error
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-02-28 13:05:46 +01:00
Tim Marx
2d39fd70d5 deprecate old upgrade property
Signed-off-by: Tim Marx <t.marx@proxmox.com>
2019-02-28 13:04:23 +01:00
Thomas Lamprecht
dab7a849db api/nodes: fix variable name style: s/cmdMapper/shell_cmd_map/
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-02-28 13:04:10 +01:00
Tim Marx
d03d7e1eee unified the classification of the passed command for all shell apis
As discussed on the pve-devel list [0] I extracted the identical chunks from each
shell api into one function as basis for future changes.

[0] https://pve.proxmox.com/pipermail/pve-devel/2019-January/035387.html

Signed-off-by: Tim Marx <t.marx@proxmox.com>
2019-02-28 11:32:18 +01:00
Thomas Lamprecht
f9d26e098f trailing whitespace fix in Nodes
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-02-27 13:39:32 +01:00
Oguz Bektas
e50456078b fix #1769: restart mode for bulk lxc migration
online mode doesn't work, and causes bulk migration of
running lxc containers to fail.

Signed-off-by: Oguz Bektas <o.bektas@proxmox.com>
2019-02-19 11:53:15 +01:00
Christian Ebner
5aa7b909b1 Add bash completion for wakeonlan API call
This adds the bash completion for the wakeonlan API call.
The bash completion returns only those nodes which are offline according to the
member status.

Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
2019-01-28 17:28:34 +01:00
Thomas Lamprecht
ec1788043c api/wakeonlan: add description to return schema
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-01-22 12:19:07 +01:00
Christian Ebner
0f615ea9df pvenode: Return MAC address used for WoL call on success
Use the new format to verify the MAC addresses.
The wakeonlan API call now returns the MAC address of the node to wake on
successful sending of the WoL packet.
pvenode finally displays this MAC address to the user as feedback.

Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
2019-01-22 12:05:47 +01:00
Thomas Lamprecht
824369963b wakeonlan: we cannot wake ourself
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-01-21 16:49:34 +01:00
Christian Ebner
6f712496d8 Nodes: Check if target node even exists before sending WOL packet
Checks if the specified target node even exists before trying to read its MAC
address from the config and sending the wake on LAN magic packet.

Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
2019-01-21 16:22:12 +01:00
Christian Ebner
b3d8454221 implement basic wake on LAN functionality
Provides the basic functionality to provide a wake on LAN feature implementation
to start nodes in a cluster from other nodes.

Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
2019-01-17 11:15:01 +01:00
Thomas Lamprecht
523d5f486b api: move PCI from Scan to Hardware path
as discussed[0] lets move this to /nodes/{node}/hardware/pci

Put this in its own subfolder and adapt module names and paths in UI.

[0]: https://pve.proxmox.com/pipermail/pve-devel/2018-November/034694.html
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2018-11-22 14:20:09 +01:00
Dominik Csapak
ab322f5f83 rename PVE::API2::Storage::Scan to PVE::API2::Scan
and use it in the API

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2018-11-19 15:04:31 +01:00
Dominik Csapak
820d0458e7 add /node/{NODE}/hosts API Call
to get and set the content of /etc/hosts

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2018-09-14 11:47:03 +02:00
Dominik Csapak
73981e3937 fix #1828: check if targetnode exists before starting mass migration
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2018-08-13 09:00:54 +02:00
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