Commit Graph

649 Commits

Author SHA1 Message Date
4792d439ad Add CIFS Storage Plugin.
This Plugin use as template the NFSpluigin.
We do only support smbversion 2 and 3.
Version 3 is default and must override through the config.
2018-03-16 11:57:57 +01:00
77445e9b80 bwlimit: apply limits when there's no override
Before, 'undef' was equivalent to unlimited, but '0' is the
"explicitly unlimited" value, so if the user doesn't request
an override, apply limits as if the user was unprivileged
(otherwise there's no way for privileged users to explicitly
ask to not override the configured limits).

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2018-03-07 14:19:07 +01:00
6ea1a3f3fe Fix typo in sub s/krdb_feature_disable/krbd_feature_disable
Signed-off-by: Alwin Antreich <a.antreich@proxmox.com>
2018-03-02 13:28:50 +01:00
4c3b308583 Fix #1574: could not disable krbd-incompatible image features
To prevent an error when disabling features of a rbd image with already
disabled flags. This aborted the CT/VM cloning halfway through with
a leftover rbd image, but no vmid.conf to it.

Signed-off-by: Alwin Antreich <a.antreich@proxmox.com>
2018-03-02 13:28:50 +01:00
9edb99a5a7 add Storage::get_bandwidth_limit helper
Takes an operation, an optional requested bandwidth
limit override, and a list of storages involved in the
operation and lowers the requested bandwidth against global
and storage-specific limits unless the user has permissions
to change those.
This means:
 * Global limits apply to all users without Sys.Modify on /
   (as they can change datacenter.cfg options via the API).
 * Storage specific limits apply to users without
   Datastore.Allocate access on /storage/X for any involved
   storage X.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2018-01-31 12:25:32 +01:00
f6c03d367d whitespace cleanup
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2017-11-14 13:23:52 +01:00
856c54bd75 add 'format' parameter to storage list call
we will use this for the gui to figure out if we have to show
a size selector, a file selector, which formats are there, etc.

we have to include this data even for not active storages, else
we cannot show the correct fields

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2017-11-14 13:23:52 +01:00
5da48ca6ea add select_existing to plugindata for iscsi(direct)
this will be used in the gui, for determining if we need to select
something from the storage when using for an image

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2017-11-14 13:23:52 +01:00
fc7c0e0504 (finally) fix #1099: return disklist correctly
in get_disks, when called with a parameter 'cciss/cXdY', we replaced
the '/' with '!' so that we can properly poll the information
about it from /sys/block/

but we have to replace the '!' with '/' again in our result list,
because the caller does not know anything about it and fails, because
the original dev is not in the list

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2017-11-14 13:23:52 +01:00
8fe00d9944 Add logfung in storage_migrate
The log function is used by storage replication to redirect the output in the correct log.
2017-10-16 14:59:57 +02:00
6b4acdb460 ISCSIPlugin: Use long options for readability
We otherwise use the long options everywhere in the plugin.
This will build the following command:

iscsiadm  --mode session --sid 1 --rescan
Rescanning session [sid: 1, target: xxx, portal: yyy]
2017-10-09 10:50:11 +02:00
79127fb5c7 rbd: support auth=none if pveceph-managed
preserve the old behaviour of selecting auth_supported based on the
existence of the keyring, but limit it to external clusters.

this allows switching 'auth XXX required' in the pveceph-managed
ceph.conf while still automatically copying the keyring when adding a
storage.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2017-09-12 11:24:39 +02:00
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
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
6eebc4a78a rbd: implement handling of unset monhost
add /etc/pve/ceph.conf to commands / option strings instead
of the monitor list provided via the 'monhost' option.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2017-09-07 11:35:00 +02:00
239aa73e93 rbd: refactor cmdline helpers
these were line by line identical except for the binary path

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2017-09-07 11:35:00 +02:00
0b9ef02ebc rbd: make monhost option optional
to allow differentiating between user-created external RBD storage
entries (WITH monhost), and those created and managed by pveceph
(without).

making monhost non-fixed allows easily opting into the managed behaviour via
'pvesm set STORAGE -delete monhost', but is also helpful for external clusters
(i.e., after adding or removing a monitor you need to update the monhost
parameter..)

adapt description accordingly.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2017-09-07 11:35:00 +02:00
de8eff4d31 dir: allow a path as is_mountpoint value
This turns is_mountpoint more into export(5)'s `mountpoint`
property.
Given the directory storage with the properties:

    path /a/b/c
    is_mountpoint $value

$value = yes
    Same as before, /a/b/c must be mounted.
$value = no (or not set)
    Same as before, no effect.
$value = /a/b
    New: /a/b must be mounted (as opposed to /a/b/c)
2017-09-06 09:26:20 +02:00
6ce4f72487 cleanup: call defined() early
No need to carry around a hash we don't need if we get one.
2017-08-10 13:24:41 +02:00
b43b073b51 Fix #1474: Fixes input and output of print_storage
Accommodates changes in 44ae567 and d40e27d by
reordering checks to allow for proper filtering
of disabled storages. Also reorders two checks to
prevent autovivification resulting in disabled
storages always showing in output.
2017-08-10 13:20:52 +02:00
e2bd817ccc add info about bluestore to disklist
this patch adds information about bluestore/db/wal to the disklist,
and we set the journal count only when we have at least one journal on
the disk

also adapt the regression tests

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2017-08-07 14:52:10 +02:00
0430101380 pvesm: remove superfluous space after N/A 2017-07-27 14:17:02 +02:00
d40e27deb2 pvesm status: improve output and its format
Add column names at top of output, this allows easier understanding
of what each column means.

Use leading spaces on the percentage column so that this is lined up.

Switch out the 1/0 from the active column with the actual status
(active, inactive, disabled).

Show N/A if storage is disabled.

Use $res->{total} instead of calculating a sum of used and available.

Remove wrong rounding - if we want to display 2 digits from the
fractional part we would need to add 0.005 not 0.5, this made the
result quite wrong depending on the storage size.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2017-07-27 13:09:28 +02:00
44ae567c38 storage_info: return also disabled storages
in the Storage/Status API call we have a 'enabled' param which had no
effect because storage_info only returned enabled one way or the
other.

This affected also `pvesm status` which uses the Storage/Status API
call.

So push also disabled storages to the info array but only activate
and get their status when thei are enabled.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2017-07-27 13:09:28 +02:00
21aaefd522 fix ceph_version_parser
Ceph change ceph version output.

full output of 'ceph --version'

Luminous 'ceph version 12.1.0 (262617c9f16c55e863693258061c5b25dea5b086) luminous (dev)'
Jewel 	 'ceph version 10.2.7 (50e863e0f4bc8f4b9e31156de690d765af245185)'
2017-07-04 06:10:15 +02:00
e53050ed13 Fixes: #1415 do not block pvestatd when nfsd is stopped on the server side
Wrap the -d test with run_or_get_killed sub this test
can make pvestatd hang on I/O wait when a nfsd process is stopped

This might help with other file based storages, for instance
directory storages on unplugged USB devices.
2017-06-29 15:16:08 +02:00
7118dd916b PVE::Storage::storage_can_replicate - hew helper 2017-06-27 06:17:58 +02:00
6b3a4a2504 import/export: drop the 'subvol/' prefix from 'tar+size'
It was deemed an unnecessary overhead.

Also add a comment about the effect (or lack thereof) of
user namespace uid mappings.
2017-06-22 17:35:04 +02:00
030f6e1a97 Fix #1424: allow tar.xz templates upload 2017-06-22 14:32:27 +02:00
766cfd9a87 import/export: use our standard tar flags
Custom plugins may reuse
@PVE::Storage::Plugin::COMMON_TAR_FLAGS as well.
2017-06-22 12:47:29 +02:00
e8a7e764af storage_migrate: with_snapshots parameter
Since the migration code already has to check snapshots and
we still want to be able to migrate raw disks, we cannot
always pass -with-snapshots 1.
2017-06-22 12:40:23 +02:00
e1f6cb3904 re-add changes to PVE/Storage/Plugin.pm (fixup previous commit)
This was removed by accident.
2017-06-22 09:05:29 +02:00
364e63647a bump version to 5.0-6 2017-06-22 08:36:11 +02:00
da72898cc6 migrate: only use import/export
This replaces the path-based and lvm/thin special cases in
storage_migrate with the already generic-enough zfspool
case which is already using import/export and does not
directly depend on zfs anymore.
2017-06-22 07:03:39 +02:00
5cbbc78fdb lvm: import/export: implement raw+size format 2017-06-22 06:48:09 +02:00
9559a62a3d import/export: new formats: raw, tar, qcow2, vmdk
All of them have a `+size` prefix to show that they're not
"pure raw" or "pure tar" streams, because some storage may
need to know in advance how much storage to allocate.
The formats are explained in comments.

PVE::Storage::Plugin now has default implementations for
these for non-incremental streams exporting the current
(rather than a snapshot state).
To use qcow2 or vmdk formats $with_snapshots must be true,
otherwise raw/tar will be used where $with_snapshots must
be false.
2017-06-22 05:59:34 +02:00
ae36189d26 export: add missing format query call parameter 2017-06-22 05:51:32 +02:00
488cf14d4f migrate: insecure: untaint the received ip/port 2017-06-09 12:30:59 +02:00
47cea19432 migrate: don't include the hostname in rsync's rsh command 2017-06-09 12:30:17 +02:00
4b4c580d02 migrate: use the correct IP with rsync 2017-06-09 12:30:02 +02:00
b43d0f3043 ZFSPoolPlugin.pm: remove unused code 2017-06-08 08:45:22 +02:00
636ac5b82f PVE::Storage::volume_snapshot_list - remove comment about ordering
Some storage types supports arbitrary snapshot trees, so there is
no strict ordering relation.
2017-06-07 06:36:55 +02:00
8b622c2dff PVE::Storage::volume_snapshot_list - remove $prefix parameter
Always return the full list of snapshots. Users of this library can easily
filter with a simply 'grep' instead.
2017-06-07 06:20:07 +02:00
c2bce0ef63 remove unused replication code (moved to pve-manager) 2017-06-07 06:14:30 +02:00
a3f38a644c fix #1379: return size as number instead of string
this caused the webinterface to sort alphabetically instead of numerical
when sorting by image size

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2017-06-02 10:24:30 +02:00
7ba34faa6e migrate: add insecure parameter
This uses mtunnel's new -run-command parameter in
combination with the ssh-info's network cidr option to use
an unprotected TCP port.
2017-06-01 10:43:32 +02:00
01f7e902e9 migrate: implement rate limiting
Note that it does not apply to the local 'mkdir && cp' case.
2017-06-01 10:42:32 +02:00
cd0b3d5bc2 Revert "free: added snapshot parameter"
This reverts commit a26e1abc70.
2017-05-23 13:31:21 +02:00
b57a863a0f migrate: cleanup & fixup
The volume_snapshot call was missing the condition when to
create a snapshot. Make the whole logic easier to follow
with a $migration_snapshot boolean.
Also get rid of the remote `pvesm free -snapshot` call by
using import's new -delete-snapshot parameter.
2017-05-23 13:30:51 +02:00
5259593842 import: add -delete-snapshot parameter
This deletes a snapshot on *success*, done directly in the
CLI handler, as the rollback/delete on failure is already
happening inside the plugin's import method.
2017-05-23 13:29:48 +02:00