Commit Graph

1147 Commits

Author SHA1 Message Date
Wolfgang Link
c4bb4a3d19 Add ip parameter in zfs_request to execute on remote host.
We need this function to delete remote snapshots.
2017-04-28 10:05:27 +02:00
Wolfgang Link
aefe82ea03 Include new storage function volume_snapshot_list.
Returns a list of snapshots (youngest snap first) form a given volid.
It is possible to use a prefix to filter the list.
2017-04-28 10:05:27 +02:00
Wolfgang Link
b76774e57f Include new storage function volume_send.
If the storage backend support import and export
we can send the contend to a remote host.
2017-04-28 10:05:27 +02:00
Fabian Grünbichler
fc1089fc3a fix run_command return code handling 2017-04-10 15:29:29 +02:00
Fabian Grünbichler
c59a0f2452 rbd: fix rados df parser for luminous 2017-03-21 10:13:02 +01:00
Dominik Csapak
f5451f288d remove immutable flag also for subvols on directory storage
or else the removal of such templates (with rootfs size 0) fails

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2017-03-10 09:21:53 +01:00
Fabian Grünbichler
d746da86d8 rbd: fix exit from 'rbd ls -l' parser 2017-02-23 09:22:57 +01:00
Wolfgang Bumiller
b2e430d30f rbd: minor regex fixup 2017-02-20 10:00:57 +01:00
Fabian Grünbichler
292a33fdd4 rbd: fix typo
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2017-02-13 12:13:06 +01:00
Fabian Grünbichler
4db25fa2a6 rbd: use consistent image name schemes
since we allow vm-ID-whatever when allocating images, we
should also include those when listing them.

note: '@' is reserved for snapshots in ceph, so it is safe to
skip lines including an '@' in the image name.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2017-02-13 12:13:06 +01:00
Fabian Grünbichler
53a236f2c5 rbd: use 'rbd ls' without '-l' to find free names
with more than a few images, 'rbd ls -l' gets rather slow
compared to a simple 'rbd ls'. since we only need to check
existing image names for finding a free one, the latter is
sufficient.

example with ~400 rbd images:
$ time rbd ls -p ceph-vm > /dev/null
real    0m0.027s
user    0m0.012s
sys     0m0.008s

$ time rbd ls -l -p ceph-vm > /dev/null
real    0m5.250s
user    0m1.632s
sys     0m0.584s

a linked clone of two disks on the same setup accordingly
also shows a massive speedup:

$ time qm clone 1000 10000 -snap test
create linked clone of drive scsi0 (ceph-vm:vm-1000-disk-2)
clone vm-1000-disk-2: vm-1000-disk-2 snapname test to
vm-10000-disk-1
create linked clone of drive scsi1 (ceph-vm:vm-1000-disk-1)
clone vm-1000-disk-1: vm-1000-disk-1 snapname test to
vm-10000-disk-2

real    0m11.157s
user    0m3.752s
sys     0m1.308s

$ time qm clone 1000 10000 -snap test
create linked clone of drive scsi1 (ceph-vm:vm-1000-disk-1)
clone vm-1000-disk-1: vm-1000-disk-1 snapname test to
vm-10000-disk-1
create linked clone of drive scsi0 (ceph-vm:vm-1000-disk-2)
clone vm-1000-disk-2: vm-1000-disk-2 snapname test to
vm-10000-disk-2

real    0m0.872s
user    0m0.652s
sys     0m0.096s

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2017-02-13 12:13:06 +01:00
Dietmar Maurer
ec73c0ff67 fix bug #1280: Can't locate object method "root@pam"
This was introduced by commit 04a13668b9.
2017-02-12 09:55:50 +01:00
Fabian Grünbichler
086c4bf12b extract_vzdump_config: handle RE consistently
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2017-01-20 11:14:01 +01:00
Fabian Grünbichler
8944339466 weaken matching for vzdump config extract filename
to allow "pvesm extractconfig filename" when in the dump
directory.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2017-01-20 11:13:58 +01:00
Dietmar Maurer
04a13668b9 PVE::Storage: new helper check_volume_access()
Copied from PVE::RPCEnvironment to avoid cyclic dependency
(pve-storgae => pve-access-control => pve-storage).
2017-01-19 09:14:41 +01:00
Dietmar Maurer
ef881e10eb fixes for new PVE::RPCEnvironment implementation
Use PVE::RPCEnvironment->is_worker() instead of
PVE::RPCEnvironment::is_worker().
2017-01-19 09:14:41 +01:00
Wolfgang Bumiller
e438d0940f fix #1252: rbd: delete snapshots when using krbd 2017-01-17 10:32:23 +01:00
Dmitry Petuhov
a4aee43380 Fix RBD resize with krbd option enabled.
With krbd we resize volume and tell QemuSever to notify running QEMU
with zero $size by returning undef.

Signed-off-by: Dmitry Petuhov <mityapetuhov@gmail.com>
2017-01-16 09:14:00 +01:00
Dietmar Maurer
f984732e0e add setup_environment hook to CLIHandler class
and use run_cli_handler instead of depreciated run_cli.
2017-01-12 13:27:43 +01:00
Alexandre Derumier
e2e74320b7 sheepdog : volume_resize return if running
fix : https://forum.proxmox.com/threads/sheepdog-disk-resize-not-working.31760/

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2017-01-09 13:27:11 +01:00
Dominik Csapak
1590fc13bf fix #1099 (again): map cciss/c0d0 to cciss!c0d0
there was still a point where we got the wrong string
on createosd we get the devpath (/dev/cciss/c0d0)

but need the info from get_disks, which looks in /sys/block
where it needs to be cciss!c0d0

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2017-01-05 15:54:11 +01:00
Fabian Grünbichler
afd0afe4f5 fix #1135: always clean up ZFS snapshots on migration
otherwise there are situations where snapshots are left
behind for already sent volumes. also include more warnings.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2017-01-03 11:45:16 +01:00
Dietmar Maurer
46f114a53f storage_migrate: use bs=4k to copy images with dd
The default block size is 512 bytes, and is quite slow. We do not
want to use blocks bigger than 4k, because we want to detect empty
blocks (sparse).
2016-12-24 10:55:31 +01:00
Wolfgang Link
0d28307d2f Add function get_blockdev.
This function will return you the block device of a given partition path.
2016-12-22 12:14:34 +01:00
Wolfgang Link
3196c387d2 Add new function part_num
With this function you get the partnum of a dev.
2016-12-22 12:12:47 +01:00
Dominik Csapak
7b32e2a7cd add crucial smart attribute for wear leveling
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2016-11-30 17:20:09 +01:00
Dominik Csapak
bd54091c2a catch '---' in threshold output of sandisk ssds
sandisk ssds have a default threshold of '---' on nearly all fields,
which prevents our parsing

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2016-11-30 17:19:43 +01:00
Dominik Csapak
2ff3b506a1 use qemu gluster blockdriver for linked clone creation
this works around a bug, where qemu does not align the qcow2 file
when using the filesystem directly, and the gluster blockdriver
refuses to read from it

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2016-11-29 09:40:10 +01:00
Fabian Grünbichler
72bdeea1bf increase default timeout for zpool import
as zpool import can easily take longer than 5 seconds on
systems with lots of disks
2016-11-29 09:30:26 +01:00
Fabian Grünbichler
e2e6380112 improve zpool activate_storage
the old code was way too broad here, this fixes at least the
following issues:
- importing of other/unconfigured zpools by "import -a"
- possible false positives if a pool name is a substring of
  another pool name because of "list" without pool name,
  potentially skipping activation for such pools
- not noticing failure to activate in activate_storage
  because the success of "zpool import -a" does not tell us
  anything about the pool we actually wanted to import

checking specifically for the pool to be activated when
calling "zpool list" gets rid of the second issue, and
trying to import only that pool fixes the other two.
2016-11-29 09:29:33 +01:00
Stefan Priebe
4b7dd9d743 allow --allow-shrink on RBD resize
Signed-off-by: Stefan Priebe <s.priebe@profihost.ag>
2016-11-17 09:06:55 +01:00
Dominik Csapak
571b6f2638 add default rotational value
because if the file does not exist,
we have an perl error for comparing an uninitialized
value

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2016-10-28 10:20:28 +02:00
Dominik Csapak
865bdbd917 use model from udevadm
we want this, because the model in /sys/block/<device>/device/model
is limited to 16 characters

and since the model is not always in the udevadm output (nvme),
also read the model from the model file as fallback

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2016-10-28 10:19:40 +02:00
Dominik Csapak
10a48db55c make dir_is_empty a proper sub
this allows us later to mock the sub,
which we need for testing

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2016-10-28 10:19:40 +02:00
Dominik Csapak
461a9fd8da move directory test into get_sysdir_info
because it logically belongs there, also
this makes the testing easier

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2016-10-28 10:19:40 +02:00
Dominik Csapak
532e89e7be use /sys/block/ path for udev instead of name
since we iterate over the entries in /sys/block
it makes sense to use this path

this should fix #1099
because udevadm does not take
 -n cciss!c0d0 (because it only looks in dev for this)
but takes
 -p /sys/block/cciss!c0d0

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2016-10-28 10:19:40 +02:00
Fabian Grünbichler
8b5ccc06b7 fix #1165: only check mount status when is_mountpoint is set
otherwise the status() method returns garbage for non-mount
point directory storages.
2016-10-13 08:29:30 +02:00
Wolfgang Bumiller
d57fb43d9b disks: fix warnings 2016-10-07 09:28:06 +02:00
Dominik Csapak
a0028cf97e allow rbd images < 1M to be detected
without this, having an efidisk on a ceph storage
prevents creating another disk on the same
ceph storage, because it will not be detected
and we try to allocate one with the same name

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2016-10-07 08:17:40 +02:00
Dominik Csapak
38ddd4ce8e correctly parse cciss devices in get_disks
cciss maps the devices to
/sys/block/cciss!cXdY

and not to

/sys/block/cXdY

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2016-10-06 07:50:05 +02:00
Dominik Csapak
6965a6701e fix #1135: refactor wear level parsing
refactored the wear level parsing into its
own function, where we can now define a
vendor <-> attribute id
mapping

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2016-10-06 07:49:30 +02:00
Dominik Csapak
dd902da78e merge get_smart_data/health
instead of parsing the output of smart in two places,
give get_smart_data a flag if we only want health

this fixes a bug (not on the bugtracker), where
an ssd with disabled smart had an empty string as health
in the gui

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2016-10-06 07:48:57 +02:00
Fabian Grünbichler
c9bd3d22b2 fix #1123: modify NVME device path for SMART support
seems like we need to drop the namespace part before calling
smartctl.

note that NVME devices require smartmontools >= 6.5
2016-10-04 10:35:30 +02:00
Fabian Grünbichler
16bf963b94 add return schema to smart API path 2016-10-04 10:34:47 +02:00
Fabian Grünbichler
dc1311cbe8 fix #1120: non-ATA disks with unstructured smart data
simple parser as fallback for non-ATA disks, just collect
all lines in the "SMART DATA" section.
2016-10-04 10:34:22 +02:00
Fabian Grünbichler
5db2d529ed fix #1120: SCSI SMART health parsing
SCSI disks report their health as "SMART Health Status: OK"
2016-10-04 10:34:06 +02:00
Fabian Grünbichler
7a98a62dbc disks: allow get_disks without smart checks
the smart checks are only needed for the API call(s) that
list all disks and their status, but get_disks is also used
in disk usage checks and in the Ceph code, where the smart
status is completely irrelevant.

drop the implicit skipping of smart checks if $disk is set,
since we have an explicit parameter for this now.
2016-10-04 10:33:49 +02:00
Fabian Grünbichler
1993540bf8 fix #1122: correctly create LUNs for linked clones 2016-09-29 08:42:26 +02:00
Fabian Grünbichler
e3b02ffe6e disks: fix typo 2016-09-29 08:42:15 +02:00
Fabian Grünbichler
1c99955364 disks: parse smart attributes using RE 2016-09-29 08:42:06 +02:00
Fabian Grünbichler
0c486b09df disks: use smartctl -H -A
to only list SMART health and attributes, instead of
"smartctl -a", which prints "all SMART information"
2016-09-29 08:41:31 +02:00
Fabian Grünbichler
acd3d91649 move SMART error handling into get_disks
because we never ever want to die in get_disks because of a
single disk, but the nodes/xyz/disks/smart API path is
allowed to fail if a disk device is unsupported by smartctl
or something else goes wrong.
2016-09-29 08:40:19 +02:00
Wolfgang Bumiller
d547f26c7d Fix #1012: dir storage: add is_mountpoint option
While the mkdir option deals with the case where we don't
want to clobber a mount point with directories (like ZFS,
gluster or NFS), putting a directory storage directly onto a
mount point is still risky:
If the path exists - which it usually does even if not
mounted - the storage will be considered successfully
activated, but empty (or with unexpected content). Some
operations will then lead to unexpected problems: the
free_disk operation for instance only warns if the disk does
not exist, but does not throw an error. In this case the
configuration might be updated without the real disk being
deleted. Once it's mounted back in, later operations which
check existing disks which are not part of the current VM
configuration (like migration) might error unexpectedly.

This adds an 'is_mountpoint' option to directory storages
which assumes the directory is an externally managed mount
point (eg. fstab or zfs) and changes activate_storage() to
throw an error if the path is not mounted.
2016-09-27 09:56:55 +02:00
Wolfgang Bumiller
c7616abcb2 path based storages: improve the mkdir option
So far this only prevented the creation of the toplevel
directory. This does not cover all problem cases,
particularly when said directory is supposed to be a mount
point, including NFS and glusterfs beside ZFS.

The directory based storages we have already use mkpath
whenever they need to create files, and for actions on files
which are supposed to exist it's fine if it errors out.
So it should also be safe to skip the creation of standard
subdirectories in activate_storage().

Additionally NFS and glusterfs storages should also accept
the mkdir option as they otherwise may exhibit similar
issues, eg. when an NFS storage is mounted onto a directory
inside a ZFS subvolume.
2016-09-27 09:54:53 +02:00
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
Dietmar Maurer
37ba0aea5b volume_list: moved code from PVE::API2::Storage::Content
For better code reuse.
2015-10-01 06:50:19 +02:00
Dietmar Maurer
746e530f72 white space cleanups: correctly intend code 2015-10-01 06:28:22 +02:00
Dietmar Maurer
180c8b020c complete_storage: correctly pass storage config to storage_ids() 2015-10-01 06:26:35 +02:00
Alen Grizonic
ba0cf557f4 pvesm list fix 2015-09-29 17:25:05 +02:00
Wolfgang Bumiller
399581a2b3 volume_snapshot_delete: deactivate before deleting 2015-09-25 13:41:04 +02:00
Dietmar Maurer
82548118ec drbd: use correct unit for storage sizes 2015-09-25 13:34:55 +02:00
Thomas Lamprecht
2e346fd478 drbd: return correct used/avail/total sizes
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2015-09-25 13:10:05 +02:00
Wolfgang Link
02e797b8e1 extend functionality to (de)activate_volumes with snapshots
this extension provide the capability to activate or deactivate snapshot,
so we can use this e.g. for LXC backup in snapshot mode.
2015-09-22 12:18:09 +02:00
Dietmar Maurer
f7621c0126 improve bash completions 2015-09-18 09:33:09 +02:00
Dietmar Maurer
c669f42d4e convert pvesm into a PVE::CLI class 2015-09-18 08:22:04 +02:00
Wolfgang Link
c8943a85c9 remove non used parameter exclusive
This makes no sense because it should always be exclusive.
Also RDB checks it self.
LVM has not possibility to use lvchange.
DRBD is this feature not implemented.
2015-09-17 12:37:27 +02:00
Dietmar Maurer
097a2b2fcf fix lvm storage status 2015-09-11 12:13:00 +02:00
Dietmar Maurer
4f6a99d8c7 rbd: make activate_volume idempotent 2015-09-10 11:12:09 +02:00
Wolfgang Link
b50812f941 rbd: skip unmap if device is not mapped 2015-09-10 10:41:54 +02:00
Dietmar Maurer
c2c312175b drbd: also allow to configure content property 2015-09-10 08:41:00 +02:00
Dietmar Maurer
3c05693484 allow to create containers on DRBD (content == rootdir) 2015-09-10 08:29:23 +02:00
Wolfgang Link
515ef80bf5 improve free_image with deactivate_volumes
this is necessary to prevent an error when trying to remove a mapped volume.
2015-09-09 07:09:37 +02:00
Dietmar Maurer
84c8e52da9 use read_proc_mounts from PVE::ProcFSTools 2015-09-03 10:16:38 +02:00
Wolfgang Link
bb5520eb17 move read_proc_mounts from NFSPlugin to Tools.
this function will be uesd in more path of the code.
2015-09-03 10:12:07 +02:00
Wolfgang Bumiller
be48449c28 GlusterfsPlugin: replace Net::Ping with tcp_ping
Using PVE::Network::tcp_ping on port 7 (echo) for ipv6
support.
2015-08-31 15:50:56 +02:00
Wolfgang Bumiller
1689e627a6 iSCSI ipv6 support 2015-08-31 15:50:34 +02:00
Wolfgang Link
9660f71602 fix to prevent uninitialized variable massage. 2015-08-28 11:24:49 +02:00
Dietmar Maurer
48e27f7937 scan_zfs: ignore subvolumes generated by our ZFSPoolPlugin 2015-08-28 11:01:41 +02:00
Wolfgang Bumiller
3932390b11 allow subvolume selection in ZPool storage 2015-08-28 10:56:55 +02:00
Dietmar Maurer
e67069eb58 path: corretly implement path to snapshots 2015-08-27 12:03:46 +02:00
Wolfgang Link
1f79bb07f1 Add content type rootfs to RBD and extend manual 2015-08-26 15:39:09 +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
Wolfgang Bumiller
53ec90e23e upload API: safer filename handling
Replace possibly-dangerous characters in uploaded filenames
with underscores, this includes spaces, colons, commas,
equal signs and any byte >= 128. Previously only spaces were
turned into underscores.

Also shell_quote the destination for scp.

Use '--' for some shell commands for safety.

Use brackets around the scp destination for ipv6 support.
2015-08-18 16:23:53 +02:00
Dietmar Maurer
a6f1262677 parse_volname: document return values 2015-08-12 07:34:58 +02:00
Dietmar Maurer
7800e84d28 parse_volname: always return image format 2015-08-12 07:01:07 +02:00
Dietmar Maurer
55525ad265 ZFSPoolPlugin: improve subvol support
- return format with parse_volname
- consider subvol in zfs_find_free_diskname
2015-08-12 06:49:15 +02:00
Dietmar Maurer
35533c68fb add subvol support for directory storage
This storage type does not support subvol quotas, so we
only allow this if vdisk_alloc is called with size=0.
2015-08-12 06:11:10 +02:00
Dietmar Maurer
dec97937f2 zfs_parse_zvol_list: do not add pool to volname
Else, alloc and list return different volids.
2015-08-10 16:53:19 +02:00
Dietmar Maurer
d73060becd storage_info: fix content filter
List all storages if $content filter is undefined.
2015-08-10 10:05:01 +02:00
Alexandre Derumier
9f20a8a643 rbd: add support to krbd
Can be use by lxc (but also qemu)

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2015-08-07 11:56:40 +02:00
Dietmar Maurer
583c2802f8 storage status API: allow to filter multiple content types 2015-08-07 09:46:49 +02:00
Wolfgang Link
27ff0e99e2 fix bug #664
Catch the error, if the dataset doesn't exists.
If it will not catched, you can't remove a VM.
2015-07-30 11:50:46 +02:00
Wolfgang Bumiller
afdfbe5594 mask world r and group wx permissions in vdisk_alloc
Avoid world-readable disk files being created as suggested
in #416 by setting an umask to strip world permissions as
well as group write/exec permissions before calling
alloc_image.
2015-07-30 08:49:46 +02:00
Dietmar Maurer
13d2cb7980 allow templates using .xz compression 2015-07-01 10:06:24 +02:00
Wolfgang Link
d6d924d0bf Fix ZFSPoolPlugin path for subvol
Signed-off-by: Wolfgang Link <w.link@proxmox.com>
2015-06-22 11:03:11 +02:00
Dietmar Maurer
30a1369b91 drbd: improve error messages 2015-06-19 12:10:45 +02:00
Dietmar Maurer
ae9e512e91 drbd: implement deactivate_volume (but code is disabled for now) 2015-06-18 13:06:30 +02:00
Dietmar Maurer
9913665327 drbd: use old code to wait for diskless assignment 2015-06-18 12:21:44 +02:00
Dietmar Maurer
b0e0ed1abe drbd: remov hack, because bug is fixed upstream
see http://git.drbd.org/gitweb.cgi?p=drbdmanage.git;a=commitdiff;h=8056e58b929673afb2d4a33d82fdeea4d43f8667
2015-06-18 11:55:56 +02:00
Dietmar Maurer
31ba75ff58 drbd: correctly check all result codes 2015-06-18 11:45:04 +02:00
Dietmar Maurer
4959ea20c1 drbd: correctly wait for diskless assignments 2015-06-18 10:43:43 +02:00
Dietmar Maurer
d1e7ac11de drbd: improve workaround for set_drbdsetup_props 2015-06-18 06:21:38 +02:00
Dietmar Maurer
98e250aa41 drbd: call set_drbdsetup_props after auto-deploy
Else it gets not assigned. For some unknown reason, we need to sleep
to avoid a split brain?!
2015-06-17 11:33:49 +02:00
Dietmar Maurer
07af07cc16 drbd: set allow-two-primaries=yes
So that we can do live migrations.
2015-06-17 08:57:32 +02:00
Wolfgang Link
ee302b1caa Fix nfsscan
Signed-off-by: Wolfgang Link <w.link@proxmox.com>
2015-06-10 10:55:06 +02:00
Wolfgang Bumiller
6564419625 include ::1 in localhost check in get_active_server 2015-05-27 08:29:39 +02:00
Wolfgang Bumiller
f8b0d82fe6 NFS: replace rpcinfo with showmounts
rpcinfo from rpcbind-0.2.1 in debian doesn't support ipv6 addresses.
At the same time the used command only actually tests for
portmapper/rpcbind availability, not for NFS directly.
Storage::scan_nfs uses /sbin/showmount to get a list of NFS exports from a
server and happily accepts ipv6 addresses. It is also more specific to NFS.

Replacing the rpcinfo call with showmount here means checking explicitly
for NFS and supporting IPv6 without the need for an updated rpcbind
package.
2015-05-21 11:49:35 +02:00
Wolfgang Bumiller
da63f58832 NFSPlugin: deal with ipv6 addresses and fix regexps
NFS needs brackets around ipv6 addresses.
Also: nfs_is_mounted needs to quote the variables. This becomes apparent
when ipv6 addresses are used as then the address would otherwise be
treated as a character class, causing the check to always fail.
2015-05-21 11:49:21 +02:00
Wolfgang Bumiller
6bf617a954 allow ipv6 addresses in Storage::verify_server
Replaced regex with existing PVE::JSONSchema::verify_... functions.
2015-05-21 11:48:08 +02:00
Dietmar Maurer
69a093c7fd drbd: avoid warning about undefined value 2015-05-18 14:15:35 +02:00
Dietmar Maurer
47dbb901c3 fix typo 2015-05-18 14:12:59 +02:00
Wolfgang Bumiller
c67daeac17 ipv6 support for Storage::resolv_server
While in posix gethostbyname(3) does support ipv6, perl's gethostbyname
usually returns wrong results for names, or no results for ipv6
addresses. Since we provide a getaddrinfo helper already, we now use
that instead.
2015-05-12 10:39:15 +02:00
Wolfgang Link
f5640e7d3b remove running from Storage and check it in QemuServer
It is better to check if a VM is running in QemuServer then in Storage.
for the Storage there is no difference if it is running or not.

Signed-off-by: Wolfgang Link <w.link@proxmox.com>
2015-05-06 11:42:38 +02:00
Dietmar Maurer
1ccae4490e zfspool: new format 'subvol' to handle filesystems inside datasets
We use this for containers.
2015-05-01 14:46:17 +02:00
Dietmar Maurer
4cb6e060c3 correctly parse lxc backup files 2015-05-01 11:29:15 +02:00
Dietmar Maurer
93124ef4fe ZFSPoolPlugin: allow nested datasets 2015-04-30 06:48:39 +02:00
Dietmar Maurer
6d788031b0 add newlines to error messages 2015-04-29 06:59:48 +02:00
Dietmar Maurer
e0852ba7dc whitespace cleanups 2015-04-27 10:44:32 +02:00
Wolfgang Link
3d621977f4 implement offline migration on zfs
Signed-off-by: Wolfgang Link <w.link@proxmox.com>
2015-04-27 10:44:23 +02:00
Dietmar Maurer
466183d677 DRBDPlugin: hack - wait until device is acessible 2015-03-23 12:50:13 +01:00
Dietmar Maurer
28d5851293 DRBDPlugin: automatically create diskless assignments 2015-03-23 11:51:02 +01:00
Dietmar Maurer
fb0e1d93a7 DRBDPlugin: correctly use default redundancy 2015-03-23 09:38:39 +01:00
Dietmar Maurer
d26e1891ff mark drbd as shared storage 2015-03-21 11:20:18 +01:00
Dietmar Maurer
5d6a88b0c4 DRBDPlugin: fix bug in status 2015-03-21 11:02:47 +01:00
Dietmar Maurer
eab90afd46 DRBDPlugin: use Net::DBus 2015-03-21 10:58:06 +01:00
Dietmar Maurer
14770890e2 add dummy for DRBD9 2015-03-20 17:44:15 +01:00
Wolfgang Link
37121146ec fix rpcinfo path
change path in jessie of package rpcbind
from /usr/bin/rpcinfo to /usr/sbin/rpcinfo

Signed-off-by: Wolfgang Link <w.link@proxmox.com>
2015-03-06 10:33:26 +01:00
Wolfgang Link
1f390a3030 fix bug #602: now zfs will wait 5 sec if error msg is "dataset is busy"
Signed-off-by: Wolfgang Link <w.link@proxmox.com>
2015-03-06 10:15:40 +01:00
Pawel Boguslawski
399ab2b605 Fixed LV cleaning function. saferemove_throughput parameter added.
Signed-off-by: Pawel Boguslawski <pawel.boguslawski@ib.pl>
2015-03-06 10:12:52 +01:00
Alexandre Derumier
a8176f5458 rbd: monhost string : escape only ":" character
we need to escape ":" used to defined mon ports

"10.5.0.11:6789; 10.5.0.12:6789; 10.5.0.13:6789"

->

"10.5.0.11\:6789; 10.5.0.12\:6789; 10.5.0.13\:6789"

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2015-03-06 10:10:10 +01:00
Wolfgang Link
82e08809fd change var name to prevent side effects.
Signed-off-by: Wolfgang Link <w.link@proxmox.com>
2015-02-16 11:35:13 +01:00
Wolfgang Link
4eff810db8 Bug-fix alloc_image in ZFSPlugin.pm
Signed-off-by: Wolfgang Link <w.link@proxmox.com>
2015-02-16 11:31:28 +01:00
Wolfgang Link
8a55ff7d39 bug-fix for size output
Signed-off-by: Wolfgang Link <w.link@proxmox.com>
2015-02-12 11:47:45 +01:00
Dietmar Maurer
76fd7dc7c2 ZFSPoolPlugin: use udevadm settle with --exit-if-exists
And silently ignore error if that command fails.
2015-02-12 11:47:45 +01:00
Dietmar Maurer
f824c72250 cleanup error messages 2015-02-12 09:40:17 +01:00
Dietmar Maurer
b3f302c638 call volume_rollback_is_possible from PVE::Storage::volume_snapshot_rollback
That way it is automatically called for all plungins.
2015-02-12 09:28:52 +01:00
Wolfgang Link
1597f1f9ad Storage: add method volume_rollback_is_possible
add method volume_rollback_is_possible and redactor
Improve error handling
If snapshot is not reversible catch it before vm will lock and shutdown.
This is the case if zfs has an younger snapshot.

Signed-off-by: Wolfgang Link <w.link@proxmox.com>
2015-02-12 09:15:02 +01:00
Wolfgang Link
a4034b9f19 zfspoolplugin: fix volume_resize
copy methode volume_resize form ZFSPlugin.pm to ZFSPoolPlugin.pm
refactor volume_resize

Signed-off-by: Wolfgang Link <w.link@proxmox.com>
2015-02-10 12:48:34 +01:00
Wolfgang Link
86d472394a zfs: auto import after reboot
this is necessary, because after a reboot all pools except rpool are gone

Signed-off-by: Wolfgang Link <w.link@proxmox.com>
2015-02-09 12:26:28 +01:00
Wolfgang Link
90a11abe78 ZfsPoolPlugin: fix add disks
now it is possible add disk to an vm on rpool

Signed-off-by: Wolfgang Link <w.link@proxmox.com>
2015-02-09 12:09:43 +01:00
Wolfgang Link
9b61bc9e88 zfs: fix wait by alloc_image
Signed-off-by: Wolfgang Link <w.link@proxmox.com>
2015-01-30 06:24:56 +01:00
Dietmar Maurer
584d97f646 implement zfsscan to list local zfs pools 2015-01-26 09:05:09 +01:00
Dietmar Maurer
0a3d992f72 move activate_storage into ZFSPoolPlugin 2015-01-24 14:30:10 +01:00
Dietmar Maurer
85fda4dd7f rename ZFSDirPlugin to ZFSPoolPlugin
Turned out it makes no sense to duplicated DirPlugin features. So I
also changed the name to make it less confusing. So we can only
create zvols inside a zfs pool with this plugin.
2015-01-24 14:17:55 +01:00
Dietmar Maurer
0a71b39457 zfs: remove useless warning inside clone_image 2015-01-23 12:57:38 +01:00
Wolfgang Link
d3a282e83e zfs: move and refactor code
copy and modify create_base and refactor clone_image

Signed-off-by: Wolfgang Link <w.link@proxmox.com>
2015-01-23 12:57:38 +01:00
Dietmar Maurer
2fc59177c9 zfs: implement zfs_get_latest_snapshot
To improve code sharing.
2015-01-23 12:57:38 +01:00
Wolfgang Link
2b40ffaea9 zfs: move code fix metode call
duplicate code because can't refactor volume_snapshot_rollback

Signed-off-by: Wolfgang Link <w.link@proxmox.com>
2015-01-23 12:57:38 +01:00
Wolfgang Link
d4c63dc147 zfs: move code
move activate_volume deactivate_volume from ZFSPlugin to ZFSDirPlugin

Signed-off-by: Wolfgang Link <w.link@proxmox.com>
2015-01-23 12:57:38 +01:00
Wolfgang Link
f3e632d073 zfs: ZFSDirPlugin add methode path
Signed-off-by: Wolfgang Link <w.link@proxmox.com>
2015-01-23 12:57:38 +01:00
Wolfgang Link
ca04180f3b zfs: move methode list_image
Signed-off-by: Wolfgang Link <w.link@proxmox.com>
2015-01-23 12:57:38 +01:00
Wolfgang Link
e9565df58e zfsdir: implement free_image
Signed-off-by: Wolfgang Link <w.link@proxmox.com>
2015-01-23 12:57:38 +01:00
Wolfgang Link
cc80ed9c00 zfs: move code
move parse_volume from ZFSPlugin to ZFSDirPlugin, to avoid duplication

Signed-off-by: Wolfgang Link <w.link@proxmox.com>
2015-01-23 12:57:38 +01:00
Wolfgang Link
b3ba95e493 zfs: move some code
move the most part of alloc_image to ZFSDirPlugin

Signed-off-by: Wolfgang Link <w.link@proxmox.com>
2015-01-23 12:57:28 +01:00
Dietmar Maurer
52f8fb7191 zfs: remove duplicate $object definition 2015-01-22 10:22:54 +01:00
Dietmar Maurer
b5e5f7e3a8 zfs: move common code to ZFSDirPlugin 2015-01-22 10:10:35 +01:00
Dietmar Maurer
6b5bca68e6 zfs: white space cleanups 2015-01-22 09:45:32 +01:00
Dietmar Maurer
34eaae3f8d zfs: cleanup zfs_get_lu_name 2015-01-22 09:40:22 +01:00
Dietmar Maurer
e8004c9cb7 zfs: cleanup zfs_request 2015-01-22 09:37:52 +01:00
Dietmar Maurer
7730694e54 zfs: make zfs_request a virtual method
So that we can move common code into ZFSDirPlugin class.
2015-01-22 09:29:13 +01:00
Dietmar Maurer
060ef890eb zfsdir: cleanup zfs_parse_size 2015-01-22 07:58:42 +01:00
Dietmar Maurer
5bb8e01076 ZFSDirPlugin: new plugin for local zfs storage
We also want to use this as base class for ZFSPlugin, to increase
code sharing.
2015-01-22 07:54:10 +01:00
Alexandre Derumier
3fad260379 rbd, zfs, sheepdog: bugfix : fix alloc_image if name is specified
Currently vmstate snapshot with rbd have wrong name,
because rbd alloc_image don't care if $name is provided

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2014-11-21 08:03:08 +01:00
Michael Rasmussen
b200cefd06 fix modification of read only bug
Signed-off-by: Michael Rasmussen <mir@datanom.net>
2014-10-25 09:46:28 +02:00
Stoyan Marinov
187ca53927 Add transport option for glusterfs storage
Signed-off-by: Stoyan Marinov <stoyan@marinov.us>
2014-10-17 09:29:18 +02:00
Dietmar Maurer
e384c898d3 allow iso upload for glusterfs 2014-09-10 14:15:11 +02:00
Dietmar Maurer
a66159e356 glusterfs: new option server2 to specify backup volfile server 2014-08-27 11:29:36 +02:00
Stefan Priebe
44c3689afc RBD: enable clone of snaps
Signed-off-by: Stefan Priebe <s.priebe@profihost.ag>
2014-07-17 08:04:12 +02:00
Stefan Priebe
f90a0a20e7 rbd: unprotect snapshots before deletion
Signed-off-by: Stefan Priebe <s.priebe@profihost.ag>
2014-07-17 08:00:34 +02:00
Stefan Priebe
7bbc40045a pass snapname to vdisk_clone and plugin clone_image
Signed-off-by: Stefan Priebe <s.priebe@profihost.ag>
2014-07-17 07:59:49 +02:00
Dietmar Maurer
63da6d7983 cleanups 2014-07-17 07:59:13 +02:00
Stefan Priebe
f236eaf80e Storage Plugins: extend clone_image by snap parameter and add support to RBDPlugin
Signed-off-by: Stefan Priebe <s.priebe@profihost.ag>
2014-07-17 07:54:36 +02:00
Stefan Priebe
2362bc8798 fix ' escaping of $snap parameter
Signed-off-by: Stefan Priebe <s.priebe@profihost.ag>
2014-07-17 07:38:43 +02:00
Dietmar Maurer
c97c5b3b0b coding style cleanup 2014-07-17 07:37:23 +02:00
Stefan Priebe
c693f74953 ceph/rbd: has a pretty strange error handling - install custom run_command function
Always use a custom error sub to get the real errors out of rbd command instead of the typical:

 2014-02-06 11:20:20.187190 7f3b6c37c760 -1 librbd: removing snapshot from header failed: (16) Device or resource busy

before:
rbd: snapshot 'abc' is protected from removal.
TASK ERROR: rbd snapshot vm-173-disk-1' error: 2014-02-06 11:06:02.438336 7f6f4ac92760 -1 librbd: removing snapshot from header failed: (16) Device or resource busy

now:
TASK ERROR: rbd: snapshot 'abc' is protected from removal.

Signed-off-by: Stefan Priebe <s.priebe@profihost.ag>
2014-07-17 07:26:09 +02:00
Chris Allen
a315b9ff56 Added code to abort a snapshot rollback in ZFS if the snapshot selected is not the most recent. This is to avoid lu deletion when trying to rollback to a snapshot that isn't the newest.
Signed-off-by: Chris Allen <Chris Allen>
2014-06-25 09:14:03 +02:00
Chris Allen
454c15e270 Added target-group and host-group options for ZFS comstar views. Use "comstar_tg" and "comstar_hg" in "/etc/pve/storage.pm".
Signed-off-by: Chris Allen <Chris Allen>
2014-06-25 09:13:54 +02:00
Chris Allen
551534a3bc Fixed Istgt LUN Options handling.
Signed-off-by: Chris Allen <Chris Allen>
2014-06-25 09:13:45 +02:00
Chris Allen
c521e801ae Fixed command substitution and output redirection in Istgt module to work in csh - the default shell in FreeBSD. Changed Istgt "restart" to "onerestart". This way a running istgt daemon will always restart whether or not it is enabled in rc.conf.
Signed-off-by: Chris Allen <Chris Allen>
2014-06-25 09:13:31 +02:00
Chris Allen
70986fd9e4 Added "nowritecache" option to ZFS storage plugin. Turns off write caching on Comstar and Istgt LUNs created by the plugin. Has no effect on IET, as IET always uses write-through caching for blockio volumes not in read-only mode.
Signed-off-by: Chris Allen <Chris Allen>
2014-06-25 09:13:03 +02:00
Chris Allen
a9bd7bdfdc Added sparse zvol support to ZFS.
To enable, add "sparse" to the ZFS storage section, you wish to use it on, in "/etc/pve/storage.pm"

Signed-off-by: Chris Allen <Chris Allen>
2014-06-25 09:11:49 +02:00
Pablo Ruiz Garcia
5e4791804c Improve parsing of zfs volumes (ZVOLs) in order to avoid filtering of zvols nested under another ZFS dataset.
The actual code would only accept zvols like: POOL/vm-123-disk-1.
However, using POOL/DataSet/vm-123-disk-1 allows setting specific
proparties at POOL/DataSet level (like compression, etc.) which
would be inherited by any zvol created under such DataSet.

This allows more flexibility of zfs/zvol's management.

Signed-off-by: Pablo Ruiz García <pablo.ruiz@gmail.com>
2014-02-27 06:21:38 +01:00
Alexandre Derumier
76f60be802 update sheepdog storage module to 0.8
- collie command is now 'dog'
- KB size is now k
- snapshot rollback need force -f flag, to avoid confirm prompt

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2014-01-28 07:06:13 +01:00
Alexandre Derumier
db7922dcef glusterfs : create volume through gluster block driver instead fuse mount point
forum user report slow qcow2 volume create with preallocated metadatas
http://forum.proxmox.com/threads/17471-GlusterFS-amp-Proxmox-Future-amp-QCOW2-Issues

(note that I can't reproduce it with qemu 1.7)

But redhat bugzilla have an entry about possible problem with volume is create through mount point.
https://bugzilla.redhat.com/show_bug.cgi?id=895830

So,It's better to manage it through gluster block driver directly.

(We need only the mount point to create directory and list images files)

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2014-01-16 09:38:03 +01:00
Michael Rasmussen
3b219e8037 Use ssh key stored in pmxcfg. Use ssh -i /etc/pve/priv/zfs/portal_id_rsa for remote commands
Signed-off-by: Michael Rasmussen <mir@datanom.net>
2013-10-23 06:26:30 +02:00
Michael Rasmussen
86f00da603 Code clean up. Fix wrong indentation.
Signed-off-by: Michael Rasmussen <mir@datanom.net>
2013-10-23 06:26:26 +02:00
Dietmar Maurer
dda2651943 install Iet.pm 2013-10-21 06:14:43 +02:00
Michael Rasmussen
78a64432ff Added support for iSCSI Enterprise Target Daemon (iet) iscsitarget used in Linux distributions.
Signed-off-by: Michael Rasmussen <mir@datanom.net>
2013-10-21 06:13:35 +02:00
Michael Rasmussen
099925e4ba Code clean up
Signed-off-by: Michael Rasmussen <mir@datanom.net>
2013-10-21 06:13:05 +02:00
Dietmar Maurer
b1045cc2ca add missing Makefile to install LunCmd/ modules 2013-10-18 09:41:16 +02:00
Michael Rasmussen
a62d1e992d Module to support istgt lun commands Istgt is used on any *BSD. As of FreeBSD 10 it seems FreeBSD will provide thier own native replacement.
Signed-off-by: Michael Rasmussen <mir@datanom.net>
2013-10-18 09:34:36 +02:00
Michael Rasmussen
ee31ad019c Comstar lun commands moved to separate module
Signed-off-by: Michael Rasmussen <mir@datanom.net>
2013-10-18 09:34:12 +02:00
Michael Rasmussen
a7d56be676 Prepare for adding support for istgt and openiscsi Refactor code. Move any LUN related to proper LUN module.
Signed-off-by: Michael Rasmussen <mir@datanom.net>
2013-10-18 09:33:56 +02:00
Michael Rasmussen
1fca146493 Fixes bug in calculating pool size
Signed-off-by: Michael Rasmussen <mir@datanom.net>
2013-10-14 07:21:08 +02:00
Alexandre Derumier
7ecc43edac remove nexenta plugin
zfs plugin is better and faster and backward compatible

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2013-10-08 06:13:09 +02:00
Michael Rasmussen
98735f827a Remove unused functionality
Signed-off-by: Michael Rasmussen <mir@datanom.net>
2013-10-03 07:32:07 +02:00
Dietmar Maurer
5332e6c97e code cleanups for ZFSPlugin 2013-10-02 06:54:56 +02:00
Michael Rasmussen
4f914e6ec0 Added support for ZFS Storage Plugin
example of storage.cfg

zfs:    omnios
        blocksize 8k
        target iqn.2010-09.org.openindiana:target1
        pool pool1
        iscsiprovider comstar
        portal 192.168.0.1
        sudo 1  (optionnal)
        content images

note for fast ssh login:
on solaris  host :

/etc/ssh/sshd_config

LookupClientHostnames no
VerifyReverseMapping no
GSSAPIAuthentication no

note for nexenta:

rm /root/.bash_profile

to avoid to go in nmc console by default

Signed-off-by: Michael Rasmussen <mir@datanom.net>
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2013-10-02 06:37:18 +02:00
Dietmar Maurer
ffd6f2f3ab use warnings instead of global -w flag 2013-10-01 13:08:43 +02:00
Dietmar Maurer
35fbb2e645 new helper abs_filesystem_path()
Returns the absolute path for a <volid>. Also activates storage if possible.
2013-10-01 12:29:39 +02:00
Alexandre Derumier
ec4b0dc781 storage: add parse_volname
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2013-10-01 11:19:00 +02:00
Dietmar Maurer
452e3ee780 bug fix: use filesysetm_path for LVM/iSCSI storage
So that the genrice Storage::Plugin code works again (get_subdir() fails on
this type of storage).
2013-09-19 06:41:51 +02:00
Dietmar Maurer
08480ce768 introduce new method filesystem_path()
If a plugin overwrites method path() to return optimized setting for qemu,
it can now still use the generic methods from PVE::Storage::Plugin which works
on file system paths (for example the glusterfs plugin).
2013-09-17 09:05:17 +02:00
Dietmar Maurer
5f25af2f93 avoid nested parameter exception 2013-09-04 13:43:59 +02:00
Dietmar Maurer
8e87d6eef0 auto-detect format for files with vmdk extension 2013-09-04 10:18:50 +02:00
Dietmar Maurer
a18f774079 return error if volume does not exists 2013-09-04 10:17:47 +02:00
Dietmar Maurer
3cf5e19edc API: add scan method for glusterfs 2013-08-13 10:06:03 +02:00
Dietmar Maurer
1a3459ac78 delete trailing white-space 2013-08-12 11:56:41 +02:00
Alexandre Derumier
f4648aef06 add Glusterfs Plugin
storage.cfg
------------
glusterfs: glusterstore
       path /mnt/pve/gluster
       server server.fqdn  (optional, default is localhost)
       volume glustervolume
       content images
       maxfiles 1

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2013-08-12 11:55:06 +02:00
Alexandre Derumier
9165b0153e sheepdog : fix create_base with storeid !='sheepdog'
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2013-06-24 10:07:46 +02:00
Alexandre Derumier
9538d0475a sheepdog: fix find_next_volume with storeid != 'sheepdog', find display volume size
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2013-06-24 10:07:33 +02:00
Stefan Priebe
a8c3f8f6ac --format is deprecated
Signed-off-by: Stefan Priebe <s.priebe@profihost.ag>
2013-06-04 13:09:02 +02:00
Stefan Priebe
8cc610093b be more verebose on rbd commands to get progress
Signed-off-by: Stefan Priebe <s.priebe@profihost.ag>
2013-05-31 11:50:41 +02:00
Alexandre Derumier
0b79e98ccb nexenta: nexenta_get_zvol_size : parse result to avoid tainted value
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2013-05-28 12:39:09 +02:00
Dietmar Maurer
c55a499dfe nexenta: skip disks whith no owner
We also do this for LVM. Else I get:

> qm rescan --vmid 100
Use of uninitialized value $owner in string ne at /usr/share/perl5/PVE/Storage/NexentaPlugin.pm line 356.
2013-05-27 06:40:37 +02:00
Dietmar Maurer
72d9f66e51 nexenta: disable ssl_opt verify_hostname
Else we are unable to connect to the server when using ssl.
2013-05-24 14:53:40 +02:00
Dietmar Maurer
12c2fe32e1 bump version to 3.0-6 and fix bug from previous commit 2013-05-14 11:26:23 +02:00
Alexandre Derumier
3e29c0f229 rbd : clone volume to same pool that base volume
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2013-05-14 10:04:01 +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
7acee37a30 since wheezy, iscsiadm -m session throw an error code if no session exist.
So we can't bring up the iscsi storage

This patch is based on the patch submitted by Alexandre, but we only
suppress error messages when there are no active sessions. Other errors still
trigges an exceptions.
2013-05-13 08:00:16 +02:00
Alexandre Derumier
38e6ec3fbd rbd: sub path: add snapname argument
needed for qemu-img convert from src snapshot

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2013-05-02 06:34:55 +02:00
Alexandre Derumier
24cec3aa77 sheepdog: sub path: add snapname argument
needed for qemu-img convert from src snapshot

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2013-05-02 06:34:32 +02:00
Alexandre Derumier
207ea85267 storage : sub path: add snapname argument
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2013-05-02 06:33:33 +02:00
Stefan Priebe
8897f5dcc5 rbd -p parameter is only valid for the src (see man). Add the pool to the target as well.
Signed-off-by: Stefan Priebe <s.priebe@profihost.ag>
2013-04-22 06:17:15 +02:00
Dietmar Maurer
87cf5d409c use integer size in rbd size parameter 2013-03-25 12:55:09 +01:00
Dietmar Maurer
d6c9dc34af file upload: fix race condition
bump version to 2.3-6
2013-03-04 09:00:27 +01:00
Dietmar Maurer
df6b79c892 fix permission check for backup file removal 2013-03-01 06:04:03 +01:00
Dietmar Maurer
b8744249a2 fix access rights
Try to use $rpcenv->check_volume_access() everywhere.
2013-02-28 10:15:44 +01:00
Alexandre Derumier
1440604a4b rbd : rework pool - username - auth_supported options
pool is now optional, default value is 'rbd';
username is now optional, default value is 'admin';

auth_supported option is removed and is autodetected.
  auth = cephx if private key exist
  auth = none if private key does not exist

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2013-02-18 06:32:57 +01:00
Alexandre Derumier
5649ccfe89 has_feature : template
for plugin-rbd-sheepdog-nexenta

+ indentation fix

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2013-02-18 06:18:15 +01:00
Alexandre Derumier
2c5a70971a has_feature : fix key = snap
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2013-02-15 10:08:04 +01:00
Alexandre Derumier
7e8c6888b2 iscsi : has_feature : copy
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2013-02-15 07:28:25 +01:00
Alexandre Derumier
39ab682a68 iscsidirect : has_feature : copy
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2013-02-15 07:28:15 +01:00
Alexandre Derumier
9bb4abf6a6 lvm : has_feature : copy
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2013-02-15 07:28:03 +01:00
Alexandre Derumier
74158ff3b9 nexenta : has_feature : copy
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2013-02-15 07:27:51 +01:00
Alexandre Derumier
62ebea1e56 sheppdog : has_feature : copy
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2013-02-15 07:27:37 +01:00
Alexandre Derumier
0255ee5fda rbd : has_feature : copy
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2013-02-15 07:27:27 +01:00
Alexandre Derumier
22b8cf9731 plugin : has_feature : copy
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2013-02-15 07:27:07 +01:00
Alexandre Derumier
9bc7fa7ad2 nexenta : has_feature : clone base
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2013-02-14 11:11:36 +01:00
Alexandre Derumier
7516817760 sheepdog : has_feature : clone base
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2013-02-14 11:11:21 +01:00
Alexandre Derumier
1e7ae58194 rbd : has_feature : clone from base
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2013-02-14 11:10:51 +01:00
Alexandre Derumier
dc4f2cb33d plugin : has_feature : clone from base + fix
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2013-02-14 11:10:23 +01:00
Alexandre Derumier
201345af42 nexenta : volume_snapshot_delete : parse_volname
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2013-02-14 10:34:41 +01:00
Alexandre Derumier
851dc88088 nexenta : volume_snapshot_rollback : parse_volname
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2013-02-14 10:34:18 +01:00
Alexandre Derumier
1e507a72f9 nexenta : volume_snapshot : parse_volname
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2013-02-14 10:34:10 +01:00
Alexandre Derumier
d6a30aa259 nexenta : volume_resize : parse_volname
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2013-02-14 10:33:58 +01:00
Alexandre Derumier
d2befd94be nexenta : volume_size_info : parse_volname
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2013-02-14 10:33:43 +01:00
Alexandre Derumier
74822cd72d nexenta : free_image
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2013-02-14 10:33:33 +01:00
Alexandre Derumier
2e910a0e3a nexenta : list_images
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2013-02-14 10:32:55 +01:00
Alexandre Derumier
324679682e nexenta : clone_image
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2013-02-14 10:31:39 +01:00
Alexandre Derumier
1c0097dd51 nexenta : create_base
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2013-02-14 10:31:29 +01:00
Alexandre Derumier
5b29d458f4 nexenta : find_free_diskname
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2013-02-14 10:26:05 +01:00
Alexandre Derumier
1a259abc18 nexenta : nexenta_list_zvol : parse base volumes
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2013-02-14 10:25:04 +01:00
Alexandre Derumier
e7b2953b2f nexenta : parse_volname
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2013-02-14 10:23:44 +01:00
Alexandre Derumier
d99eee9399 sheepdog : volume_snapshot_delete : parse_volname
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2013-02-14 10:22:28 +01:00
Alexandre Derumier
b8f4f5be20 sheepdog : volume_snapshot_rollback : parse_volname
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2013-02-14 10:22:17 +01:00
Alexandre Derumier
d719effa9b sheepdog : volume_snapshot : parse_volname
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2013-02-14 10:22:02 +01:00
Alexandre Derumier
fddfc53873 sheepdog : volume_resize : parse_volname
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2013-02-14 10:21:49 +01:00
Alexandre Derumier
61b8ccc917 sheepdog : volume_size_info: parse_volname
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2013-02-14 10:21:30 +01:00
Alexandre Derumier
b22af8eee9 sheepdog : list_images
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2013-02-14 10:21:04 +01:00
Alexandre Derumier
b2f975cf1e sheepdog : free_image : parse volname
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2013-02-14 10:20:33 +01:00
Alexandre Derumier
87157341ad sheepdog : clone_image
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2013-02-14 10:19:20 +01:00
Alexandre Derumier
8a3c8d0e59 sheepdog : create_base
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2013-02-14 10:18:51 +01:00
Alexandre Derumier
19860f5bae sheepdog : find_free_diskname
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2013-02-14 10:18:17 +01:00
Alexandre Derumier
a602d95758 sheepdog : sheepdog_snapshot_ls : fix
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2013-02-14 10:17:27 +01:00
Alexandre Derumier
a76d3c973f sheepdog : sheepdog_ls : parse base volumes
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2013-02-14 10:17:06 +01:00
Alexandre Derumier
648095a9db sheepdog : parse_volname
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2013-02-14 10:16:23 +01:00
Alexandre Derumier
c78cb110e7 rbd : volume_snapshot_delete : parse_volname
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2013-02-14 09:47:27 +01:00
Alexandre Derumier
c6ce2cc8ec rbd : volume_snapshot_rollback : parse_volname
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2013-02-14 09:47:02 +01:00
Alexandre Derumier
9af33ed0b9 rbd : volume_snapshot : parse volname
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2013-02-14 09:46:38 +01:00
Alexandre Derumier
478fc06cd5 rbd: volume_resize : parse_volname
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2013-02-14 09:46:08 +01:00
Alexandre Derumier
81d1d01774 rbd: volume_size_info : parse_volname
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2013-02-14 09:45:51 +01:00
Alexandre Derumier
42d07b9ab3 rbd : free_image : unprotect snapshot is base
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2013-02-14 09:40:26 +01:00
Alexandre Derumier
5b9b9b1449 rbd: fix: move find_free_diskname + fix trailing whitespace
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2013-02-14 09:38:19 +01:00
Alexandre Derumier
f27082855d rbd : clone_image
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2013-02-14 09:37:16 +01:00
Alexandre Derumier
992e6835e2 rbd : create_base
- rename volume
- take snapshot '__base__'
- protect the snapshot

Fix: the volume_snapshot sub need a $running parameter,
to known if it need to use rbd command or qmp command to take the snapshot.
for now, I pass undef, as it should be always offline.

(But we need to verify somewhere that vm is not running,
because take a snapshot with rbd command on a running vm can break it.

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2013-02-14 09:35:55 +01:00
Alexandre Derumier
8b3ae5180b rbd : find_free_diskname
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2013-02-14 09:18:47 +01:00
Alexandre Derumier
ca1e168ad3 rbd : rbd_ls : parse base
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2013-02-14 08:58:49 +01:00
Alexandre Derumier
d04c7e55a8 rbd : parse_volname : parse base
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2013-02-14 08:52:22 +01:00
Dietmar Maurer
ff00afd7fb vmid is integer an can be 0, so we need to use defined() to check if it is set
Note: The plan is to use vmid 0 to mark shared volumes.
2013-02-14 08:41:15 +01:00
Alexandre Derumier
f104d1dd07 storage : vdisk_free : eval parse_volname
If the storage have some customs volumes name, vdisk_free will hang

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2013-02-14 08:36:44 +01:00
Dietmar Maurer
7fc619d5d3 use File::chdir instead of Cwd
To avoid errors in taint mode.
2013-02-14 06:53:48 +01:00
Dietmar Maurer
32437ed279 check base image use count inside vdisk_free
To make it work with all storage types.
2013-02-01 06:55:39 +01:00
Dietmar Maurer
c803c3963c use chattr to set immutable flag on base images 2013-01-31 11:52:31 +01:00
Dietmar Maurer
a7f3d90919 free_image: correctly check if base volume is not used
moved parse_volume_id to PVE::Storage::Plugin::parse_volume_id
2013-01-31 11:36:49 +01:00
Dietmar Maurer
188aca388e return the volid, not the storage path 2013-01-31 08:47:27 +01:00
Dietmar Maurer
ad27ee3e4a new method volume_is_base() to check if volume is a base volume 2013-01-31 08:42:26 +01:00
Dietmar Maurer
fcbec6545b fix path_to_volume_id to work with base volumes and clones 2013-01-31 08:14:55 +01:00
Dietmar Maurer
5eab0272f0 add stubs for create_base and cone_image 2013-01-31 07:47:02 +01:00
Dietmar Maurer
2502b33b08 implement vdisk_clone and vdisk_create_base
This is an iplementation for file base storage types.

changes compared to patches from Alexandre:

* use correct locking
* private find_free_diskname() with bug fixes
* changed names of new methods
* always refer to base volumes in volume names

Example volume names:

local:6000/base-6000-disk-9.raw
local:6000/base-6000-disk-9.raw/7000/vm-7000-disk-9.qcow2
local:6000/base-6000-disk-9.raw/7000/base-7000-disk-10.qcow2
2013-01-30 12:55:37 +01:00
Stefan Priebe
249cb64756 RBDPlugin: introduce rbd_unittobytes / rbd tends to be human readable
Signed-off-by: Stefan Priebe <s.priebe@profihost.ag>
2013-01-22 11:14:57 +01:00
Alexandre Derumier
166196ac10 create rbd volume with format v2
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2013-01-03 11:44:38 +01:00
Alexandre Derumier
7cb2889abb rbd: use rbd ls -l
avoid to call rbd info for each volume

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2013-01-03 11:44:24 +01:00
Alexandre Derumier
cbc6fef357 iscsidirect : has_feature
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2012-12-28 07:53:25 +01:00
Alexandre Derumier
852a55f7d2 iscsi : has_feature
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2012-12-28 07:53:09 +01:00
Alexandre Derumier
f7d4064fec lvm: has_feature
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2012-12-28 07:53:00 +01:00
Alexandre Derumier
767132f72a nexenta: has_feature
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2012-12-28 07:52:52 +01:00
Alexandre Derumier
c0235499b3 sheepdog : has_feature
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2012-12-28 07:52:43 +01:00
Alexandre Derumier
774f21b9ee rbd : has_feature
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2012-12-28 07:52:33 +01:00
Alexandre Derumier
f884fe1125 plugin : has_feature
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2012-12-28 07:52:20 +01:00
Alexandre Derumier
99473759b2 storage : has_feature
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2012-12-28 07:50:48 +01:00
Dietmar Maurer
e8acaa3c0d fix typo 2012-12-17 11:50:22 +01:00
Dietmar Maurer
a22854e540 also list vma backup archives
bump version to 2.3-1
2012-12-13 12:51:52 +01:00
Alexandre Derumier
73b6f89b3c sheepdog : fix volume_size_info && parentid check
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2012-12-12 13:29:09 +01:00
Alexandre Derumier
ba4ee9ba25 sheepdog : retrieve parent of a clone
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2012-11-22 06:58:14 +01:00
Alexandre Derumier
62b98a65b5 rbd: retrieve parent of a clone
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2012-11-22 06:58:03 +01:00
Alexandre Derumier
4d4f734eea nexenta: retrieve parent of a clone
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2012-11-22 06:57:53 +01:00
Alexandre Derumier
73b7847e53 files: retrieve parent of a clone
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2012-11-22 06:57:38 +01:00
Dietmar Maurer
3f13fd7dc3 remove timeouts from 'qemu-img snapshot' commands.
Those commands can take several minutes on larger files.
2012-11-02 08:52:50 +01:00
Alexandre Derumier
3cb217030a sheepdog : delete snapshots when deleting volume
sheepdog don't delete snapshots automatically when deleting volume

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2012-10-31 14:06:55 +01:00
Alexandre Derumier
c30470a35e rbd: purge snapshots before delete volume
we can't delete a rbd volume if snapshots exist

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2012-10-31 14:06:42 +01:00
Stefan Priebe
45c2ee3526 PVE/API2/Storage/Status: remove hardcoded blowfish cipher PVE/Storage: remove hardcoded blowfish cipher
Signed-off-by: Stefan Priebe <s.priebe@profihost.ag>
2012-10-31 14:05:40 +01:00
Alexandre Derumier
e110213e71 rbd: get volume size for volumes list
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2012-10-17 10:30:41 +02:00
Alexandre Derumier
6958944439 rbd: add storage space stats
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2012-10-17 06:34:25 +02:00
Dietmar Maurer
6bcc16d70e create 'dump' directory if storage contains containers
This is needed by openvz migrate to store state.
2012-10-02 13:36:52 +02:00
Dietmar Maurer
045ae0a7fe code cleanup 2012-09-20 07:18:59 +02:00
Alexandre Derumier
1e679ac591 qcow2 : preallocate metadatas at file creation
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2012-09-20 07:11:43 +02:00
Dietmar Maurer
1059cc994d use longer timeouts for snapshot commands 2012-09-19 08:55:23 +02:00
Dietmar Maurer
2103bd20ef nexenta: implement status 2012-09-19 08:39:25 +02:00
Dietmar Maurer
8914a711eb nexenta: use import_lu on rollback
To avoid generation of new GUID.
2012-09-19 08:16:58 +02:00
Dietmar Maurer
ac4329f3d8 nexenta: fix parse_volname
And some coding style cleanups.
2012-09-19 07:38:40 +02:00
Dietmar Maurer
2570fb94e8 nexenta: recursively delete all snapshots on vdisk_free 2012-09-17 10:32:09 +02:00
Dietmar Maurer
88a2b8c79e nexenta: fix parameter for create_snapshot 2012-09-17 10:26:21 +02:00
Dietmar Maurer
4b0dea6c82 nexenta API cleanups
remove all uncommented sleep calls (will add them later if required). Use
new nexenta_request() syntax. Also removed strangs eval{} sections which
hide errors.
2012-09-17 10:12:36 +02:00
Dietmar Maurer
d6eee582dc nexenta: correctly get volsize (needs extra API call) 2012-09-17 07:58:20 +02:00
Dietmar Maurer
27cc55d4fb fix typo 2012-09-07 12:59:26 +02:00
Alexandre Derumier
b2c1ab4bd6 iscsidirect : add volume_snapshot_delete
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2012-09-06 10:37:41 +02:00
Alexandre Derumier
f57e796b9a lvm: add volume_snapshot_delete
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2012-09-06 10:37:39 +02:00
Alexandre Derumier
5d8f5e22b9 nexenta: add volume_snapshot_delete
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2012-09-06 10:37:36 +02:00
Alexandre Derumier
9cd89ee32f sheepdog: add volume_snapshot_delete
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2012-09-06 10:37:33 +02:00
Alexandre Derumier
cce29bcd6b rbd : add volume_snapshot_delete
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2012-09-06 10:37:30 +02:00
Alexandre Derumier
6000a061e9 plugin: add volume_snapshot_delete
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2012-09-06 10:37:27 +02:00
Alexandre Derumier
5753c9d1b6 storage : add volume_snapshot_delete
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2012-09-06 10:37:24 +02:00
Alexandre Derumier
9f02df8359 iscsidirect : add volume_snapshot_rollback
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2012-09-06 10:37:22 +02:00
Alexandre Derumier
051e85b827 lvm : add volume_snapshot_rollback
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2012-09-06 10:37:19 +02:00
Alexandre Derumier
4c6c642353 nexenta: add volume_snapshot_rollback
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2012-09-06 10:37:14 +02:00
Alexandre Derumier
948b2e22ce sheepdog : add volume_snapshot_rollback
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2012-09-06 10:37:12 +02:00
Alexandre Derumier
5a2b2e2f14 rbd: add volume_snapshot_rollback
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2012-09-06 10:37:08 +02:00
Alexandre Derumier
41dffa853d plugin : add volume_snapshot_rollback
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2012-09-06 10:37:04 +02:00
Alexandre Derumier
22a2a633c4 storage: add volume_snapshot_rollback
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2012-09-06 10:37:01 +02:00
Alexandre Derumier
ec409fb48b iscsidirect : add volume_snapshot
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2012-09-06 10:36:58 +02:00
Alexandre Derumier
33818d1604 lvm: add volume_snapshot
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2012-09-06 10:36:56 +02:00
Alexandre Derumier
5223286c26 nexenta: add volume_snapshot
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2012-09-06 10:36:53 +02:00
Alexandre Derumier
788dd8e182 rbd : add volume_snapshot
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2012-09-06 10:36:50 +02:00
Alexandre Derumier
50a19c0987 sheepdog : add volume_snapshot
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2012-09-06 10:36:46 +02:00
Alexandre Derumier
7dcb06977e plugin : add volume_snapshot
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2012-09-06 10:36:43 +02:00
Alexandre Derumier
db60719cde storage : add volume_snapshot
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2012-09-06 10:36:40 +02:00
Alexandre Derumier
034e4411bf nexenta: fix lun number parsing in sub path
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2012-08-22 12:25:13 +02:00
Alexandre Derumier
0f94c1c938 nexenta: ssl option is optionnal
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2012-08-20 13:08:42 +02:00
Alexandre Derumier
120ca009d6 nexenta: add ssl option and clean errors handling
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2012-08-20 13:08:28 +02:00
Alexandre Derumier
4f01611d13 nexenta : add nodes and disable options
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2012-08-20 13:07:02 +02:00
Alexandre Derumier
911ce8504f sheepdog : add nodes and disable options
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2012-08-20 13:06:52 +02:00
Alexandre Derumier
35d6dfaf9e rbd: add nodes and disable options
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2012-08-20 13:06:36 +02:00
Alexandre Derumier
69971d8bae nexenta: volume_resize
resize volume using nexenta api. (online or offline).

we can't use qmp block_resize with libiscsi to online update disk size in guest (throw error), so return undef;

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2012-08-07 08:09:19 +02:00
Alexandre Derumier
9ffffc2e24 sheepdog : volume_resize
use collie command to resize disk (online or offline).

we can't use qmp block_resize to online resize size in guest (throw error) , so return undef.

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2012-08-07 08:09:16 +02:00
Alexandre Derumier
e7a42a764e rbd : volume_resize
resize disk with rbd command if vm is offline
otherwise we can use qmp block_resize if vm is online

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2012-08-07 08:09:14 +02:00
Alexandre Derumier
3bac137c9f ISCSIDirect : volume_resize
die as we can't resize scsi device plugins

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2012-08-07 08:09:11 +02:00
Alexandre Derumier
0244a7b9c6 ISCSIPlugin : volume_resize
die as we can't resize iscsi devices

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2012-08-07 08:09:09 +02:00
Alexandre Derumier
530defb603 lvmplugin : volume_resize
resize the lvm device (online or offline)

return 1 to use qmp block_resize to online update size in guest

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2012-08-07 08:09:06 +02:00
Alexandre Derumier
81f5058c01 plugins : add volume_resize
this add qemu-img resize for file devices (raw - qcow2) if vm is offline.

otherwise we need to use online qmp block_resize

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2012-08-07 08:09:03 +02:00
Alexandre Derumier
7e6c05dc2c Storage : add global volume_resize
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2012-08-07 08:09:00 +02:00
Alexandre Derumier
6f714585f2 ISCSIDirect : volume_size_info
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2012-08-06 06:10:21 +02:00
Alexandre Derumier
3a0c324642 ISCSIDirect : fixes and cleanup
-use "lunX" for volume name.
previously it was only the lun number, and it conflict with current syntax to disk alloc disk size.

-scsi-ls return size in Gb, so we need to convert to bytes

-small cleanups

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2012-08-06 06:10:16 +02:00
Alexandre Derumier
60301ee037 nexenta: volume_size_info
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2012-08-06 06:10:13 +02:00
Alexandre Derumier
c95c307373 rbd : volume_size_info
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2012-08-06 06:10:10 +02:00
Alexandre Derumier
c732d5dbac sheepdog : volume_size_info
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2012-08-06 06:10:06 +02:00
Alexandre Derumier
a1301c92d6 ISCSIPlugin : remove specific volume_size_info
no need to use volume_size_info, we can use generic volume_size_info from Plugin. (file_size_info)

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2012-08-06 06:10:03 +02:00
Dietmar Maurer
86a9a680de use rpcinfo instead of Ping
This works for NFS servers behind firewalls.
2012-08-01 08:45:33 +02:00
Dietmar Maurer
f3d4ef4626 move check_connection into activate_storage 2012-08-01 07:16:33 +02:00
Dietmar Maurer
f18199e580 volume_size_info: make it work with raw devices 2012-07-31 11:01:02 +02:00
Alexandre Derumier
c3013a8be5 nexentaplugin : volume_size_info
return nothing for now.

This also avoid de call soap api each time in sub path.

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2012-07-27 10:45:21 +02:00
Alexandre Derumier
0002d9cc30 rbdplugin: volume_size_info
return nothing for now

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2012-07-27 10:45:18 +02:00
Alexandre Derumier
27923b43c7 sheepdogplugin: volume_size_info
return nothing for now

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2012-07-27 10:45:16 +02:00
Alexandre Derumier
baf6965931 iscsidirectplugin : volume_size_info
return nothing for now

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2012-07-27 10:45:14 +02:00
Alexandre Derumier
a548fd488f iscsiplugin:volume_size_info
return nothing for now, as we can't get volume used inside the volume, stats are empty.

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2012-07-27 10:45:06 +02:00
Alexandre Derumier
e47e548e51 add volume_size_info for generic plugin
this use path and file_size_info like before

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2012-07-27 10:44:46 +02:00
Alexandre Derumier
20ccac1b6d add volume_size_info sub
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2012-07-27 10:44:03 +02:00
Dietmar Maurer
6d64e9e065 fix lvmscan 2012-07-25 15:50:23 +02:00
Dietmar Maurer
7028645e2e catch exception 2012-07-19 11:22:35 +02:00
Alexandre Derumier
03b5bfdf9c iscsi: add check_connection
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2012-07-19 11:00:39 +02:00
Alexandre Derumier
4d284721ed nfs: add check_connection
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2012-07-19 11:00:06 +02:00
Alexandre Derumier
c9eeac0131 add check_connection in storage_check_enabled.
Currently, if a storage have an infinite timeout (nfs hard option or iscsi with high timeout for failover),
and if the storage is down or is doing ha failover with dual controller

- pvestatd hang on storage_info. (So pve-manager see the host as down, and hang on differents parts, gui,rrds display)

- pvedaemon hang on differents place (storage disk list,vm_status, hardware info,...)

- I also see a lot of qemu-img info process hanging in uninterruptible sleep state with iscsi storage.

This patch add a check to see if the storage is accessible.

For nfs and iscsi : ping with a timeout of 2 second.  (Maybe this can be polish with some kind of filesystem/storage read test with timeout...)

Default for other storage plugins is to check nothing. (not a problem with sheepdog,ceph,libiscsi... as commands have timeout)

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2012-07-19 10:58:19 +02:00
Dietmar Maurer
8c3abf126f re-add hack for empty pool
fresh created and empty rbd pool, throw a 500 error with "pool xxx doesn't contain rbd images" message.
2012-07-18 06:04:09 +02:00
Dietmar Maurer
f7a1e35f69 fix sheepdog path
We always need to specify a port, else kvm does not find the disk.
2012-07-17 15:12:49 +02:00
Dietmar Maurer
411476cd32 cleanup rbd driver 2012-07-17 13:26:36 +02:00
Dietmar Maurer
8661655414 register all plugins 2012-07-17 12:58:38 +02:00
Dietmar Maurer
2677f6239d cleanup white space errors 2012-07-17 11:55:38 +02:00
Alexandre Derumier
40cd7d27d5 add nexenta plugin
storage definition
------------------
portal 192.168.0.1
target iqn.1986-03.com.sun:....
login myloginwithjsonpermission
password jsonuserpassword
pool Yourpool
blocksize 4K

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2012-07-17 11:49:53 +02:00
Alexandre Derumier
b345cad347 add iscsidirect plugin
This use libiscsi

storage definition:
------------------
portal 192.168.0.1
target iqn.1986-03.com.sun:....

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2012-07-17 11:48:27 +02:00
Dietmar Maurer
e9256323c0 sheepdog: implement storage status 2012-07-16 09:51:26 +02:00
Dietmar Maurer
7f8373d270 delete trailing white spaces 2012-07-16 09:13:19 +02:00
Dietmar Maurer
be6339fc3a sheepdog: use '-r' to get sizes in bytes, code cleanup
Use a common method collie_cmd() to assemble command using
correct server/port settings.
2012-07-16 09:10:17 +02:00
Dietmar Maurer
caf1960c76 register sheepdog plugin 2012-07-16 07:26:08 +02:00
Alexandre Derumier
e4fc8228a7 add sheepdog plugin
storage definition
-------------------
portal 127.0.0.1:7000

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2012-07-16 07:14:53 +02:00
Alexandre Derumier
1270370d9b set shared=1 to sheepdog plugin
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2012-07-16 07:03:42 +02:00
Dietmar Maurer
6bf5629866 fix offline migration bug
Alway pass volname and storeid to plugin->path()
2012-07-16 06:45:13 +02:00
Alexandre Derumier
d70e7f6c0d rbd : add owner attribute when rbs ls
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2012-06-19 06:42:35 +02:00
Alexandre Derumier
4e2d3bc8ea rbd : use keyring file instead keyfile
we need 1 keyring by rbd storage

/etc/pve/priv/ceph/storagename.keyring

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2012-06-18 13:44:56 +02:00
Dietmar Maurer
571abaa611 add newline to error message 2012-06-18 06:30:27 +02:00
Alexandre Derumier
3e195ccccb rbd : rbd_ls: doesn't throw error if pool doesn't contain image
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2012-06-18 06:04:57 +02:00
Alexandre Derumier
4f4f94801d rbd : set shared as default
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2012-06-06 12:19:09 +02:00
Alexandre Derumier
e5427b0097 rados block plugin update
config file
-----------
rbd: rbdtest
        monhost 10.3.94.27:6789;10.3.94.28:6789;10.3.94.29:6789
        pool pool2
        username admin
        authsupported cephx;none
        content images

key for user admin must be specified in:
---------------------------------------
/etc/pve/priv/ceph/storeid.username.key

/etc/pve/priv/ceph/rbdtest.admin.key   for this exemple.

(so we can have multiple users key by storage and multiple storage with same username)

I change "sub path" in Storage.pm to pass $storeid as third argument.

I rename property id to username, to be more clear.

removal of rbd_ prefix.

removal of trailing whitespace

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2012-06-02 12:00:33 +02:00
Alexandre Derumier
0509010d6e Add rados block plugin storage
This add rados plugin storage.

We need rbd command from ceph repository (ceph-common package) to create/delete volumes,I didn't have add depends for the moment.

/etc/pve/storage.cfg sample config

rbd: rbdtest
        rbd_monhost 10.3.94.27:6789;10.3.94.28:6789;10.3.94.29:6789
        rbd_pool pool2
        rbd_id admin
        rbd_key AQAmOcZPwNY7GRAAuvJjVAKIm1r3JKqLCa4LGQ==
        rbd_authsupported cephx;none
        content images

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2012-06-01 07:18:11 +02:00
Dietmar Maurer
5521b5805b fix return value for path() 2012-05-23 13:11:20 +02:00
Dietmar Maurer
be2e0c16b1 import run_command 2012-05-23 12:56:25 +02:00
Dietmar Maurer
d9e4e1ce2c use File::Path 2012-05-23 12:48:44 +02:00
Dietmar Maurer
7a2d5c1a26 use Sockets 2012-05-23 12:43:28 +02:00
Dietmar Maurer
1dc01b9f30 new plugin architecture 2012-05-23 08:00:13 +02:00
Dietmar Maurer
5c009b733e avoid call to lvs when deactivating devices
Because this can be slow if there are many devices.
2012-04-23 06:31:04 +02:00
Dietmar Maurer
75d75990b4 fix bug #171: fix path_to_volume_id for unmounted NFS 2012-04-18 12:34:39 +02:00
Dietmar Maurer
369977e8bb fix bug #148: set maxfiles for default local storage 2012-04-05 14:40:01 +02:00
Dietmar Maurer
dc2deeb8fe use dir_glob_* from PVE::Tools 2012-03-28 08:00:59 +02:00
Dietmar Maurer
da156fb3ef add line break to error message 2012-03-28 06:36:38 +02:00
Dietmar Maurer
446073f681 allow to set option 'maxfiles' 2012-03-23 07:43:28 +01:00
Dietmar Maurer
6bf7eb0903 use Digest::SHA instead of Digest::SHA1 2012-03-20 11:27:51 +01:00
Dietmar Maurer
d642361b29 new lvm option 'saferemove' to zero-out data when removing LVs 2012-03-09 09:43:01 +01:00
Dietmar Maurer
88c3abaf6e zero-ot data on LVM volumes 2012-03-07 12:32:02 +01:00
Dietmar Maurer
b755bdb0f9 delete volume requires Datastore.Allocate 2012-02-22 12:08:54 +01:00
Dietmar Maurer
0c1473f928 only list iscsi when enabled (content == images) 2012-02-15 09:33:12 +01:00
Dietmar Maurer
888709239d also list tar.gz and tar.lzo backup files 2012-02-07 12:54:16 +01:00
Dietmar Maurer
1f6610f386 fix upload permissions. Only allow iso/tmpl upload. 2012-02-06 10:10:55 +01:00
Dietmar Maurer
2494896aaa parse backup files and return owner vmid 2012-02-01 11:47:44 +01:00
Dietmar Maurer
05f697c983 use correct package prefix 2012-01-26 13:10:50 +01:00
Dietmar Maurer
8fba271817 moved format definition to pve-common 2012-01-26 11:55:28 +01:00
Dietmar Maurer
5f642f73b8 add permission checks 2012-01-26 09:25:39 +01:00
Dietmar Maurer
95e8e21cc5 allow optional slash in mount path
Seems NFS4 use that smetimes
2012-01-26 05:55:12 +01:00
Dietmar Maurer
db2ec87f83 use -e to test if volume exists
Because rootdir is a directory, not a file
2011-12-02 10:31:49 +01:00
Dietmar Maurer
02fae308ed fix iscsi size bug 2011-11-28 07:38:02 +01:00
Dietmar Maurer
3af60e62fa ignore errors from vgs 2011-11-25 09:43:29 +01:00
Dietmar Maurer
f81372ac59 improve error messages 2011-11-25 07:42:26 +01:00
Dietmar Maurer
6703353bb8 do not activate LVM volumes with vgchange -aly 2011-11-25 07:27:25 +01:00
Dietmar Maurer
c63913bf57 fix bug 44: allow to store vztmpl on NFS 2011-11-17 12:15:39 +01:00
Dietmar Maurer
1ac17c745e improved container support (rootdir) 2011-11-14 07:11:36 +01:00
Dietmar Maurer
d22a6133ab allow container rootdir on NFS 2011-11-07 11:14:32 +01:00
Dietmar Maurer
03f03009ba fix description 2011-11-03 09:33:27 +01:00
Dietmar Maurer
4ea5bca4e3 use correct prefix 2011-11-03 09:32:32 +01:00
Dietmar Maurer
7814e05f6f implement file upload API 2011-11-03 09:22:53 +01:00
Dietmar Maurer
87191fbe8f add content type attribute 2011-10-31 11:45:16 +01:00
Dietmar Maurer
686e1d032b fix parse_volname_dir to support backup images 2011-10-20 11:05:05 +02:00
Dietmar Maurer
6a4d7398b3 allow multiple content types 2011-10-20 08:02:52 +02:00
Dietmar Maurer
568de3d125 allow backup to local storage and code cleanups 2011-10-18 11:23:31 +02:00
Dietmar Maurer
883eeea67d add copy API example for stefan 2011-10-12 07:39:50 +02:00
Dietmar Maurer
9dec0cb1f7 only activate lvm volumes on local node
Pass -aly to lvcreate.
2011-09-29 08:42:00 +02:00
Dietmar Maurer
6c64928f88 avoid warning about uninitialize value 2011-09-23 06:57:40 +02:00
Dietmar Maurer
dfe98e6437 Fix digest handling 2011-09-07 12:01:25 +02:00
Dietmar Maurer
04a2e4f39f fix shared attribute in storage list 2011-08-26 06:23:24 +02:00
Dietmar Maurer
b6cf0a6659 imported from svn 'pve-storage/pve2' 2011-08-23 07:43:03 +02:00