Commit Graph

1487 Commits

Author SHA1 Message Date
d7f6f85ea0 fix find_free_disk_name invocations
The interface takes the storeid now, not the image dir.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-06-15 14:36:12 +02:00
883c811f7f prune backups: activate storage
which also checks whether the storage is even enabled. VZDump jobs already
activate the storage, but more direct calls via API/CLI didn't do so yet.

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2021-06-15 10:11:17 +02:00
f7a95153d6 diskmanage: fix determining array length
$#* is the last index, not the length.

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2021-06-15 10:10:33 +02:00
0e30b3121d api: get rid of moved 'usb' call
pve-manger commit bd328734deb1dcea296858bb38d085e392adb99e changed the frontend
to use the new call.

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2021-06-08 15:19:36 +02:00
8bceafc65c bump version to 7.0-2
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-06-02 16:32:23 +02:00
d938178298 disks: fixup join usage
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-06-02 14:19:53 +02:00
839afff896 disks: wipe blockdev: pass all child partitions to wipefs
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-06-02 13:13:26 +02:00
fa6d05ab24 disks: wipe blockdev: improve variable locality/readability
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-06-02 13:12:57 +02:00
70dc70984a disks: factor out stripping of /dev and cleanup vicinity
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-06-02 13:10:10 +02:00
2829e6a853 api: add wipedisk call
Try to detect active mounts and holders early, because it's cheap. The wipefs
command in the worker will detect even more situations where wiping alone is
not enough for the device to show up as unused, or could otherwise be
problematic.

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2021-06-02 11:56:51 +02:00
cb057e21c5 diskmanage: add has_holder method
Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2021-06-02 11:56:51 +02:00
3bf7f8891b diskmanage: add is_mounted method
Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2021-06-02 11:56:51 +02:00
7e14102a4b diskmanage: factor out mounted_blockdevs helper
Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2021-06-02 11:56:51 +02:00
262ad7a92e diskmanage: add wipe_blockdev method
based on the wipe_disks method from pve-manager's Ceph/Tools.pm with the
following main differences:
    * use wipefs to wipe labels first (to avoid sgdisk complaining about the
      backed up GPT structure on a subsequent GPT initialization)
    * only take one device as an argument
    * do not use an absolute path for 'dd'
    * die if one of the command fails

The wipefs command makes checks and complains about e.g. mounted or active
devices. One could supply --force to wipefs, but in many such situations it
does not work as expected, because the device would still be detected as in-use
afterwards, and further manaual steps would be needed.

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2021-06-02 11:56:51 +02:00
6f966017d0 bump version to 7.0-1
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-05-12 13:14:32 +02:00
522cd32738 remove some more DRBD references
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-05-12 13:14:17 +02:00
58a09dcad5 bump version to 7.0-1
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-05-12 13:01:45 +02:00
015984bbbe d/control: bump standards version
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-05-10 09:11:14 +02:00
f47d61f119 d/control: increase compat level to 12
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-05-10 09:10:57 +02:00
7a4d2928d4 d/control: update dependencies
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-05-10 09:10:38 +02:00
dbf11c2f05 remove internal, unmaintained, DRBD plugin
This was never marked stable and the recommended one is the external
version, which is maintained by linbit themselves.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-05-10 09:08:22 +02:00
a1e09e496e iscsi: code cleanup
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-05-04 12:02:47 +02:00
9177cc2eda clone image: specify base format option with qemu-img
and avoid a warning. It is deprecated to auto-detect the format of the base
volume. See commit d9f059aa6cfccefaffa3532556e966df4a99ece2 in qemu for more
information.

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2021-05-03 13:07:02 +02:00
dc348496d0 bump version to 6.4-1
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-04-23 16:18:47 +02:00
fef9987d4a d/control: depend on proxmox-backup-file-restore
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-04-23 15:34:27 +02:00
4708d32180 d/control: bump versioned dependency for libpve-common-perl
for the new file-restore helpers in PBSClient which we use in the API
here.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-04-23 15:15:56 +02:00
c1ec1acbde file-restore: pass in volume ID or name
instead of just the snapshot for consistency with other API endpoints,
and possible future extension to VMA backups (where 'snapshot' would be
a rather strange terminology).

add some additional checks (pbs storage type, backup volume type),
completion and magic (allow passing in either a full volume ID with
correct storage, or just the volume name, or just the snapshot for
easier API/CLI usage/convenience).

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2021-04-23 14:09:54 +02:00
82f764e119 file-restore: return perl-y booleans
like we do in most of our API.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2021-04-23 14:09:54 +02:00
f1a3ce3b17 add FileRestore API for PBS
Includes list and restore calls.

Requires VM.Backup and Datastore.Audit permissions, for the accessed
VM/CT and containing datastore respectively.

Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
2021-04-23 14:09:48 +02:00
6035a5dfb1 api: fix typo in error message
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2021-04-23 12:29:36 +02:00
c56f7a71af pbs: allow setting up a master key
similar to the existing encryption key handling, but without
auto-generation since we only have the public part here.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2021-04-22 21:56:31 +02:00
3c93115570 rbd: fix typo in error message
Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2021-04-20 18:21:31 +02:00
ceb7b1ed09 diskmanage: get_partnum: fix check
Not replacing it with return, because the current behavior is dying:
    Can't "next" outside a loop block
and the single existing caller in pve-manager's API2/Ceph/OSD.pm does not check
the return value.

Also check for $st, which can be undefined in case a non-existing path was
provided. This also led to dying previously:
    Can't call method "mode" on an undefined value

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2021-04-20 18:13:18 +02:00
415dc3985d diskmanage: improve setting usage for whole disk with include-partitions
in case a disk with partitions also has an fstype set, which happens for our ZFS
boot disks. Do not change the behavior without include-partitons, as we
prefer(red) to be more specific than simply 'partitions' then.

Reported in the enterprise support channel.

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2021-04-16 12:52:08 +02:00
1ebd925dcf import: allow import from UNIX socket
this allows forwarding over websockets without requiring a (free) port.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2021-04-16 12:23:43 +02:00
9e47ad47ec bump version to 6.3-9
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-04-12 16:14:36 +02:00
0d8ed0a313 test: rbd: improve usage output
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-04-12 15:43:42 +02:00
23ba4ac2c6 test: rbd: typo fix
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-04-12 15:27:33 +02:00
33191d3266 test: rbd: indendation cleanup, allow -d short-opt for debug
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-04-12 15:27:26 +02:00
0d7c9ca188 test: rbd: actually use debug helper
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-04-12 15:27:23 +02:00
bef7920d1e volume export/import: allow uppercase letters
Bug reported in the community forum[0].

Currently, it's possible to break replication by:
1. have an existing snapshot whose name contains an uppercase letter
2. set up a replication job and run it
3. rollback to the existing snapshot
4. replicate again -> fails

The failure occurs, because after step 3, the most recent common snapshot is the
previously existing one and currently no uppercase letters are allowed for
export/import.

The pve-snapshot-name option uses the CONFIGID_RE
    qr/[a-z][a-z0-9_-]+/i
so it cannot be used here, because it would not allow for e.g. '__migrate__'.
Simply allow uppercase letters, to be backwards compatible and allow all
possible pve-snapshot-name values.

There is still an issue if there also was state volume, but that's a different
bug[1].

[0]: https://forum.proxmox.com/threads/solved-migration-error-base-value-does-not-match-the-regex-pattern.85946/
[1]: https://bugzilla.proxmox.com/show_bug.cgi?id=3111

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2021-04-12 14:52:29 +02:00
9407a7a338 tests: rbd ns: exit cleanly on help, and allow short-opt -h
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-04-12 14:46:12 +02:00
876d268298 tests: rbd ns: avoid underscore in CLI param name
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-04-12 14:42:38 +02:00
8c858f7eeb fix #3345: zfs: restore container volume to ZFS with size 0
A restore to ZFS for a container which has a volume (rootfs / mount
point) of size 0 failed because the refquota property does not accept
'0k' but wants 'none' in that situation.

Signed-off-by: Aaron Lauterer <a.lauterer@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-04-12 14:37:50 +02:00
c27fe64810 rbd: make volume param for get_rbd_path to allow further use
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-04-09 14:19:48 +02:00
ed7ea5a352 rbd: list images: early return to avoid indentation
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-04-09 13:51:15 +02:00
a3cad0b50d rbd: list images: sort by keys when pushing on result array
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-04-09 13:49:56 +02:00
6d0d0a977d rbd: indentation and whitespace cleanups
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-04-09 13:48:27 +02:00
22265bd990 rbd: get kernel device sub returns a path, not a name
also transform to private sub instead of local variable closure.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-04-09 13:45:21 +02:00
72bbd8a6f7 rbd: consistent closure call style
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-04-09 13:43:33 +02:00