]> git.proxmox.com Git - pve-container.git/commitdiff
vzdump:lxc: sync and skip journal in snapshot mode
authorWolfgang Bumiller <w.bumiller@proxmox.com>
Fri, 25 Sep 2015 12:08:01 +0000 (14:08 +0200)
committerDietmar Maurer <dietmar@proxmox.com>
Fri, 25 Sep 2015 15:54:09 +0000 (17:54 +0200)
We now perform a 'sync' after 'lxc-freeze' and before
creating the snapshot, since we now mount snapshots with
'-o noload' which skips the journal entirely.

src/PVE/LXC.pm

index edc9b12ad9f34fdd174cc25822bcb30803eebb68..a3d6d49a57c2b10947f0fa2736d2ce19bae14ea5 100644 (file)
@@ -1718,20 +1718,19 @@ sub snapshot_create {
 
     my $conf = load_config($vmid);
 
-    my $cmd = "/usr/bin/lxc-freeze -n $vmid";
     my $running = check_running($vmid);
     eval {
        if ($running) {
-           PVE::Tools::run_command($cmd);
+           PVE::Tools::run_command(['/usr/bin/lxc-freeze', '-n', $vmid]);
+           PVE::Tools::run_command(['/bin/sync']);
        };
 
        my $storecfg = PVE::Storage::config();
        my $rootinfo = parse_ct_mountpoint($conf->{rootfs});
        my $volid = $rootinfo->{volume};
 
-       $cmd = "/usr/bin/lxc-unfreeze -n $vmid";
        if ($running) {
-           PVE::Tools::run_command($cmd);
+           PVE::Tools::run_command(['/usr/bin/lxc-unfreeze', '-n', $vmid]);
        };
 
        PVE::Storage::volume_snapshot($storecfg, $volid, $snapname);