public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [pve-devel] [PATCH qemu-server 1/4] Use correct option for storage_migrate
@ 2020-07-29  9:44 Fabian Ebner
  2020-07-29  9:44 ` [pve-devel] [PATCH container 2/4] " Fabian Ebner
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Fabian Ebner @ 2020-07-29  9:44 UTC (permalink / raw)
  To: pve-devel

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
---
 PVE/QemuMigrate.pm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/PVE/QemuMigrate.pm b/PVE/QemuMigrate.pm
index b699b67..11fec4b 100644
--- a/PVE/QemuMigrate.pm
+++ b/PVE/QemuMigrate.pm
@@ -560,7 +560,7 @@ sub sync_disks {
 		$bwlimit = $bwlimit * 1024 if defined($bwlimit);
 
 		my $storage_migrate_opts = {
-		    'bwlimit' => $bwlimit,
+		    'ratelimit_bps' => $bwlimit,
 		    'insecure' => $opts->{migration_type} eq 'insecure',
 		    'with_snapshots' => $local_volumes->{$volid}->{snapshots},
 		    'allow_rename' => !$local_volumes->{$volid}->{is_vmstate},
-- 
2.20.1





^ permalink raw reply	[flat|nested] 5+ messages in thread

* [pve-devel] [PATCH container 2/4] Use correct option for storage_migrate
  2020-07-29  9:44 [pve-devel] [PATCH qemu-server 1/4] Use correct option for storage_migrate Fabian Ebner
@ 2020-07-29  9:44 ` Fabian Ebner
  2020-07-29  9:44 ` [pve-devel] [PATCH container 3/4] Log storage_migrate output Fabian Ebner
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Fabian Ebner @ 2020-07-29  9:44 UTC (permalink / raw)
  To: pve-devel

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
---
 src/PVE/LXC/Migrate.pm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/PVE/LXC/Migrate.pm b/src/PVE/LXC/Migrate.pm
index d0be6d4..e482657 100644
--- a/src/PVE/LXC/Migrate.pm
+++ b/src/PVE/LXC/Migrate.pm
@@ -287,7 +287,7 @@ sub phase1 {
 	$bwlimit = $bwlimit * 1024 if defined($bwlimit);
 
 	my $storage_migrate_opts = {
-	    'bwlimit' => $bwlimit,
+	    'ratelimit_bps' => $bwlimit,
 	    'insecure' => $opts->{migration_type} eq 'insecure',
 	    'with_snapshots' => $volhash->{$volid}->{snapshots},
 	};
-- 
2.20.1





^ permalink raw reply	[flat|nested] 5+ messages in thread

* [pve-devel] [PATCH container 3/4] Log storage_migrate output
  2020-07-29  9:44 [pve-devel] [PATCH qemu-server 1/4] Use correct option for storage_migrate Fabian Ebner
  2020-07-29  9:44 ` [pve-devel] [PATCH container 2/4] " Fabian Ebner
@ 2020-07-29  9:44 ` Fabian Ebner
  2020-07-29  9:44 ` [pve-devel] [PATCH storage 4/4] storage_migrate: log bandwidth limit Fabian Ebner
  2020-08-04 12:08 ` [pve-devel] applied: [PATCH qemu-server 1/4] Use correct option for storage_migrate Fabian Grünbichler
  3 siblings, 0 replies; 5+ messages in thread
From: Fabian Ebner @ 2020-07-29  9:44 UTC (permalink / raw)
  To: pve-devel

and make it more clear where an error within storage_migrate came from.

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
---
 src/PVE/LXC/Migrate.pm | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/src/PVE/LXC/Migrate.pm b/src/PVE/LXC/Migrate.pm
index e482657..90d74b4 100644
--- a/src/PVE/LXC/Migrate.pm
+++ b/src/PVE/LXC/Migrate.pm
@@ -292,7 +292,14 @@ sub phase1 {
 	    'with_snapshots' => $volhash->{$volid}->{snapshots},
 	};
 
-	PVE::Storage::storage_migrate($self->{storecfg}, $volid, $self->{ssh_info}, $sid, $storage_migrate_opts);
+	my $logfunc = sub { $self->log('info', $_[0]); };
+	eval {
+	    PVE::Storage::storage_migrate($self->{storecfg}, $volid, $self->{ssh_info},
+					  $sid, $storage_migrate_opts, $logfunc);
+	};
+	if (my $err = $@) {
+	    die "storage migration for '$volid' to storage '$sid' failed - $err\n";
+	}
     }
 
     my $conffile = PVE::LXC::Config->config_file($vmid);
-- 
2.20.1





^ permalink raw reply	[flat|nested] 5+ messages in thread

* [pve-devel] [PATCH storage 4/4] storage_migrate: log bandwidth limit
  2020-07-29  9:44 [pve-devel] [PATCH qemu-server 1/4] Use correct option for storage_migrate Fabian Ebner
  2020-07-29  9:44 ` [pve-devel] [PATCH container 2/4] " Fabian Ebner
  2020-07-29  9:44 ` [pve-devel] [PATCH container 3/4] Log storage_migrate output Fabian Ebner
@ 2020-07-29  9:44 ` Fabian Ebner
  2020-08-04 12:08 ` [pve-devel] applied: [PATCH qemu-server 1/4] Use correct option for storage_migrate Fabian Grünbichler
  3 siblings, 0 replies; 5+ messages in thread
From: Fabian Ebner @ 2020-07-29  9:44 UTC (permalink / raw)
  To: pve-devel

and avoid undefined post-if declaration of @cstream.

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
---
 PVE/Storage.pm | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/PVE/Storage.pm b/PVE/Storage.pm
index 6951e42..4a60615 100755
--- a/PVE/Storage.pm
+++ b/PVE/Storage.pm
@@ -637,8 +637,11 @@ sub storage_migrate {
     my $ssh_base = PVE::SSHInfo::ssh_info_to_command_base($target_sshinfo);
     local $ENV{RSYNC_RSH} = PVE::Tools::cmd2string($ssh_base);
 
-    my @cstream = ([ '/usr/bin/cstream', '-t', $ratelimit_bps ])
-	if defined($ratelimit_bps);
+    my @cstream;
+    if (defined($ratelimit_bps)) {
+	@cstream = ([ '/usr/bin/cstream', '-t', $ratelimit_bps ]);
+	$logfunc->("using a bandwidth limit of $ratelimit_bps bps for transferring '$volid'") if $logfunc;
+    }
 
     my $migration_snapshot;
     if (!defined($snapshot)) {
-- 
2.20.1





^ permalink raw reply	[flat|nested] 5+ messages in thread

* [pve-devel] applied: [PATCH qemu-server 1/4] Use correct option for storage_migrate
  2020-07-29  9:44 [pve-devel] [PATCH qemu-server 1/4] Use correct option for storage_migrate Fabian Ebner
                   ` (2 preceding siblings ...)
  2020-07-29  9:44 ` [pve-devel] [PATCH storage 4/4] storage_migrate: log bandwidth limit Fabian Ebner
@ 2020-08-04 12:08 ` Fabian Grünbichler
  3 siblings, 0 replies; 5+ messages in thread
From: Fabian Grünbichler @ 2020-08-04 12:08 UTC (permalink / raw)
  To: Proxmox VE development discussion

all four patches

On July 29, 2020 11:44 am, Fabian Ebner wrote:
> Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
> ---
>  PVE/QemuMigrate.pm | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/PVE/QemuMigrate.pm b/PVE/QemuMigrate.pm
> index b699b67..11fec4b 100644
> --- a/PVE/QemuMigrate.pm
> +++ b/PVE/QemuMigrate.pm
> @@ -560,7 +560,7 @@ sub sync_disks {
>  		$bwlimit = $bwlimit * 1024 if defined($bwlimit);
>  
>  		my $storage_migrate_opts = {
> -		    'bwlimit' => $bwlimit,
> +		    'ratelimit_bps' => $bwlimit,
>  		    'insecure' => $opts->{migration_type} eq 'insecure',
>  		    'with_snapshots' => $local_volumes->{$volid}->{snapshots},
>  		    'allow_rename' => !$local_volumes->{$volid}->{is_vmstate},
> -- 
> 2.20.1
> 
> 
> 
> _______________________________________________
> pve-devel mailing list
> pve-devel@lists.proxmox.com
> https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
> 
> 
> 




^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-08-04 12:08 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-29  9:44 [pve-devel] [PATCH qemu-server 1/4] Use correct option for storage_migrate Fabian Ebner
2020-07-29  9:44 ` [pve-devel] [PATCH container 2/4] " Fabian Ebner
2020-07-29  9:44 ` [pve-devel] [PATCH container 3/4] Log storage_migrate output Fabian Ebner
2020-07-29  9:44 ` [pve-devel] [PATCH storage 4/4] storage_migrate: log bandwidth limit Fabian Ebner
2020-08-04 12:08 ` [pve-devel] applied: [PATCH qemu-server 1/4] Use correct option for storage_migrate Fabian Grünbichler

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal