public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [pve-devel] [PATCH container 0/2] 'target-storage' follow-ups
@ 2022-02-11 10:29 Fabian Grünbichler
  2022-02-11 10:29 ` [pve-devel] [PATCH container 1/2] migrate: improve target storage checks Fabian Grünbichler
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Fabian Grünbichler @ 2022-02-11 10:29 UTC (permalink / raw)
  To: pve-devel

the 'pve-targetstorage' standard option will be moved in a follow-up to
the remote migration series (with patches in qemu-server/pve-common
only, as pve-container picks up the option via pve-ha-manager anyway).

thanks Fabian Ebner for the quick but thorough review! :)

Fabian Grünbichler (2):
  migrate: improve target storage checks
  migrate: allow renaming of volumes

 src/PVE/API2/LXC.pm    | 2 +-
 src/PVE/LXC/Migrate.pm | 7 ++++---
 2 files changed, 5 insertions(+), 4 deletions(-)

-- 
2.30.2





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

* [pve-devel] [PATCH container 1/2] migrate: improve target storage checks
  2022-02-11 10:29 [pve-devel] [PATCH container 0/2] 'target-storage' follow-ups Fabian Grünbichler
@ 2022-02-11 10:29 ` Fabian Grünbichler
  2022-02-11 10:29 ` [pve-devel] [PATCH container 2/2] migrate: allow renaming of volumes Fabian Grünbichler
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Fabian Grünbichler @ 2022-02-11 10:29 UTC (permalink / raw)
  To: pve-devel

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
---
 src/PVE/API2/LXC.pm    | 2 +-
 src/PVE/LXC/Migrate.pm | 6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/PVE/API2/LXC.pm b/src/PVE/API2/LXC.pm
index 37db841..84712f7 100644
--- a/src/PVE/API2/LXC.pm
+++ b/src/PVE/API2/LXC.pm
@@ -1162,7 +1162,7 @@ __PACKAGE__->register_method({
 	if (my $targetstorage = delete $param->{'target-storage'}) {
 	    my $storecfg = PVE::Storage::config();
 	    my $storagemap = eval { PVE::JSONSchema::parse_idmap($targetstorage, 'pve-storage-id') };
-	    raise_param_exc({ targetstorage => "failed to parse storage map: $@" })
+	    raise_param_exc({ 'target-storage' => "failed to parse storage map: $@" })
 		if $@;
 
 	    $rpcenv->check_vm_perm($authuser, $vmid, undef, ['VM.Config.Disk'])
diff --git a/src/PVE/LXC/Migrate.pm b/src/PVE/LXC/Migrate.pm
index c85a09c..1739c78 100644
--- a/src/PVE/LXC/Migrate.pm
+++ b/src/PVE/LXC/Migrate.pm
@@ -211,10 +211,10 @@ sub phase1 {
 
 	# check if storage is available on target node
 	my $targetsid = PVE::JSONSchema::map_id($self->{opts}->{storagemap}, $storeid);
-	PVE::Storage::storage_check_enabled($self->{storecfg}, $targetsid, $self->{node});
+	my $target_scfg = PVE::Storage::storage_check_enabled($self->{storecfg}, $targetsid, $self->{node});
 
-	die "content type 'rootdir' is not available on storage '$storeid'\n"
-	    if !$scfg->{content}->{rootdir};
+	die "content type 'rootdir' is not available on storage '$targetsid'\n"
+	    if !$target_scfg->{content}->{rootdir};
 
 	PVE::Storage::foreach_volid($dl, sub {
 	    my ($volid, $sid, $volname) = @_;
-- 
2.30.2





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

* [pve-devel] [PATCH container 2/2] migrate: allow renaming of volumes
  2022-02-11 10:29 [pve-devel] [PATCH container 0/2] 'target-storage' follow-ups Fabian Grünbichler
  2022-02-11 10:29 ` [pve-devel] [PATCH container 1/2] migrate: improve target storage checks Fabian Grünbichler
@ 2022-02-11 10:29 ` Fabian Grünbichler
  2022-02-11 11:33 ` [pve-devel] [PATCH container 0/2] 'target-storage' follow-ups Fabian Ebner
  2022-02-11 15:17 ` [pve-devel] applied-series: " Thomas Lamprecht
  3 siblings, 0 replies; 5+ messages in thread
From: Fabian Grünbichler @ 2022-02-11 10:29 UTC (permalink / raw)
  To: pve-devel

the config is now updated anyway because of target-storage support, so
volume renaming is both 'free' and improves the chances of migration
with and without changing storages actually works successfully.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
---
 src/PVE/LXC/Migrate.pm | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/PVE/LXC/Migrate.pm b/src/PVE/LXC/Migrate.pm
index 1739c78..64bdd38 100644
--- a/src/PVE/LXC/Migrate.pm
+++ b/src/PVE/LXC/Migrate.pm
@@ -304,6 +304,7 @@ sub phase1 {
 		'ratelimit_bps' => $bwlimit,
 		'insecure' => $opts->{migration_type} eq 'insecure',
 		'with_snapshots' => $volhash->{$volid}->{snapshots},
+		'allow_rename' => 1,
 	    };
 
 	    my $logfunc = sub { $self->log('info', $_[0]); };
-- 
2.30.2





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

* Re: [pve-devel] [PATCH container 0/2] 'target-storage' follow-ups
  2022-02-11 10:29 [pve-devel] [PATCH container 0/2] 'target-storage' follow-ups Fabian Grünbichler
  2022-02-11 10:29 ` [pve-devel] [PATCH container 1/2] migrate: improve target storage checks Fabian Grünbichler
  2022-02-11 10:29 ` [pve-devel] [PATCH container 2/2] migrate: allow renaming of volumes Fabian Grünbichler
@ 2022-02-11 11:33 ` Fabian Ebner
  2022-02-11 15:17 ` [pve-devel] applied-series: " Thomas Lamprecht
  3 siblings, 0 replies; 5+ messages in thread
From: Fabian Ebner @ 2022-02-11 11:33 UTC (permalink / raw)
  To: pve-devel, Fabian Grünbichler

Am 11.02.22 um 11:29 schrieb Fabian Grünbichler:
> the 'pve-targetstorage' standard option will be moved in a follow-up to
> the remote migration series (with patches in qemu-server/pve-common
> only, as pve-container picks up the option via pve-ha-manager anyway).
> 
> thanks Fabian Ebner for the quick but thorough review! :)
> 
> Fabian Grünbichler (2):
>   migrate: improve target storage checks
>   migrate: allow renaming of volumes
> 

Both patches:

Reviewed-by: Fabian Ebner <f.ebner@proxmox.com>

>  src/PVE/API2/LXC.pm    | 2 +-
>  src/PVE/LXC/Migrate.pm | 7 ++++---
>  2 files changed, 5 insertions(+), 4 deletions(-)
> 




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

* [pve-devel] applied-series: [PATCH container 0/2] 'target-storage' follow-ups
  2022-02-11 10:29 [pve-devel] [PATCH container 0/2] 'target-storage' follow-ups Fabian Grünbichler
                   ` (2 preceding siblings ...)
  2022-02-11 11:33 ` [pve-devel] [PATCH container 0/2] 'target-storage' follow-ups Fabian Ebner
@ 2022-02-11 15:17 ` Thomas Lamprecht
  3 siblings, 0 replies; 5+ messages in thread
From: Thomas Lamprecht @ 2022-02-11 15:17 UTC (permalink / raw)
  To: Proxmox VE development discussion, Fabian Grünbichler

On 11.02.22 11:29, Fabian Grünbichler wrote:
> the 'pve-targetstorage' standard option will be moved in a follow-up to
> the remote migration series (with patches in qemu-server/pve-common
> only, as pve-container picks up the option via pve-ha-manager anyway).
> 
> thanks Fabian Ebner for the quick but thorough review! :)
> 
> Fabian Grünbichler (2):
>   migrate: improve target storage checks
>   migrate: allow renaming of volumes
> 
>  src/PVE/API2/LXC.pm    | 2 +-
>  src/PVE/LXC/Migrate.pm | 7 ++++---
>  2 files changed, 5 insertions(+), 4 deletions(-)
> 



applied, thanks!




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

end of thread, other threads:[~2022-02-11 15:17 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-11 10:29 [pve-devel] [PATCH container 0/2] 'target-storage' follow-ups Fabian Grünbichler
2022-02-11 10:29 ` [pve-devel] [PATCH container 1/2] migrate: improve target storage checks Fabian Grünbichler
2022-02-11 10:29 ` [pve-devel] [PATCH container 2/2] migrate: allow renaming of volumes Fabian Grünbichler
2022-02-11 11:33 ` [pve-devel] [PATCH container 0/2] 'target-storage' follow-ups Fabian Ebner
2022-02-11 15:17 ` [pve-devel] applied-series: " Thomas Lamprecht

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