Re: [pve-devel] [PATCH] Add qga freeze in vzdump in snapshot mode
comments inline: > PVE/VZDump/QemuServer.pm | 19 +-- > 1 file changed, 17 insertions(+), 2 deletions(-) > > diff --git a/PVE/VZDump/QemuServer.pm b/PVE/VZDump/QemuServer.pm index > fd36c69..2c62de3 100644 > --- a/PVE/VZDump/QemuServer.pm > +++ b/PVE/VZDump/QemuServer.pm > @@ -286,8 +286,8 @@ sub archive { > my $resume_on_backup; > > my $skiplock = 1; > - > -if (!PVE::QemuServer::check_running($vmid)) { > +my $vm_is_running = PVE::QemuServer::check_running($vmid); > +if (!$vm_is_running) { > eval { > $self->loginfo("starting kvm to execute backup task"); > PVE::QemuServer::vm_start($self->{storecfg}, $vmid, undef, @@ - > 380,8 +380,23 @@ sub archive { > > $qmpclient->queue_cmd($vmid, $add_fd_cb, 'getfd', > fd => $outfileno, fdname => "backup"); > + > + my $freeze_fs = 0; > + > + if ( $self->{vmlist}->{$vmid}->{agent} == 1 && $vm_is_running ){ please use: if ( $self->{vmlist}->{$vmid}->{agent} && $vm_is_running ) { > + $freeze_fs = PVE::QemuServer::vm_mon_cmd($vmid,"guest-fsfreeze- > freeze"); > + $self->loginfo("Can't freeze fs!")if ( defined($freeze_fs) && > $freeze_fs == 0 ); > + } > + Please note that the result from qqa command is not trusted, so you need to parse the result if you really want to use it. Also, sometime guest-fsfreeze-freeze just returns an empty string ''. Also, it can run into timeouts, and can raise other exceptions. So please catch exceptions here. > $qmpclient->queue_execute(); > > + my $thaw_fs = 0; > + $thaw_fs= PVE::QemuServer::vm_mon_cmd($vmid,"guest-fsfreeze- > thaw") > + if ( $freeze_fs > 0 ); > + > + $self->loginfo("Error by trying thaw fs, you must unlock manually") > + if ( $freeze_fs > 0 && 0 != $freeze_fs - $thaw_fs ); > + Same here (exceptions, parse result). I would simply ignore the result of those commands (to keep it simple). ___ pve-devel mailing list pve-devel@pve.proxmox.com http://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
Re: [pve-devel] [PATCH] Add qga freeze in vzdump in snapshot mode
applied, thanks! > it will freeze the filesystem to provide consistents. > > Signed-off-by: Wolfgang Link > --- > PVE/VZDump/QemuServer.pm | 18 -- > 1 file changed, 16 insertions(+), 2 deletions(-) ___ pve-devel mailing list pve-devel@pve.proxmox.com http://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
Re: [pve-devel] [PATCH] Add qga freeze in vzdump in snapshot mode
This will invoke vss on Windows clients? Lindsay Mathieson -Original Message- From: "Wolfgang Link" Sent: 9/12/2014 8:13 PM To: "pve-devel@pve.proxmox.com" Subject: [pve-devel] [PATCH] Add qga freeze in vzdump in snapshot mode it will freeze the filesystem to provide consistents. Signed-off-by: Wolfgang Link --- PVE/VZDump/QemuServer.pm | 18 -- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/PVE/VZDump/QemuServer.pm b/PVE/VZDump/QemuServer.pm index fd36c69..b9edea1 100644 --- a/PVE/VZDump/QemuServer.pm +++ b/PVE/VZDump/QemuServer.pm @@ -286,8 +286,8 @@ sub archive { my $resume_on_backup; my $skiplock = 1; - -if (!PVE::QemuServer::check_running($vmid)) { +my $vm_is_running = PVE::QemuServer::check_running($vmid); +if (!$vm_is_running) { eval { $self->loginfo("starting kvm to execute backup task"); PVE::QemuServer::vm_start($self->{storecfg}, $vmid, undef, @@ -380,8 +380,22 @@ sub archive { $qmpclient->queue_cmd($vmid, $add_fd_cb, 'getfd', fd => $outfileno, fdname => "backup"); + + if ($self->{vmlist}->{$vmid}->{agent} && $vm_is_running){ + eval {PVE::QemuServer::vm_mon_cmd($vmid,"guest-fsfreeze-freeze");}; + if (my $err = $@) { + $self->logerr($err); + } + } + $qmpclient->queue_execute(); + if ($self->{vmlist}->{$vmid}->{agent} && $vm_is_running ){ + eval {PVE::QemuServer::vm_mon_cmd($vmid,"guest-fsfreeze-thaw");}; + if (my $err = $@) { + $self->logerr($err); + } + } die $qmpclient->{errors}->{$vmid} if $qmpclient->{errors}->{$vmid}; if ($cpid) { -- 1.7.10.4 ___ pve-devel mailing list pve-devel@pve.proxmox.com http://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel ___ pve-devel mailing list pve-devel@pve.proxmox.com http://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
Re: [pve-devel] [PATCH] Add qga freeze in vzdump in snapshot mode
> This will invoke vss on Windows clients? yes. ___ pve-devel mailing list pve-devel@pve.proxmox.com http://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
Re: [pve-devel] [PATCH] Add qga freeze in vzdump in snapshot mode
On Wed, 10 Dec 2014 07:57:30 AM Dietmar Maurer wrote: > > This will invoke vss on Windows clients? > > yes. Awesome, great news -- Lindsay signature.asc Description: This is a digitally signed message part. ___ pve-devel mailing list pve-devel@pve.proxmox.com http://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
Re: [pve-devel] [PATCH] Add qga freeze in vzdump in snapshot mode
Fantastic, I waited a long time this feature !!! How can I install qga service in Windows VM ? Where I can download it ? And the service configurations inside VM ? Very thanks Luca ___ pve-devel mailing list pve-devel@pve.proxmox.com http://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel