[pve-devel] [PATCH 03/19] disable target storage avaibility for externalcluster (fixme)

Thomas Lamprecht t.lamprecht at proxmox.com
Thu Mar 9 13:19:47 CET 2017


On 02/22/2017 02:33 PM, Alexandre Derumier wrote:
> need to implement a method to check that remotly. that later in ssh tunnel ?

A possibility would be getting the remote storages over the API, i.e.:

/storage/<storage_id>

In fact, almost all should be done over the API, and if not we should 
try to enhance it.
I.e. let the user enter the user/password or some other form of auth and 
then do
everything directly over the API.

Besides all that and there is the idea of a "Proxmox Datacenter Manager",
essentially a way with which multiple cluster could be manged centrally,
synchronous with own interface/daemon which connects to the single
cluster nodes through the API.
Your idea could fit there in quite well, imo.
We have already split out some parts (e.g.: pve-api-client, extjs, 
pve-http-server)
which should help making it.

> Signed-off-by: Alexandre Derumier <aderumier at odiso.com>
> ---
>   PVE/API2/Qemu.pm   | 2 +-
>   PVE/QemuMigrate.pm | 4 ++--
>   2 files changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/PVE/API2/Qemu.pm b/PVE/API2/Qemu.pm
> index 01d97bc..e6d46ba 100644
> --- a/PVE/API2/Qemu.pm
> +++ b/PVE/API2/Qemu.pm
> @@ -2804,7 +2804,7 @@ __PACKAGE__->register_method({
>   	}
>   
>   	my $storecfg = PVE::Storage::config();
> -	PVE::QemuServer::check_storage_availability($storecfg, $conf, $target);
> +	PVE::QemuServer::check_storage_availability($storecfg, $conf, $target) if !$param->{externalcluster};

Now I'm really in favor of 'external_migration' instead of 
'externalcluster',
it's much more descriptive IMHO.

>   
>   	if (PVE::HA::Config::vm_is_ha_managed($vmid) && $rpcenv->{type} ne 'ha') {
>   
> diff --git a/PVE/QemuMigrate.pm b/PVE/QemuMigrate.pm
> index cd1fc2b..8d1f9e8 100644
> --- a/PVE/QemuMigrate.pm
> +++ b/PVE/QemuMigrate.pm
> @@ -189,7 +189,7 @@ sub prepare {
>   	my $targetsid = $self->{opts}->{targetstorage} ? $self->{opts}->{targetstorage} : $sid;
>   
>   	my $scfg = PVE::Storage::storage_check_node($self->{storecfg}, $sid);
> -	PVE::Storage::storage_check_node($self->{storecfg}, $targetsid, $self->{node});
> +	PVE::Storage::storage_check_node($self->{storecfg}, $targetsid, $self->{node}) if !$self->{opts}->{externalcluster};
>   
>   	if ($scfg->{shared}) {
>   	    # PVE::Storage::activate_storage checks this for non-shared storages
> @@ -256,7 +256,7 @@ sub sync_disks {
>   	    next if @{$dl->{$storeid}} == 0;
>   
>   	    # check if storage is available on target node
> -	    PVE::Storage::storage_check_node($self->{storecfg}, $storeid, $self->{node});
> +	    PVE::Storage::storage_check_node($self->{storecfg}, $storeid, $self->{node}) if !$self->{opts}->{externalcluster};
>   	    $sharedvm = 0; # there is a non-shared disk
>   
>   	    PVE::Storage::foreach_volid($dl, sub {





More information about the pve-devel mailing list