]> git.proxmox.com Git - pve-storage.git/log
pve-storage.git
3 years agoAdd prune_backups to storage API
Fabian Ebner [Thu, 9 Jul 2020 12:45:42 +0000 (14:45 +0200)]
Add prune_backups to storage API

Implement it for generic storages supporting backups
(i.e. directory-based storages) and add a wrapper for PBS.

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
3 years agoIntroduce prune-backups property for directory-based storages
Fabian Ebner [Thu, 9 Jul 2020 12:45:41 +0000 (14:45 +0200)]
Introduce prune-backups property for directory-based storages

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
3 years agobump version to 6.2-5
Wolfgang Bumiller [Tue, 14 Jul 2020 11:58:44 +0000 (13:58 +0200)]
bump version to 6.2-5

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
3 years agopvesm: pass-through 'autogen' special value for encryption key
Wolfgang Bumiller [Tue, 14 Jul 2020 11:57:55 +0000 (13:57 +0200)]
pvesm: pass-through 'autogen' special value for encryption key

so that the on-update hook can handle its creation

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
3 years agofix another encryption_key vs encryption-key instance
Wolfgang Bumiller [Tue, 14 Jul 2020 11:51:26 +0000 (13:51 +0200)]
fix another encryption_key vs encryption-key instance

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
3 years agobump version to 6.2-4
Wolfgang Bumiller [Tue, 14 Jul 2020 11:45:29 +0000 (13:45 +0200)]
bump version to 6.2-4

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
3 years agoparam mapping fixup
Wolfgang Bumiller [Fri, 10 Jul 2020 08:52:45 +0000 (10:52 +0200)]
param mapping fixup

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
3 years agovdisk_list: skip scanning storages which cannot have images/rootdisks
Thomas Lamprecht [Thu, 9 Jul 2020 14:14:04 +0000 (16:14 +0200)]
vdisk_list: skip scanning storages which cannot have images/rootdisks

Do not try to scan (and thus activate) storages which aren't
configured to support (or cannot support) "vdisks" anyway.

Avoids seemingly strange failures of VM migrations due to a backup storage
not being currently online - even if that storage isn't referenced in
the VM config anywhere..

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agouse ssh -X for upload
Wolfgang Bumiller [Thu, 9 Jul 2020 13:00:38 +0000 (15:00 +0200)]
use ssh -X for upload

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
3 years agobump version to 6.2-3
Wolfgang Bumiller [Thu, 9 Jul 2020 13:00:10 +0000 (15:00 +0200)]
bump version to 6.2-3

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
3 years agoquick fixup for prune command in vzdump
Wolfgang Bumiller [Thu, 9 Jul 2020 12:50:13 +0000 (14:50 +0200)]
quick fixup for prune command in vzdump

This is a hack and we should get rid of `run_client_cmd` and
`run_raw_client_cmd` as an API entry!

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
3 years agobump version to 6.2-2
Thomas Lamprecht [Thu, 9 Jul 2020 12:03:33 +0000 (14:03 +0200)]
bump version to 6.2-2

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agod/control: depend on proxmox-backup-client
Thomas Lamprecht [Thu, 9 Jul 2020 10:34:51 +0000 (12:34 +0200)]
d/control: depend on proxmox-backup-client

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agopbs: activate_storage: query status to ensure we can connect
Thomas Lamprecht [Thu, 9 Jul 2020 09:54:13 +0000 (11:54 +0200)]
pbs: activate_storage: query status to ensure we can connect

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agopbs: allow to autogen an encryption key
Thomas Lamprecht [Thu, 9 Jul 2020 09:53:51 +0000 (11:53 +0200)]
pbs: allow to autogen an encryption key

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agopbs: rename encryption_key param to encryption-key
Thomas Lamprecht [Thu, 9 Jul 2020 09:53:27 +0000 (11:53 +0200)]
pbs: rename encryption_key param to encryption-key

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agopvesm: encryption key parameter should load files
Wolfgang Bumiller [Thu, 9 Jul 2020 08:25:44 +0000 (10:25 +0200)]
pvesm: encryption key parameter should load files

also `pvesm set` and `pvesm add` should behave the same with
respect to how configuration options are treated

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
3 years agorefactor sensitive parameter handling
Wolfgang Bumiller [Thu, 9 Jul 2020 08:25:43 +0000 (10:25 +0200)]
refactor sensitive parameter handling

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
3 years agopbs: encryption support, split "raw client command" API
Wolfgang Bumiller [Thu, 9 Jul 2020 08:25:42 +0000 (10:25 +0200)]
pbs: encryption support, split "raw client command" API

(And deprecate it...)

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
3 years agocifs: use more general name for password description
Thomas Lamprecht [Thu, 9 Jul 2020 08:34:53 +0000 (10:34 +0200)]
cifs: use more general name for password description

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agoarchive_info: relax custom name handling
Fabian Grünbichler [Wed, 8 Jul 2020 10:05:02 +0000 (12:05 +0200)]
archive_info: relax custom name handling

we already differentiate between standard and non-standard names anyway
and don't detect and return the VMID in the latter case anyway. drop it
from the RE as well to allow names like 'vzdump-qemu-template.vma.lzo'
without the need for a fake VMID.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
3 years agoarchive_info: use timelocal correctly
Fabian Ebner [Wed, 8 Jul 2020 08:22:19 +0000 (10:22 +0200)]
archive_info: use timelocal correctly

Because we always have 4-digit years, we can simply pass
the year itself to timelocal instead of subtracting 1900.
Like this it will also work for years not in the range 2000-2999.

See also:
https://perldoc.perl.org/Time/Local.html#Year-Value-Interpretation

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
3 years agobump version to 6.2-1
Thomas Lamprecht [Tue, 7 Jul 2020 17:23:58 +0000 (19:23 +0200)]
bump version to 6.2-1

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agofix #2460: use dm-uuid-mpath- as fallback for multipath
Mira Limbeck [Tue, 7 Jul 2020 14:14:54 +0000 (16:14 +0200)]
fix #2460: use dm-uuid-mpath- as fallback for multipath

With Debian Buster it looks like the 'scsi-' method is no longer
reliable. In addition to that, which is also used for non-multipath
systems, add the 'dm-uuid-mpath-' method as fallback. This is also used
by openstack (see os-brick
https://github.com/openstack/os-brick/blob/39b201160bbff39117fca46b2709ff3f74c53d80/os_brick/initiator/linuxscsi.py#L400)

Also sort the output of readdir so 'scsi-' is always after
'dm-uuid-mpath-' so the output of pvesm list does not change for systems
that worked before.

Signed-off-by: Mira Limbeck <m.limbeck@proxmox.com>
3 years agopbs: run_raw_client_cmd: fix typo, and drop repetive info
Thomas Lamprecht [Tue, 7 Jul 2020 08:14:00 +0000 (10:14 +0200)]
pbs: run_raw_client_cmd: fix typo, and drop repetive info

It would be s/bps/pbs/ but as we already have "proxmox-backup-client"
included in the log through the executable name, so it should be
clear that this is a PBS command - so drop that part entirely.

Now using:
> run: /usr/bin/proxmox-backup-client ...

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agoscan_cifs: fix scanning server with no SMB1 fallback
Thomas Lamprecht [Wed, 1 Jul 2020 13:33:14 +0000 (15:33 +0200)]
scan_cifs: fix scanning server with no SMB1 fallback

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agoscan cifs: fix passing "no pass" parameter
Thomas Lamprecht [Wed, 1 Jul 2020 10:17:02 +0000 (12:17 +0200)]
scan cifs: fix passing "no pass" parameter

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agoscan storage: order scanned shares alphabetically
Thomas Lamprecht [Wed, 1 Jul 2020 08:25:32 +0000 (10:25 +0200)]
scan storage: order scanned shares alphabetically

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agoscan_cifs: do not add NT_STATUS lines to result
Thomas Lamprecht [Wed, 1 Jul 2020 08:25:07 +0000 (10:25 +0200)]
scan_cifs: do not add NT_STATUS lines to result

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agoscan_cifs: do not enforce password for users
Thomas Lamprecht [Wed, 1 Jul 2020 10:07:19 +0000 (12:07 +0200)]
scan_cifs: do not enforce password for users

there can be accounts with explicit null password others than the
mapped guest account.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agoscan_cifs: pass user/pass over environment
Thomas Lamprecht [Tue, 30 Jun 2020 13:15:08 +0000 (15:15 +0200)]
scan_cifs: pass user/pass over environment

As command line argument they are readable by ever user in the same
PID namespace.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agoscan_cifs: add workgroup domain independent of user param
Thomas Lamprecht [Tue, 30 Jun 2020 13:14:33 +0000 (15:14 +0200)]
scan_cifs: add workgroup domain independent of user param

they are not really bound to each other

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agoscan_cifs: raise smbclient errors
Thomas Lamprecht [Tue, 30 Jun 2020 13:13:02 +0000 (15:13 +0200)]
scan_cifs: raise smbclient errors

Silencing error messages can extend the search for an issue while
having to advantage.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agoscan_cifs: fix comment typo and indentation
Thomas Lamprecht [Tue, 30 Jun 2020 13:12:19 +0000 (15:12 +0200)]
scan_cifs: fix comment typo and indentation

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agoadd trailing newline to error message
Thomas Lamprecht [Tue, 30 Jun 2020 12:19:24 +0000 (14:19 +0200)]
add trailing newline to error message

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agoPBSPlugin: Add print_volid helper
Fabian Ebner [Tue, 30 Jun 2020 08:24:20 +0000 (10:24 +0200)]
PBSPlugin: Add print_volid helper

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
3 years agoAdd archive_remove
Fabian Ebner [Tue, 30 Jun 2020 08:24:19 +0000 (10:24 +0200)]
Add archive_remove

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
3 years agoExtend archive_info to include filename and logfilename
Fabian Ebner [Tue, 30 Jun 2020 08:24:18 +0000 (10:24 +0200)]
Extend archive_info to include filename and logfilename

Only expect the logfilename if the archive has a standard name.
This also gives a mechanism to get an untainted filename.

archive_info can take either a volume ID or a path as it's
currently implemented. This is useful for vzdump when there
is no storage (i.e. for 'vzdump --dumpdir'). Add a test case for this.

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
3 years agoWhitespace cleanup
Fabian Ebner [Tue, 30 Jun 2020 08:24:22 +0000 (10:24 +0200)]
Whitespace cleanup

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
3 years agoFix 2763: Revert "storage_migrate: check if target storage supports content type"
Fabian Ebner [Mon, 25 May 2020 07:41:58 +0000 (09:41 +0200)]
Fix 2763: Revert "storage_migrate: check if target storage supports content type"

This reverts commit 95015dbbf24b710011965805e689c03923fb830c.

parse_volname always gives 'images' and not 'rootdir'. In most
cases the volume name alone does not contain the needed information,
e.g. vm-123-disk-0 can be both a VM volume or a container volume.

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
3 years agodoc: Clarify that pvesm export is mostly internal
Dominic Jäger [Tue, 2 Jun 2020 09:56:49 +0000 (11:56 +0200)]
doc: Clarify that pvesm export is mostly internal

3 years agobase plugin: fall back to empty hash to avoid checking archive info definedness
Thomas Lamprecht [Sat, 6 Jun 2020 17:40:06 +0000 (19:40 +0200)]
base plugin: fall back to empty hash to avoid checking archive info definedness

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agoExpand archive_info to include ctime, vmid and is_std_name
Fabian Ebner [Thu, 4 Jun 2020 09:08:34 +0000 (11:08 +0200)]
Expand archive_info to include ctime, vmid and is_std_name

where 'is_std_name' shows whether the backup name uses the standard naming
schema and most likely was created by our tools.

Also adds a '^' to the existing filename matching regex, which
should be fine since basename() is used beforehand.

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
3 years agoPBSPlugin: list_volumes: filter by vmid if specified
Fabian Ebner [Thu, 4 Jun 2020 09:08:33 +0000 (11:08 +0200)]
PBSPlugin: list_volumes: filter by vmid if specified

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
3 years agofix #2777 create zpools with stable dev paths
Stoiko Ivanov [Fri, 5 Jun 2020 13:24:56 +0000 (15:24 +0200)]
fix #2777 create zpools with stable dev paths

when compiling the disk list add a property with a stable
/dev/disk/by-id/ path for a block device when available.

This is needed to create zpools with the stable by-id links

The /dev/disk/by-id/ directory can contain multiple links to the same device
(e.g. when it's used as a LVM PV, or one for the wwn/nvme-eui in addition
to the one with vendor and serial). We take the first one which matches
the bus where the disk is attached. For nvme disks we exclude the one
containing the nvme-eui.

The patch assumes that not all disks need to have such a link (e.g.
virtio-block devices as we pass them to guests).

Additionally the tests were adapted to run successfully.

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
3 years agoPBSPlugin.pm: avoid ascii-art in proxmox-backup-client output
Dietmar Maurer [Wed, 3 Jun 2020 09:07:01 +0000 (11:07 +0200)]
PBSPlugin.pm: avoid ascii-art in proxmox-backup-client output

3 years agoceph: get_local_version: allow optional v prefix for version number
Thomas Lamprecht [Fri, 22 May 2020 16:50:06 +0000 (18:50 +0200)]
ceph: get_local_version: allow optional v prefix for version number

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agobump version to 6.1-8
Thomas Lamprecht [Fri, 15 May 2020 17:41:25 +0000 (19:41 +0200)]
bump version to 6.1-8

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agotests: re-add virt "none" negative test
Thomas Lamprecht [Fri, 15 May 2020 17:32:21 +0000 (19:32 +0200)]
tests: re-add virt "none" negative test

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agoarchive info: keep some basic strictness
Thomas Lamprecht [Fri, 15 May 2020 17:18:22 +0000 (19:18 +0200)]
archive info: keep some basic strictness

we want to enforce at least the strictness that our tools can do
something with a backup archive..

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agoarchive info: include archive name in error message
Thomas Lamprecht [Fri, 15 May 2020 17:13:37 +0000 (19:13 +0200)]
archive info: include archive name in error message

so that we have some context if users report issues with it..

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agotests: archive info: avoid assembling arrays to just de-assemble them directly
Thomas Lamprecht [Fri, 15 May 2020 17:11:48 +0000 (19:11 +0200)]
tests: archive info: avoid assembling arrays to just de-assemble them directly

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agotests: archive info: make deterministic
Thomas Lamprecht [Fri, 15 May 2020 17:10:21 +0000 (19:10 +0200)]
tests: archive info: make deterministic

nothing worse than jumping test results due to not sorting the tests
and thus making discussions harder (which test # failed) and it may
imply another error by mistake.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agotests: archive info: code cleanup
Thomas Lamprecht [Fri, 15 May 2020 16:57:37 +0000 (18:57 +0200)]
tests: archive info: code cleanup

We could also do a hash array slice, like:
> my ($archive, $expected, $description) = $tt->@{'archive', 'expected', 'description'};

But as none are optional lets just access values directly..

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agostorage: archive/extract code cleanup
Thomas Lamprecht [Fri, 15 May 2020 16:46:11 +0000 (18:46 +0200)]
storage: archive/extract code cleanup

* run_command is already imported, use that fact
* avoid useless comments just describing what the code tells one
  anyway
* restructure a few parts to more concise/easier to read
  implementation.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agoFix: backup: relax file name matching regex
Alwin Antreich [Tue, 12 May 2020 15:12:13 +0000 (17:12 +0200)]
Fix: backup: relax file name matching regex

The rework of the backup file detection logic missed the non-standard
file name case. This patch allows to restore backups with different file
names. Though the config extraction fails, since the type is unknown.

Signed-off-by: Alwin Antreich <a.antreich@proxmox.com>
3 years agoFix #2737: Can't call method "mode"
Alwin Antreich [Wed, 13 May 2020 15:18:47 +0000 (17:18 +0200)]
Fix #2737: Can't call method "mode"

on an undefined value at /usr/share/perl5/PVE/Storage/Plugin.pm line 928

This error message crops up when a file is deleted after getting the
file list and before the loop passed the file entry.

Signed-off-by: Alwin Antreich <a.antreich@proxmox.com>
3 years agobump version to 6.1-7
Fabian Grünbichler [Mon, 4 May 2020 12:03:51 +0000 (14:03 +0200)]
bump version to 6.1-7

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
3 years agotest: force ctime to UTC
Fabian Grünbichler [Mon, 4 May 2020 09:10:56 +0000 (11:10 +0200)]
test: force ctime to UTC

otherwise this test fails depending on TZ of the testing system

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
3 years agotest: filesystem_path
Alwin Antreich [Tue, 28 Apr 2020 13:58:25 +0000 (15:58 +0200)]
test: filesystem_path

Signed-off-by: Alwin Antreich <a.antreich@proxmox.com>
3 years agotest: get_subdir
Alwin Antreich [Tue, 28 Apr 2020 13:58:24 +0000 (15:58 +0200)]
test: get_subdir

Co-Authored-by: Dominic Jaeger <d.jaeger@proxmox.com>
Signed-off-by: Alwin Antreich <a.antreich@proxmox.com>
3 years agoFix: #2124 storage: add zstd support
Alwin Antreich [Tue, 28 Apr 2020 13:58:23 +0000 (15:58 +0200)]
Fix: #2124 storage: add zstd support

Signed-off-by: Alwin Antreich <a.antreich@proxmox.com>
3 years agobackup: compact regex for backup file filter
Alwin Antreich [Tue, 28 Apr 2020 13:58:22 +0000 (15:58 +0200)]
backup: compact regex for backup file filter

the more compact form of the regex should allow easier addition of new
file extensions.

Signed-off-by: Alwin Antreich <a.antreich@proxmox.com>
3 years agoFix: add missing snippets subdir
Alwin Antreich [Tue, 28 Apr 2020 13:58:21 +0000 (15:58 +0200)]
Fix: add missing snippets subdir

since it is a valid content type and adapt the path_to_volume_id_test.
Also adds an extra check if all vtype_subdirs are returned.

Signed-off-by: Alwin Antreich <a.antreich@proxmox.com>
3 years agoFix: path_to_volume_id returned wrong content
Alwin Antreich [Tue, 28 Apr 2020 13:58:20 +0000 (15:58 +0200)]
Fix: path_to_volume_id returned wrong content

type for backup files. Patch includes changes of the test as well.

Signed-off-by: Alwin Antreich <a.antreich@proxmox.com>
3 years agotest: path_to_volume_id
Alwin Antreich [Tue, 28 Apr 2020 13:58:19 +0000 (15:58 +0200)]
test: path_to_volume_id

Test to reduce the potential for accidental breakage on regex changes.

Signed-off-by: Alwin Antreich <a.antreich@proxmox.com>
3 years agoFix: backup: ctime was from stat not file name
Alwin Antreich [Tue, 28 Apr 2020 13:58:18 +0000 (15:58 +0200)]
Fix: backup: ctime was from stat not file name

The vzdump file was passed with the full path to the regex. That regex
captures the time from the file name, to calculate the epoch.

As the regex didn't match, the ctime from stat was taken instead. This
resulted in the ctime shown when the file was changed, not when the
backup was made.

Signed-off-by: Alwin Antreich <a.antreich@proxmox.com>
3 years agotest: list_volumes
Alwin Antreich [Tue, 28 Apr 2020 13:58:17 +0000 (15:58 +0200)]
test: list_volumes

Test to reduce the potential for accidental breakage on regex changes.

Co-Authored-by: Dominic Jaeger <d.jaeger@proxmox.com>
Signed-off-by: Alwin Antreich <a.antreich@proxmox.com>
3 years agotest: parse_volname
Alwin Antreich [Tue, 28 Apr 2020 13:58:16 +0000 (15:58 +0200)]
test: parse_volname

Test to reduce the potential for accidental breakage on regex changes.
And to make sure that all vtype_subdirs are parsed.

Signed-off-by: Alwin Antreich <a.antreich@proxmox.com>
3 years agostorage: replace build-in stat occurrences
Alwin Antreich [Tue, 28 Apr 2020 13:58:15 +0000 (15:58 +0200)]
storage: replace build-in stat occurrences

with File::stat::stat to minimize variable declarations. And allow to
mock this method in tests instead of the perl build-in stat.

Signed-off-by: Alwin Antreich <a.antreich@proxmox.com>
3 years agostorage: test: split archive format/compressor
Alwin Antreich [Tue, 28 Apr 2020 13:58:13 +0000 (15:58 +0200)]
storage: test: split archive format/compressor

detection into separate functions so they are reusable and easier
modifiable. This patch also adds the test for archive_info.

Signed-off-by: Alwin Antreich <a.antreich@proxmox.com>
4 years agos/ceph_version/local_ceph_version/ for clarity
Thomas Lamprecht [Sat, 25 Apr 2020 09:37:26 +0000 (11:37 +0200)]
s/ceph_version/local_ceph_version/ for clarity

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agod/control: bump ceph dependency to 12.2
Thomas Lamprecht [Sat, 25 Apr 2020 09:27:30 +0000 (11:27 +0200)]
d/control: bump ceph dependency to 12.2

A newer than the Luminous version is shipped with buster, and our
ceph repos are on Nautilus (14.2) in PVE 6.

Allows to drop a check for really old ceph versions (< 10, so
Infernalis and older).

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agofollowup: only parse version if required, fix whitespace error
Thomas Lamprecht [Sat, 25 Apr 2020 09:18:03 +0000 (11:18 +0200)]
followup: only parse version if required, fix whitespace error

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agoFix #2705: cephfs: mount fails with bad option
Alwin Antreich [Fri, 24 Apr 2020 15:29:47 +0000 (17:29 +0200)]
Fix #2705: cephfs: mount fails with bad option

dmesg: libceph: bad option at 'conf=/etc/pve/ceph.conf'

After the upgrade to PVE 6 with Ceph Luminous, the mount.ceph helper
doesn't understand the conf= option yet. And the CephFS mount with the
kernel client fails. After upgrading to Ceph Nautilus the option exists
in the mount.ceph helper.

Signed-off-by: Alwin Antreich <a.antreich@proxmox.com>
4 years agoconfig: add missing whitespace
Thomas Lamprecht [Sat, 25 Apr 2020 09:12:48 +0000 (11:12 +0200)]
config: add missing whitespace

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agofix nvme wearout parsing
Dominik Csapak [Tue, 14 Apr 2020 14:17:33 +0000 (16:17 +0200)]
fix nvme wearout parsing

the '.*' was greedy, also consuming all but one digits of the real percentage

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
switch to \s* instead of .*?, to prevent mis-interpreting potential
strings like '< 50%' or '0-50%'

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
4 years agodisk_tests: improve nvme smart test
Dominik Csapak [Tue, 14 Apr 2020 14:17:32 +0000 (16:17 +0200)]
disk_tests: improve nvme smart test

by using an actual percentage for 'Percentage Used' instead of 0%

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
4 years agoAdd comment for volume_has_feature
Fabian Ebner [Wed, 8 Apr 2020 11:40:07 +0000 (13:40 +0200)]
Add comment for volume_has_feature

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
4 years agoZFS: use -p flag where possible
Aaron Lauterer [Tue, 7 Apr 2020 12:25:37 +0000 (14:25 +0200)]
ZFS: use -p flag where possible

Signed-off-by: Aaron Lauterer <a.lauterer@proxmox.com>
4 years agoZFS: use -p flag and remove zfs_parse_size
Aaron Lauterer [Tue, 7 Apr 2020 12:25:36 +0000 (14:25 +0200)]
ZFS: use -p flag and remove zfs_parse_size

ZFS supports the -p flag in the list command since a few years now.
Let us use the real byte values and avoid the error prone calculation
from human readable numbers that can lead to incorrect numbers if the
reported human readable value is a rounded number.

Signed-off-by: Aaron Lauterer <a.lauterer@proxmox.com>
4 years agoZFSPoolPlugin: fix #2662 get volume size correctly
Aaron Lauterer [Tue, 7 Apr 2020 12:25:35 +0000 (14:25 +0200)]
ZFSPoolPlugin: fix #2662 get volume size correctly

Getting the volume sizes as byte values instead of converted to human
readable units helps to avoid rounding errors in the further processing
if the volume size is more on the odd side.

The `zfs list` command supports the -p(arseable) flag since a few years
now.
When returning the size in bytes there is no  calculation performed and
thus we need to explicitly cast the size to an integer before returning
it.

Signed-off-by: Aaron Lauterer <a.lauterer@proxmox.com>
4 years agobump version to 6.1-6
Fabian Grünbichler [Thu, 9 Apr 2020 06:43:17 +0000 (08:43 +0200)]
bump version to 6.1-6

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
4 years agod/control: wrap-and-sort
Fabian Grünbichler [Thu, 9 Apr 2020 06:38:31 +0000 (08:38 +0200)]
d/control: wrap-and-sort

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
4 years agod/control: break consumers of storage_migrate
Fabian Grünbichler [Thu, 9 Apr 2020 06:38:04 +0000 (08:38 +0200)]
d/control: break consumers of storage_migrate

since we changed the signature, and want to ensure smooth upgrades.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
4 years agostorage_migrate: add volname_for_storage helper
Fabian Ebner [Wed, 8 Apr 2020 09:25:14 +0000 (11:25 +0200)]
storage_migrate: add volname_for_storage helper

to guess a valid volname for a targetstorage of a different type.
This makes it possible to migrate raw volumes between 'dir' and 'lvm'
storages.

It is only used when the storage type for the source storage X
and target storage Y differ and should work as long as Y uses
the standard naming scheme (VMID/vm-VMID-name.fmt respectively vm-VMID-name).
If it doesn't, we get an invalid name and fail, which is the old
behavior (except if X and Y have different types but the same
non-standard naming-scheme, where the old behavior did work).

The original name is preserved, except for a possible extension
and it's also checked if the format is valid for the target storage.
Example: mylvm:vm-123-disk-4 <-> mydir:123/vm-123-disk-4.raw

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
4 years agoIntroduce allow_rename parameter for pvesm import and storage_migrate
Fabian Ebner [Wed, 8 Apr 2020 09:25:05 +0000 (11:25 +0200)]
Introduce allow_rename parameter for pvesm import and storage_migrate

and also return the ID of the allocated volume. This option
allows plugins to choose a new name if there is a collision.

In storage_migrate, the API version of the receiving side is checked.

In Storage.pm's volume_import, when a plugin returns 'undef',
it can be assumed that the import with the requested volid was
successful (it should've died otherwise) and so volid is returned.
This is done for backwards compatibility with foreign plugins.

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
4 years agoAdd apiinfo helper to pvesm
Fabian Ebner [Wed, 8 Apr 2020 09:25:04 +0000 (11:25 +0200)]
Add apiinfo helper to pvesm

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
4 years agoCollect optional parameters for storage_migrate into $opts
Fabian Ebner [Wed, 8 Apr 2020 09:24:59 +0000 (11:24 +0200)]
Collect optional parameters for storage_migrate into $opts

Sanitizing $with_snapshots is done on extraction to save a line.

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
4 years agoFix 2647: Add snippet content type for Gluster
Dominic Jäger [Thu, 26 Mar 2020 09:33:28 +0000 (10:33 +0100)]
Fix 2647: Add snippet content type for Gluster

Our wiki mentions snippets as supported content type for GlusterFS storages [0]
and all other directory based storages have it enabled already [1]

[0] https://pve.proxmox.com/wiki/Storage:_GlusterFS
[1] https://git.proxmox.com/?p=pve-storage.git;a=commit;h=d1eb35ea74cf27713625ab7e7c3767a8254a4aee

Signed-off-by: Dominic Jäger <d.jaeger@proxmox.com>
4 years agofix #2474: always show iscsi content
Dominik Csapak [Tue, 7 Apr 2020 07:25:24 +0000 (09:25 +0200)]
fix #2474: always show iscsi content

Instead of relying on list_volumes of Plugin.pm (which filters by
the content types set in the config), use our own to always
show the luns of an iscsi.

This makes sense here, since we need it to show the luns when using
it as base storage for LVM (where we have content type 'none' set).

It does not interfere with the rest of the GUI, since on e.g. disk
creation, we already filter the storages in the dropdown by content
type, iow. an iscsi storage used this way still does not show up
when trying to create a disk.

This also shows the luns now in the 'Content' tab, but this is also
OK, since the user cannot actually do anything there with the luns.
(Besides looking at them)

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
4 years agostorage_migrate: check if target storage supports content type
Fabian Ebner [Thu, 26 Mar 2020 08:09:31 +0000 (09:09 +0100)]
storage_migrate: check if target storage supports content type

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
4 years agoAllow passing options to volume_has_feature
Fabian Ebner [Mon, 23 Mar 2020 11:18:50 +0000 (12:18 +0100)]
Allow passing options to volume_has_feature

With the option valid_target_formats it's possible
to let the caller specify possible formats for the target
of an operation.
[0]: If the option is not set, assume that every format is valid.

In most cases the format of the the target and the format
of the source will agree (and therefore assumption [0] is
not actually assuming very much and ensures backwards
compatability). But when cloning a volume on a storage
using Plugin.pm's implementation (e.g. directory based
storages), the result is always a qcow2 image.

When cloning containers, the new option can be used to detect
that qcow2 is not valid and hence the clone feature is not
available.

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
4 years agobase plugin: get_subdir_files: split stat variables into single lines
Thomas Lamprecht [Fri, 6 Mar 2020 18:27:24 +0000 (19:27 +0100)]
base plugin: get_subdir_files: split stat variables into single lines

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agoapi: storage/content: fix return schema property descriptions
Thomas Lamprecht [Fri, 6 Mar 2020 18:24:32 +0000 (19:24 +0100)]
api: storage/content: fix return schema property descriptions

a small grammar fix, and we now return ctime of all files, as
remaining storages are planned for the future omit this hint
completely.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agoPBS plugin: code cleanup
Thomas Lamprecht [Fri, 6 Mar 2020 18:15:53 +0000 (19:15 +0100)]
PBS plugin: code cleanup

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agoLVM list_images: return creation time
Dietmar Maurer [Wed, 4 Mar 2020 10:46:22 +0000 (11:46 +0100)]
LVM list_images: return creation time

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
4 years agobase plugin: return ctime for vm images
Dietmar Maurer [Wed, 4 Mar 2020 10:46:21 +0000 (11:46 +0100)]
base plugin: return ctime for vm images

Changed file_size_info() to additionally return ctime to avoid
another stat() call.

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
4 years agobase plugin: add ctime for all files
Dietmar Maurer [Wed, 4 Mar 2020 10:46:20 +0000 (11:46 +0100)]
base plugin: add ctime for all files

Creation time makes sense for other file types also.

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
4 years agoPBS Plugin: list_volumes: add ctime
Dietmar Maurer [Wed, 4 Mar 2020 10:46:18 +0000 (11:46 +0100)]
PBS Plugin: list_volumes: add ctime

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>