[pve-devel] [PATCH manager 3/3] use correct info on disks in destroyosd and skip smart
Dominik Csapak
d.csapak at proxmox.com
Wed Oct 5 15:32:40 CEST 2016
instead of using
'/dev/${real_dev}'
we use the devpath property directly
also we skip the smart check in the cleanup
Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
---
PVE/API2/Ceph.pm | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/PVE/API2/Ceph.pm b/PVE/API2/Ceph.pm
index 030664a..7b1bbd0 100644
--- a/PVE/API2/Ceph.pm
+++ b/PVE/API2/Ceph.pm
@@ -330,11 +330,12 @@ __PACKAGE__->register_method ({
foreach my $real_dev (keys %$disklist) {
my $diskinfo = $disklist->{$real_dev};
+ my $devpath = $diskinfo->{devpath};
next if !$diskinfo->{gpt};
- if ($part =~ m|^/dev/${real_dev}(\d+)$|) {
+ if ($part =~ m|^${devpath}(\d+)$|) {
my $partnum = $1;
- print "remove partition $part (disk '/dev/${real_dev}', partnum $partnum)\n";
- eval { run_command(['/sbin/sgdisk', '-d', $partnum, "/dev/${real_dev}"]); };
+ print "remove partition $part (disk '${devpath}', partnum $partnum)\n";
+ eval { run_command(['/sbin/sgdisk', '-d', $partnum, "${devpath}"]); };
warn $@ if $@;
last;
}
@@ -367,7 +368,7 @@ __PACKAGE__->register_method ({
if (my $err = $@) {
warn $err;
} elsif ($param->{cleanup}) {
- my $disklist = PVE::Diskmanage::get_disks();
+ my $disklist = PVE::Diskmanage::get_disks(undef, 1);
&$remove_partition($disklist, $journal_part);
&$remove_partition($disklist, $data_part);
}
--
2.1.4
More information about the pve-devel
mailing list