5
0
mirror of git://git.proxmox.com/git/pve-guest-common.git synced 2025-03-12 20:58:20 +03:00

142 Commits

Author SHA1 Message Date
Thomas Lamprecht
550010301d helpers: s/conf_table_with_pending/config_with_pending_array/ and comment
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-10-18 17:48:03 +02:00
Oguz Bektas
151444810f helpers: add method to represent config as a table
in vm_pending API, this method is used to represent the configuration as
a table with current, pending and delete columns.

by adding it as a guesthelper, we can also use it for container pending
changes.

Signed-off-by: Oguz Bektas <o.bektas@proxmox.com>
2019-10-18 17:48:03 +02:00
Oguz Bektas
bd240228e0 helpers: add pending-aware guest config printer from qemu-server
Signed-off-by: Oguz Bektas <o.bektas@proxmox.com>
2019-10-18 17:46:59 +02:00
Oguz Bektas
61264e82be abstractconfig: add load_current_config and load_snapshot_config
this code is already used by qemu-server's GET config API call. it is
however better to split this into to methods and decide what to run in
the API call.

this general implementation uses some $class helpers which allow to abstract
away the difference in the child classes. this will be used for
containers once they can do pending changes.

Signed-off-by: Oguz Bektas <o.bektas@proxmox.com>
2019-10-18 09:28:34 +02:00
Oguz Bektas
810ee08809 abstractconfig: add pending changes related helpers
use a better naming scheme for methods from qemuserver:

split_flagged_list -> parse_pending_delete
join_flagged_list -> print_pending_delete
vmconfig_delete_pending_option -> add_to_pending_delete
vmconfig_undelete_pending_option -> remove_from_pending_delete
vmconfig_cleanup_pending -> cleanup_pending

parse_pending_delete now has a better representation of the force value,
which is encoded in a perl hash i.e. $conf->{$opt}->{force} = 1 or 0
depending on if the string in config has '!' or not.

Signed-off-by: Oguz Bektas <o.bektas@proxmox.com>
2019-10-18 09:28:34 +02:00
Thomas Lamprecht
1aa76f2f0b base guest config: add common destroy_config implementation
copied over from pve-containers implementation with the same name.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-10-18 08:47:33 +02:00
Christian Ebner
8c3af92574 fix #1291: implement remove_vmid_from_backup_jobs
remove_vmid_from_backup_jobs updates the vzdump.cron backup jobs,
excluding the given vmid.

Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
2019-10-18 07:47:23 +02:00
Christian Ebner
e2a0a93be0 vzdump: move registration of vzdump.cron from manager to guest-common to avoid cyclic dependency
The registration of the vzdump.cron file was handled in pve-manager.
By moving the relevant code to pve-guest-common, cyclic dependencies
for cfs registration are avoided.
This makes this patch of guest-common a build dependency for the other
packages touched in this patch series.

Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
2019-10-18 07:47:23 +02:00
Thomas Lamprecht
5ee5f8873e followup: rename to print_snapshot_tree, add comment and rename $res param
This was taken from a CLI helper, there $res is a common parameter
name which denotes that it's the res from the API call the CLI
command bases on. But here that makes no sense and is not really
telling about what the value(s) of $res could be. Further explain
that with a comment.

As this also prints uncoditionally to STDOUT let's say so through the
method name.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-10-01 17:20:27 +02:00
Oguz Bektas
725dcadba3 reformat code for snapshot tree into GuestHelpers
qm/pct listsnapshot lack feature parity w.r.t. showing snapshots in a
tree ordered by the date. by moving this code into GuestHelpers, it can
be shared.

Signed-off-by: Oguz Bektas <o.bektas@proxmox.com>
2019-10-01 17:15:04 +02:00
Christian Ebner
1daaf2ea3f implement remove_vmid_jobs for ReplicationConfig
Allows to remove replication jobs from the config based on the vmid.

Preparations for #1291 fix

Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
2019-09-04 16:36:34 +02:00
Thomas Lamprecht
59af4860a1 buildsys: no need to include arch detection for arch-independent package
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-05-21 22:24:59 +02:00
Thomas Lamprecht
f7468cd95c buildsys: switch upload dist over to buster
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-05-21 21:08:05 +02:00
Thomas Lamprecht
8c0ad15e01 bump version to 3.0-1
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-05-21 21:03:47 +02:00
Thomas Lamprecht
130a35c615 buildsys: use dpkg-dev makefile helpers for pkg info
while we already dynamically resolved the version from the changelog
using dpkg-parsechangelog, and those dpkg-dev helpers also use that
tool, let's switch to them nonetheless to have a bit more stream
lined dev environment.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-05-21 21:00:51 +02:00
Thomas Lamprecht
eed4dab840 set debian source format to 1.0
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-05-21 21:00:13 +02:00
Wolfgang Link
3cdcfff633 increase max reading replication state file size.
In this file, the error of a failed job will also be stored.
The default 32768 bytes are not very much.

This file is on the local filesystem so there is no filesystem
size restrictions like in /etc/pve.
2019-04-17 07:26:53 +00:00
Thomas Lamprecht
a7b366396b bump version to 2.0-20
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-02-01 12:52:20 +01:00
Thomas Lamprecht
6ca3f296b6 d/control: bump version dependency of libpve-storage-perl
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-02-01 12:51:54 +01:00
Thomas Lamprecht
1c9da8ac5b follouwp: saner exception handling
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-02-01 10:10:48 +01:00
Dominik Csapak
3acb4e7463 add check/exec_hookscript to GuestHelpers
check_hookscript will be used for the container/vm api to check if the
hookscript volume id is correct

exec_hookscript can be called to execute a hookscript

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2019-02-01 10:10:48 +01:00
Wolfgang Bumiller
424c49e083 bump version to 2.0-19
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2019-01-03 10:22:26 +01:00
Wolfgang Bumiller
90fba9cdf3 replace complete_snapshot_name with snapshot_list
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2019-01-03 10:22:26 +01:00
Wolfgang Bumiller
96d913b07b Makefile: use dpkg-parsechangelog
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2019-01-03 09:55:14 +01:00
Thomas Lamprecht
b3b0025bd6 fix deprecated unescaped left brace in regex
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2018-12-14 14:06:08 +01:00
Rhonda D'Vine
eb50bb6141 Bash completion helper for snapshot name
This is the bash completion helper function for completing the snapshot
name.  This is used both in qemu-server and pve-container.

This patch is the base for the patches in qemu-server and pve-container.

Signed-off-by: Rhonda D'Vine <rhonda@proxmox.com>
2018-11-14 11:55:08 +01:00
Fabian Grünbichler
1cb9a21d49 d/control: remove perl from build-depends
it is not needed at all.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2018-11-14 11:03:21 +01:00
Fabian Grünbichler
e545d4ee95 d/control: add misc:Depends
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2018-11-14 11:03:21 +01:00
Fabian Grünbichler
9157e32ddc d/control|compat: bump to 10
default and recommended compat level in Debian Stretch

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2018-11-14 11:03:21 +01:00
Fabian Grünbichler
e906911285 d/control: wrap-and-sort
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2018-11-14 11:03:21 +01:00
Fabian Grünbichler
03067b4c94 d/control: bump standards version
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2018-11-14 11:03:21 +01:00
Fabian Grünbichler
3218c0d7b7 build: add dsc target
to build a source package

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2018-11-14 11:03:21 +01:00
Thomas Lamprecht
a9cfba5af0 d/control: fixup missing comma in Breaks
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2018-09-17 15:54:04 +02:00
Thomas Lamprecht
9ac3589ddc bump version to 2.0-18
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2018-09-17 15:25:08 +02:00
Thomas Lamprecht
16e02f0fe0 break qemu-server (<< 5.0-35)
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2018-09-17 15:25:08 +02:00
Dominik Csapak
3fa4ce4516 add snapshot rollback hook and remove qemu machine code
instead move the QEMU machine logic inside qemu-server package with
the help of the new snapshot rollback hook

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2018-09-17 15:21:22 +02:00
Thomas Lamprecht
bc6185bb38 bump version to 2.0-17 2018-06-19 14:07:19 +02:00
Thomas Lamprecht
cbbb06a5ae add create_and_lock_config
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2018-06-12 09:45:40 +02:00
Wolfgang Bumiller
24691c2141 cleanup: ReplicationConfig: be specific about write_config
Since it doesn't write but returns the text to be written,
let's be specific about the fact that we're returning a
value.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2018-05-14 13:51:26 +02:00
Fabian Grünbichler
48b638587f bump version to 2.0-16 2018-05-14 11:15:20 +02:00
Wolfgang Link
7319c02cfd Add lock to pervent lost update. 2018-05-09 15:10:30 +02:00
Wolfgang Link
7bbb0cd6a9 Swap source and target in replication config, if VM was stolen. 2018-05-09 15:10:30 +02:00
Wolfgang Link
286a9ab991 Add function: swap source and target in replication config 2018-05-09 15:10:30 +02:00
Wolfgang Link
d5b277dc99 Get snapshots when no state is available.
With this patch we can restore the state of a state less job.
It may happen that there are more replication snapshots,
because no job state is known can not delete any snapshot.
Existing multiple replication-snapshot happens
when a node fails in middel of a replication
and then the VM is moved to another node.
That's why we have to test if we have a common base on both nodes.
Given this, we take this as a replica state.
After we have a state again, the rest of the snapshots can be deleted on the next run.
2018-05-09 15:10:30 +02:00
Wolfgang Link
a1dfeff3a8 Delete replication snapshots only if last_sync is not 0.
If last_sync is 0, the VM configuration has been stolen
(either manually or by HA restoration).
Under this condition, the replication snapshot should not be deleted.
This snapshot is used to restore replication state.
If the last_snap is greater than 0 and does not match the snap name
it must be a remnant of an earlier sync and should be deleted.
2018-05-09 15:10:30 +02:00
Wolfgang Link
4ea5167ef0 Add config parameter 'source'.
This parameter is useful for restoring the replication status.
It is also corrected if it is missing or wrong.
2018-05-09 15:10:30 +02:00
Wolfgang Link
d869a19c9e Cleanup for stateless jobs.
If a VM configuration has been manually moved or recovered by HA,
there is no status on this new node.
In this case, the replication snapshots still exist on the remote side.
It must be possible to remove a job without status,
otherwise, a new replication job on the same remote node will fail
and the disks will have to be manually removed.
When searching through the sorted_volumes generated from the VMID.conf,
we can be sure that every disk will be removed in the event
of a complete job removal on the remote side.

In the end, the remote_prepare_local_job calls on the remote side a prepare.
2018-05-09 15:10:30 +02:00
Dietmar Maurer
235b2c059e bump version to 2.0-15 2018-04-16 11:48:13 +02:00
Dietmar Maurer
edd61f2b3a Replication.pm: code cleanup 2018-04-16 10:52:24 +02:00
Dietmar Maurer
c1797f7a4d PVE/Replication.pm: fix error message 2018-04-16 10:48:49 +02:00