[pve-devel] [PATCH v2 container 6/7] rollback: handle pool limits
Fabian Grünbichler
f.gruenbichler at proxmox.com
Tue Apr 16 14:20:42 CEST 2024
by checking the snapshot conf values as if the CT was newly created.
Signed-off-by: Fabian Grünbichler <f.gruenbichler at proxmox.com>
---
src/PVE/API2/LXC/Snapshot.pm | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/src/PVE/API2/LXC/Snapshot.pm b/src/PVE/API2/LXC/Snapshot.pm
index 0999fbc..37a02a6 100644
--- a/src/PVE/API2/LXC/Snapshot.pm
+++ b/src/PVE/API2/LXC/Snapshot.pm
@@ -299,6 +299,13 @@ __PACKAGE__->register_method({
my $realcmd = sub {
PVE::Cluster::log_msg('info', $authuser, "rollback snapshot LXC $vmid: $snapname");
+ my $snap_conf = PVE::LXC::Config->load_config($vmid)->{snapshots}->{snapname};
+ my $snap_usage = PVE::LXC::Config->get_pool_usage($snap_conf);
+ my $changes = {
+ absolute => 1,
+ mem => $snap_usage->{mem},
+ cpu => $snap_usage->{cpu},
+ };
PVE::LXC::Config->snapshot_rollback($vmid, $snapname);
if ($param->{start}) {
--
2.39.2
More information about the pve-devel
mailing list