Commit Graph

543 Commits

Author SHA1 Message Date
Dietmar Maurer
ff3badd83f white space cleanups 2016-09-26 13:40:43 +02:00
Wolfgang Link
a9ef8ffb16 Avoid JavaScript gets a string 0.
If the JavaScript gets a "0" it convents it to a boolean false.
So to ensure the GUI always get valid int we cast the values.
2016-09-26 13:38:56 +02:00
Fabian Grünbichler
787624dfc0 add comments about LVM thin clones 2016-09-15 14:01:07 +02:00
Fabian Grünbichler
5510f5c9f9 fix typo 2016-09-15 13:56:17 +02:00
Fabian Grünbichler
1b83c3d9c7 harmonize list_images code 2016-09-15 13:54:47 +02:00
Fabian Grünbichler
17fb7e4215 move check for existing clones into own method
and change its return type to boolean
2016-09-15 13:52:57 +02:00
Fabian Grünbichler
9924228be1 remove unused method
only used by test case, which should use what the rest of
the codebase uses as well
2016-09-15 13:42:55 +02:00
Dietmar Maurer
cfd58f1fcc code cleanup 2016-09-14 11:31:10 +02:00
Fabian Grünbichler
3718e83ab5 fix error message 2016-09-14 11:24:06 +02:00
Fabian Grünbichler
883d9b81f0 fix indentation 2016-09-14 11:23:52 +02:00
Fabian Grünbichler
9690e55e9b rbd: detect linked clones/base volumes correctly
since the rbd images themselves are named differently than
the volumes in our config files, we need to recreate this
information from the parent relation in the ceph metadata,
otherwise list_images() might return wrong volume names/IDs

since list_images is used by PVE::Storage::vdisk_free() to
check for children still referencing a base image, because
of the wrong volume id RBDPlugin->parse_volname() does not
detect the base image of linked clones and the check fails.
this is thankfully mitigated by the protected status of the
base snapshot, but creates a rather confusing error message.

scenario (VM 701 is a linked clone of template VM 700):

$ qm config 700 | grep virtio0:
virtio0: ceph_qemu:base-700-disk-1,size=2G
$ qm config 701 | grep virtio0:
virtio0: ceph_qemu:base-700-disk-1/vm-701-disk-1,size=2G

before (pvesm list reports wrong volume ID, check fails):

$ pvesm list ceph_qemu
ceph_qemu:base-700-disk-1   raw 2147483648 700
ceph_qemu:vm-701-disk-1     raw 2147483648 701
$ pvesm free ceph_qemu:base-700-disk-1
snap_unprotect: can't unprotect; at least 1 child(ren) in pool rbd
rbd unprotect base-700-disk-1 snap '__base__' error: snap_unprotect: can't unprotect; at least 1 child(ren) in pool rbd

after (correct volume ID, check works as intended):

$ pvesm list ceph_qemu
ceph_qemu:base-700-disk-1                   raw 2147483648 700
ceph_qemu:base-700-disk-1/vm-701-disk-1     raw 2147483648 701
$ pvesm free ceph_qemu:base-700-disk-1
base volume 'base-700-disk-1' is still in use (use by 'base-700-disk-1/vm-701-disk-1')
2016-09-14 11:23:39 +02:00
Fabian Grünbichler
5e6aa346c7 rbd: use correct key to access hash elements 2016-09-14 11:17:16 +02:00
Dominik Csapak
9018a4e639 do not automatically die on smartctl exit code > 0
since smartctl uses the return value to encode
disk health status (such as failure in the past)
we cannot die there, but have to parse the returncode

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2016-09-08 16:52:33 +02:00
Dietmar Maurer
2622a5ca2d sheepdog 1.0 changed the path from /usr/sbin/dog to /usr/bin/dog 2016-09-07 09:11:43 +02:00
Dominik Csapak
409f8203e0 add api entries for disk management
adds a new class (intended to be used under nodes in pve-manager)
which adds the three api calls: list, smart and init

list being a general list of the available disk with infos
smart being a call to get the smart data from a given device
init being a call to write a gpt header to an unused disk

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2016-09-05 13:49:28 +02:00
Dominik Csapak
cbba9b5b9c add Diskmanage Utilities
this adds the functions for listing the disks (mostly copied from
the ceph code), checking if a disk is a valid blockdevice, if it
is used/in a zfs pool/as an lvm pv, and an init function (just to add a gpt header;
this is important if one wants to use a fresh disk for ceph journals)

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2016-09-05 11:31:19 +02:00
Dietmar Maurer
6d2b278c51 white space cleanups 2016-09-01 06:28:54 +02:00
Dietmar Maurer
e7ac2d5cf6 rbd_unittobytes: use a local var instead of a sub 2016-09-01 06:24:51 +02:00
Alexandre Derumier
134172255f rbd: allow to use client custom ceph conf for each storeid
If you want to use different ceph storage,
something they have differents values like ms_nocrc = true.(they are also others ones).

The client need to specify theses special options to be able to connect

This patch allow to create a ceph config file for each storeid in

/etc/pve/priv/ceph/$storeid.conf

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2016-09-01 06:21:40 +02:00
Dmitry Petuhov
4dee23d305 Add support for custom storage plugins
PVE team cannot support specialized vendor-specific storage
plugins because of lack of hardware. But we can allow users to
add own plugins for their storages without need to rewrite any
PVE code and thus ease PVE updates to them.

Idea of this patch is to add folder /usr/share/perl5/PVE/Storage/Custom
where user can place his plugins and PVE will automatically load
them on start or warn if it could not and continue. Maybe we could
even load all plugins (except PVE::Storage::Plugin itself) this way,
because current storage plugins are not really plugins, if they
need to be explicitly loaded in PVE code :-).

Custom plugins MUST have api() method returning version for which
it was designed. If API changes from PVE side, module is just not
being registered and warnig message is printed do log, so user have
to update module. Until module update, corresponding storage will
just disappear from PVE, so it shall not impose any data damage
because of API change.

This approach works (with some limitations) if plugin works in
generic PVE way: full control of volumes lifecycle. And will not
currently work for custom plugins like iSCSI, which needs to select
pre-existing volumes. Maybe someone will add more flexible way to
pve-manager to select input elements for storage plugins to target
this.

Currently tested with my NetApp plugin.

Signed-off-by: Dmitry Petuhov <mityapetuhov@gmail.com>
2016-08-26 15:44:49 +02:00
Dominik Csapak
f3b3b2a3b7 remove compression option from lvm migration
ssh(1) mentions that compression is only disirable on slow
connections.

since migration from cluster node to cluster node needs a
fast network anyway, we can drop the compression for
a speed improvement

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2016-08-05 08:36:13 +02:00
Fabian Grünbichler
82fc923fd4 fix spelling / grammar 2016-07-13 13:59:26 +02:00
Wolfgang Bumiller
e6ccfdeb21 Remove unused pve-storage-monhost format 2016-07-11 13:58:56 +02:00
Wolfgang Bumiller
e858048fc5 rbd: use pve-storage-portal-dns-list for monhost
This way we get parameter verification on monitor addresses
as well as the ability to pass multiple `--monhost`
arguments to `pvesm add`.

Since our '-list' schemas default to using commas we now
need to properly support these, so all uses of the monhost
property now replace all of semicolon, space or comma into
the currently required character.
This should fix the issues reported by Alwin Antreich on the
pve-user list.

Since this schema supports both ipv6+port notations we need
to make sure we convert to the bracket enclosed variant.
Added a helper for this.
2016-07-11 13:58:56 +02:00
Wolfgang Bumiller
33cef4c84e rbd: path: don't build the entire path if we don't use it 2016-07-11 13:58:56 +02:00
Fabian Grünbichler
0423e8c686 fix indentation 2016-06-29 11:42:03 +02:00
Fabian Grünbichler
7a9dd1195d add tagged_only option to LVM storage
to filter volumes by the 'pve-vm-ID' tag, which is set on
all volumes created via the PVE storage layer.
2016-06-29 11:42:03 +02:00
Wolfgang Link
4a7d222204 add check if format is defined to avoid warning 2016-06-28 11:40:26 +02:00
Wolfgang Link
966ecef2e8 fix #1033 storage_migrate on LVMThin - add die.
This is necessary to ensure the process will proper finished.
2016-06-17 14:55:38 +02:00
Wolfgang Link
e967e0ef27 fix #1022 correct typo 2016-06-14 12:32:26 +02:00
Fabian Grünbichler
e76dbd9204 use correct ceph version command
"ceph version" retrieves the version from the cluster (i.e.,
from the queried monitor), but what is needed here is the
local ceph version, which is returned by "ceph --version".
2016-06-14 11:46:32 +02:00
Wolfgang Bumiller
5c95e48479 Dir storage creation: check for a sane path
Ideally we don't need this, but this with the directory
storage this is a user-input field which gets returned
by the storage's path() method which is used in various
external command calls.
2016-06-09 18:15:28 +02:00
Wolfgang Bumiller
602eacfe6a split udevam command call 2016-06-09 18:15:09 +02:00
Wolfgang Bumiller
38e1eb3d87 upload: whitelist filename chars instead of blacklisting 2016-06-09 18:14:55 +02:00
Wolfgang Link
e83f7b4095 fix for storage migrate
remove the sparse parameter from dd.
This destroy the lvm volume.

also remove the free_disk this will later be done.
2016-06-08 16:35:27 +02:00
Dietmar Maurer
84252f6772 code cleanups 2016-06-08 09:20:11 +02:00
Dietmar Maurer
76f13c9ee8 cleanup: improve error message 2016-06-08 08:36:18 +02:00
Wolfgang Link
0a29ad6148 Add LVM-thin storage migration
It is now possibel to migrate LVM-thin volumes offline from one node to an other.
Also LVM what is used by Qemu.
2016-06-08 08:21:40 +02:00
Wolfgang Bumiller
b521247bf4 fix 1012: dir: add mkdir option
By default a directory storage creates its path. In some
cases this can be undesired, mostly when storages have
nested paths (eg. a dir storage on a ZFS path or in an NFS
share, or inside custom mount points).
As a simple fix to this the 'mkdir' option (default ON)
can now be used to disable this behavior.
2016-06-07 10:47:16 +02:00
Dietmar Maurer
0be02e0f21 s/version_parser/ceph_version_parser/ 2016-06-07 10:32:42 +02:00
Fabian Grünbichler
d86fd0a49b disable jewel image features when using krdb
otherwise mapping those images will fail. disabling the
features only needs to be done once per image, so it makes
sense to do this when creating the images.

unfortunately, the command does not work in hammer, so
it needs a version check for jewel or higher.
2016-06-07 10:25:36 +02:00
Fabian Grünbichler
7aeda03306 add ceph version helpers 2016-06-07 10:25:25 +02:00
Fabian Grünbichler
fa017b9696 add pvesm extractconfig 2016-06-03 12:04:59 +02:00
Fabian Grünbichler
8898dd7be2 add extract vzdump config methods
extract_vzdump_config_tar is an adapted combination
of tar_archive_search_conf() and the first part of
recover_config(), both from PVE::LXC::Create.

a compressed vma backup file needs special error
handling because vma exits as soon as it found the config
file, which the used decompressors treat as error.
2016-06-03 12:04:26 +02:00
Fabian Grünbichler
daccf21ef7 docs: typo, newlines, cleanup 2016-04-15 16:37:01 +02:00
Dietmar Maurer
9e4632c2fe DRBDPlugin: check_drbd_res() ignore info codes
Messages for return codes 1 to 99 are not considered an error.
2016-04-15 08:07:01 +02:00
Wolfgang Bumiller
72e743bd65 rbd: fix error message 2016-04-11 12:57:51 +02:00
Dietmar Maurer
dbf890f082 generate manpage with pve-doc-generator, bump version to 4.0-49 2016-04-06 11:28:09 +02:00
Wolfgang Link
74b724a699 In path use parsed volname not the volid and add 'basevol' 2016-04-05 15:43:02 +02:00
Dietmar Maurer
8e5b96cac3 zfs_parse_zvol_list: simplify regex 2016-04-04 08:51:13 +02:00
Wolfgang Link
851658c3b0 Change zfs path when link clone are used
The new naming is coherent to Dir plugin.

So if we make an licked clone the parent will be coded in the path of the storage.
2016-04-04 06:38:15 +02:00
Wolfgang Link
703de49ea9 Skip invalid property's in storage parser
There is no need to remove the hole storage, if one property is not valid.
Just ignore the property.
2016-04-04 06:30:53 +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
Wolfgang Link
986303caf3 Fix LXC migration from local subvol
This patch reconfigured the rsync parameters, so the fs keeps all settings and works recursive.
2016-03-22 09:06:59 +01:00
Wolfgang Link
b650f029d3 Use array to run_command instead of a string. 2016-03-17 07:07:56 +01:00
Wolfgang Link
2d22db9a99 Include all snapshots when migrate storage zfs to zfs. 2016-03-17 07:07:01 +01:00
Fabian Grünbichler
21430e5088 Use is_worker to decide default timeout for ZFS
Bump timeout to 1 hour if running in a worker and no timeout
specified.
2016-03-15 16:50:00 +01:00
Wolfgang Bumiller
f44e50fed1 lvmthin: activate base volumes
create_base() uses '-ky' to prevent base images from being
activated by default, similar to snapshots. This means we
need to activate them like snapshots with the '-K' option.
2016-03-15 06:48:59 +01:00
Wolfgang Link
7a047fce4a Remove content type container from GlusterFS. 2016-03-02 17:14:07 +01:00
Dominik Csapak
baafddbd02 add sparseinit to has_feature
we will use this for determining
if we need to write zeros to a volume

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2016-02-24 17:16:25 +01:00
Dietmar Maurer
668f6d9faf add lvmthinscan to CLI 2016-02-20 10:11:59 +01:00
Dominik Csapak
d0ea89e564 prepare storage for lvmthin gui
this patch adds an lvmthin scan to the api, so that we can get a list
of thinpools for a specific vg via an api call

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2016-02-20 09:51:12 +01:00
Wolfgang Bumiller
2d080bb88d storage_migrate: another ipv6 fix for an rsync command 2016-01-28 11:10:56 +01:00
Wolfgang Link
19e5596a74 increase timeout for ZFSPugin
This is useful on large zfs pools because they take longer to response.
2016-01-25 10:48:16 +01:00
Dietmar Maurer
030bc5c803 lvmthin: allow to clone from snapshot 2016-01-20 11:32:18 +01:00
Dietmar Maurer
920ecf563a remove option maxfiles from zfspool plugin
It makse no sense, because this plugin is unable to store backup files.
2015-12-30 17:16:37 +01:00
Wolfgang Bumiller
1773e785c2 nfs: is_mounted: match /^nfs.*/ type
This is consistent with the old behavior.
2015-12-09 16:15:31 +01:00
Wolfgang Bumiller
aed6c85d28 nfs/glusterfs: is_mounted fixes
The parse_proc_mounts change made the glusterfs is_mounted
check fail (causing it to be shown as inactive on the GUI).
The NFS check was stricter (not allowing a trailing / in the
source anymore).
2015-12-09 09:22:15 +01:00
Dietmar Maurer
f482231e48 Revert "Change zfspoolplugin path when snapshot is given."
This reverts commit fdd31ce759.

The assumption was wrong. Turned out that we cannot assume
snapshots are always mounted there.
2015-12-09 07:38:36 +01:00
Wolfgang Bumiller
1f5734bb8d allow rx permissions for group/world on .subvol dirs
vdisk_alloc comes in with an umask of 0037, which means the
.subvol dir has permissions 0740, which means that the root
directory of containers has permissions 0740, essentially
preventing the users inside a container from accessing
anything.
2015-11-26 12:04:59 +01:00
Wolfgang Link
fdd31ce759 Change zfspoolplugin path when snapshot is given.
Zfs subvol snapshots are always mounted under $path_of_subvol/.zfs/$snapname
2015-11-19 12:36:19 +01:00
Phillip Schichtel
281f958706 Fixed ZFS over iSCSI snapshot rollback
I converted several zfs_request($class, ...) calls to $class->zfs_request(...) calls in ZFSPoolPlugin.pm and removed a superfluous $class parameter in ZFSPlugin.pm.

Fixes #816

Signed-off-by: Phillip Schichtel <phillip.public@schich.tel>
2015-11-18 11:00:40 +01:00
Wolfgang Bumiller
80b647882e make use of the new ProcFSTools::parse_proc_mounts 2015-11-14 10:37:06 +01:00
Dietmar Maurer
30650d3c46 lvmthin: enable copy from snapshot feature 2015-11-12 11:15:37 +01:00
Dietmar Maurer
33adbdc447 lvmthin: allow to acces snapshots in filesystem_path 2015-11-12 11:14:47 +01:00
Dietmar Maurer
faabe9e297 lvmthin: fix used space (only use data%) 2015-11-12 09:47:49 +01:00
Dietmar Maurer
f1b59efc0d lvmthin: implement template/clone 2015-11-12 09:31:45 +01:00
Dietmar Maurer
b13784612d new helper lvm_find_free_diskname() 2015-11-12 09:29:00 +01:00
Dietmar Maurer
5b41084a6a lvmthin alloc_image: add additional test if VG exists 2015-11-12 08:02:50 +01:00
Dietmar Maurer
663372bc4d lvmthin: implement snapshot and rollback 2015-11-12 07:28:28 +01:00
Dietmar Maurer
a9f0c6c4f5 lvmthin volume_resize: reuse code from parent class 2015-11-11 10:18:44 +01:00
Dietmar Maurer
5c687bd921 white space cleanups 2015-11-11 09:17:31 +01:00
Dietmar Maurer
15334c831c LvmThinPlugin: improve basic functionality, better code reuse 2015-11-11 09:14:06 +01:00
Dietmar Maurer
3e44cd8498 implement generic lvm_list_volumes()
This replace lvm_lvs, and return a list of all volumes. That way
we can reuse code for LvmThin.
2015-11-11 09:14:06 +01:00
Dietmar Maurer
610798bc2d add lvm thin plugin 2015-11-11 09:14:06 +01:00
Dietmar Maurer
5dca5c7c7e move format registration to Plugin.pm 2015-11-11 09:13:57 +01:00
Dietmar Maurer
efaf4017f4 zfs: enable posixacl and xattr for subvolumes 2015-11-06 16:39:17 +01:00
Wolfgang Link
27a2764632 fix bug #809: inheritance from ZFSPoolPlugin is not possible because we have to handle there subvols too. 2015-11-06 08:34:49 +01:00
Dietmar Maurer
bb3fc38b2d ISCSIPlugin: improve session parser 2015-11-02 17:12:14 +01:00
Wolfgang Link
0589e5f933 insert the format type at volume_resize
qemu-img needs now the format to resize image.
2015-10-28 11:30:05 +01:00
Wolfgang Bumiller
323ab5baa8 fix bug #769: migrate: use -p on 'zfs send' to include properties 2015-10-15 10:33:34 +02:00
Philipp Marek
0bdf560cff DRBD: Fix typo in comment. 2015-10-15 08:54:48 +02:00
Philipp Marek
046fd4cb61 DRBD: Remove search loop, limit results via the query. 2015-10-15 08:53:08 +02:00
Dietmar Maurer
dc6ff39f57 allow to choose content type for local storage
Also allow to disable local storage.
2015-10-12 06:52:28 +02:00
Dietmar Maurer
79f2b938d4 zfspool: fix volume_size_info and volume_resize for subvols 2015-10-08 09:49:36 +02:00
Dietmar Maurer
68b2c18acd allow containers on lvm 2015-10-01 13:02:13 +02:00
Dietmar Maurer
b70b0c58b3 complete_volume: avoid large list 2015-10-01 10:56:19 +02:00
Dietmar Maurer
f3bd890d98 add missing completion hooks 2015-10-01 07:59:48 +02:00
Dietmar Maurer
bf7aed2674 implement complete_volume 2015-10-01 07:59:48 +02:00
Dietmar Maurer
98437f4c85 add bash completion for content type 2015-10-01 07:16:59 +02:00