fix #1754: rbd: fix handling of external clusters

with the recent refactoring, external clusters were not handled
correctly with librd if a pveceph or storage specific ceph config
exists.

change the behaviour to include the pveceph config file only for pveceph
managed clusters, and a storage specific one only for external ones.

set mon_host correctly using the values from storage.cfg for external
librbd clusters.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
This commit is contained in:
Fabian Grünbichler
2018-05-08 09:28:56 +02:00
committed by Thomas Lamprecht
parent fc05c9a0d8
commit 5fc02afb7d

View File

@ -47,7 +47,7 @@ my $ceph_connect_option = sub {
my $keyring = "/etc/pve/priv/ceph/${storeid}.keyring";
my $pveceph_managed = !defined($scfg->{monhost});
$cmd_option->{ceph_conf} = $pveceph_config if (-e $pveceph_config);
$cmd_option->{ceph_conf} = $pveceph_config if $pveceph_managed;
if (-e $ceph_storeid_conf) {
if ($pveceph_managed) {
@ -342,9 +342,8 @@ sub path {
my $path = "rbd:$pool/$name";
if ($cmd_option->{ceph_conf}) {
$path .= ":conf=$cmd_option->{ceph_conf}";
} else {
$path .= ":conf=$cmd_option->{ceph_conf}" if $cmd_option->{ceph_conf};
if (defined($scfg->{monhost})) {
my $monhost = $hostlist->($scfg->{monhost}, ';');
$monhost =~ s/:/\\:/g;
$path .= ":mon_host=$monhost";