From 4e2d3bc8ead04335475c721f4b65a1a5bf04810b Mon Sep 17 00:00:00 2001 From: Alexandre Derumier Date: Mon, 18 Jun 2012 09:48:25 +0200 Subject: [PATCH] rbd : use keyring file instead keyfile we need 1 keyring by rbd storage /etc/pve/priv/ceph/storagename.keyring Signed-off-by: Alexandre Derumier --- PVE/Storage/RBDPlugin.pm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/PVE/Storage/RBDPlugin.pm b/PVE/Storage/RBDPlugin.pm index 2370fc7..fca4664 100644 --- a/PVE/Storage/RBDPlugin.pm +++ b/PVE/Storage/RBDPlugin.pm @@ -17,7 +17,7 @@ sub rbd_ls{ my $monhost = $scfg->{monhost}; $monhost =~ s/;/,/g; - my $cmd = ['/usr/bin/rbd', '-p', $rbdpool, '-m', $monhost, '-n', "client.".$scfg->{username} ,'--keyfile', '/etc/pve/priv/ceph/'.$storeid.'.'.$scfg->{username}.'.key', '--auth_supported',$scfg->{authsupported}, 'ls' ]; + my $cmd = ['/usr/bin/rbd', '-p', $rbdpool, '-m', $monhost, '-n', "client.".$scfg->{username} ,'--keyring', '/etc/pve/priv/ceph/'.$storeid.'.keyring', '--auth_supported',$scfg->{authsupported}, 'ls' ]; my $list = {}; my $errfunc = sub { @@ -132,7 +132,7 @@ sub path { my $username = $scfg->{username}; my $authsupported = addslashes($scfg->{authsupported}); - my $path = "rbd:$pool/$name:id=$username:auth_supported=$authsupported:keyfile=/etc/pve/priv/ceph/$storeid.$username.key:mon_host=$monhost"; + my $path = "rbd:$pool/$name:id=$username:auth_supported=$authsupported:keyring=/etc/pve/priv/ceph/$storeid.keyring:mon_host=$monhost"; return ($path, $vmid, $vtype); } @@ -162,7 +162,7 @@ sub alloc_image { die "unable to allocate an image name for VM $vmid in storage '$storeid'\n" if !$name; - my $cmd = ['/usr/bin/rbd', '-p', $rbdpool, '-m', $monhost, '-n', "client.".$scfg->{username}, '--keyfile','/etc/pve/priv/ceph/'.$storeid.'.'.$scfg->{username}.'.key','--auth_supported', $scfg->{authsupported}, 'create', '--size', ($size/1024), $name ]; + my $cmd = ['/usr/bin/rbd', '-p', $rbdpool, '-m', $monhost, '-n', "client.".$scfg->{username}, '--keyring','/etc/pve/priv/ceph/'.$storeid.'.keyring','--auth_supported', $scfg->{authsupported}, 'create', '--size', ($size/1024), $name ]; run_command($cmd, errmsg => "rbd create $name' error"); return $name; @@ -175,7 +175,7 @@ sub free_image { my $monhost = $scfg->{monhost}; $monhost =~ s/;/,/g; - my $cmd = ['/usr/bin/rbd', '-p', $rbdpool, '-m', $monhost, '-n', "client.".$scfg->{username}, '--keyfile','/etc/pve/priv/ceph/'.$storeid.'.'.$scfg->{username}.'.key','--auth_supported',$scfg->{authsupported}, 'rm', $volname ]; + my $cmd = ['/usr/bin/rbd', '-p', $rbdpool, '-m', $monhost, '-n', "client.".$scfg->{username}, '--keyring','/etc/pve/priv/ceph/'.$storeid.'.keyring','--auth_supported',$scfg->{authsupported}, 'rm', $volname ]; run_command($cmd, errmsg => "rbd rm $volname' error"); return undef; -- 2.39.2