Commit Graph

32 Commits

Author SHA1 Message Date
Thomas Lamprecht
37ab64f388 api/config update: indentation and whitespace fixes
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-05-15 10:36:01 +02:00
Thomas Lamprecht
91f42b33a0 api/config update: only iterate over hash keys, not values
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-05-15 10:34:12 +02:00
Thomas Lamprecht
4273e3ace9 pvesm set: handle deletion of properties
the delete parameter get's injected by the SectionConfigs
updateSchem, but we need to handle it ourself in the code
This makes the following possible:

pvesm set STORAGEID --delete property

Also the API equivalent is now possible. Adapted from the HA
managers Resource update API call.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-05-14 16:24:34 +02:00
Thomas Lamprecht
a4bdab17bb fix #862: do not resolve portal adress on storage add
as described in #862:

> I experienced a problem with ISCSI portal when using a hostname and
> not IP.
> The GUI resolves the hostname to an IP and writes it to storage.cfg.
> As my setup requires hostnames, i needed to change the config
> manually back to the hostname which is working fine.
>
> Why is this conversion done? If I enter a hostname, i want to have a
> hostname. If i enter an IP address i want to have an IP address.

This makes sense to me, a feature of using domains is that they
are/should be resolved when actually using (i.e., connecting to them)
so resolving it once on add does not seems like a good idea (if I do
not miss something - as this is a classic "imported from SVN" I do
not have any rationale to look at).

So save the work and pass it as is.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2018-11-15 10:06:19 +01:00
Thomas Lamprecht
6d3b36e1b0 api add: remove now uneeded $cred_file variable
was used for cleanup, which is now handled by on_delete_hook

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2018-07-03 12:27:34 +02:00
Thomas Lamprecht
f9602323c6 lvm: use add hook
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2018-07-03 12:27:34 +02:00
Thomas Lamprecht
2e109b4bc2 rbd: use add/delete hooks
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2018-07-03 12:27:34 +02:00
Thomas Lamprecht
ab5e32bb1d cifs: use add/delete hooks
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2018-07-03 12:27:34 +02:00
Thomas Lamprecht
3932ca0d1b add on_add and on_delete hooks
on_add_hook allows to encapsulate storage specific add steps, like
copying a keyring (RDB) or creating a volume group (LVM) in a clean
manner.
The same for deletion with on_delete_hook, here all should be cleaned
up, as much as possible.

Until now, this was done directly in the api config CREATE and DELETE
code, respectively, with a series of

if ($storage_type eq 'foo) {
    ...
} elsif ($storage_type eq 'bar') {
    ...
}

which isn't really that nice...

Another nice result of this approach is that also external plugins
can use those hooks and to their setup/cleanup steps sanely.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2018-07-03 12:27:34 +02:00
Thomas Lamprecht
d7b707626a storage add: always extract password from parameters
as else we write it to /etc/pve/storage.cfg which is readable by
www-data, a not really private group...

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2018-06-29 13:16:17 +02:00
Thomas Lamprecht
2d4404fc63 add cifs: fix variable declaration in post if
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2018-06-29 13:15:26 +02:00
Dietmar Maurer
8b3d5c1f12 PVE/API2/Storage/Config.pm - set type in returns schema 2018-06-22 07:52:51 +02:00
Dietmar Maurer
566639d518 cifs: use correct pluging class name 2018-03-16 13:23:47 +01:00
Dietmar Maurer
a9db2ca8a5 cifs: move plugin related code into plugin 2018-03-16 13:08:32 +01:00
Dietmar Maurer
304344ce34 add missing "use PVE::Storage::LVMPlugin;" 2018-03-16 12:54:06 +01:00
Dietmar Maurer
fa1b42dd98 cifs plugin cleanups 2018-03-16 12:35:55 +01:00
Dietmar Maurer
c6fb7b80fc remove useless "use PVE::PTY;" 2018-03-16 12:09:37 +01:00
Wolfgang Link
ba7e9ba9c9 Add remove cifs in API call. 2018-03-16 12:05:02 +01:00
Wolfgang Link
a4a9405d76 Add cifs in create API call.
In this patch the nodes will be deleted if the nodes parameter comes with a empty string.
We need this in the GUI when update the nodes in the config to reset if a nodes.

If we do not erase the empty hash the storage online check would be skipped.
Also the password and user would not be verified.
2018-03-16 12:03:37 +01:00
Wolfgang Link
f79a699c13 Add set CIFS credentials. 2018-03-16 11:58:34 +01:00
Fabian Grünbichler
8143f49038 rbd: create ceph keyring dir before copying
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2017-09-07 12:51:31 +02:00
Fabian Grünbichler
5a39d0a111 rbd: manage keyring for pveceph storages
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2017-09-07 11:35:00 +02:00
Fabian Grünbichler
83d7192ff9 Add write_config, drop cfs_read_file
Use PVE::Storage::config() and the new
PVE::Storage::write_config() instead of cfs_read_file and
cfs_write_file with a hardcoded filename.
2016-03-30 10:42:12 +02:00
Dietmar Maurer
f3bd890d98 add missing completion hooks 2015-10-01 07:59:48 +02:00
Alen Grizonic
2a2cf20aa9 remove storage access permissions after delete 2015-08-19 15:17:38 +02:00
Alen Grizonic
402df80b12 added remove storage (exist) check 2015-08-19 15:14:29 +02:00
Dietmar Maurer
283608f330 extend storage list API with useful parameters for clone
Add ability to list shared storages availavlable on souce and target node.
2013-05-14 09:56:11 +02:00
Dietmar Maurer
1dc01b9f30 new plugin architecture 2012-05-23 08:00:13 +02:00
Dietmar Maurer
446073f681 allow to set option 'maxfiles' 2012-03-23 07:43:28 +01:00
Dietmar Maurer
5f642f73b8 add permission checks 2012-01-26 09:25:39 +01:00
Dietmar Maurer
dfe98e6437 Fix digest handling 2011-09-07 12:01:25 +02:00
Dietmar Maurer
b6cf0a6659 imported from svn 'pve-storage/pve2' 2011-08-23 07:43:03 +02:00