mirror of
git://git.proxmox.com/git/pve-storage.git
synced 2025-01-14 19:24:33 +03:00
be more verebose on rbd commands to get progress
Signed-off-by: Stefan Priebe <s.priebe@profihost.ag>
This commit is contained in:
parent
0b79e98ccb
commit
8cc610093b
@ -293,7 +293,7 @@ sub create_base {
|
|||||||
my $newvolname = $basename ? "$basename/$newname" : "$newname";
|
my $newvolname = $basename ? "$basename/$newname" : "$newname";
|
||||||
|
|
||||||
my $cmd = &$rbd_cmd($scfg, $storeid, 'rename', &$add_pool_to_disk($scfg, $name), &$add_pool_to_disk($scfg, $newname));
|
my $cmd = &$rbd_cmd($scfg, $storeid, 'rename', &$add_pool_to_disk($scfg, $name), &$add_pool_to_disk($scfg, $newname));
|
||||||
run_command($cmd, errmsg => "rbd rename $name' error", errfunc => sub {});
|
run_command($cmd, errmsg => "rbd rename '$name' error");
|
||||||
|
|
||||||
my $running = undef; #fixme : is create_base always offline ?
|
my $running = undef; #fixme : is create_base always offline ?
|
||||||
|
|
||||||
@ -303,7 +303,7 @@ sub create_base {
|
|||||||
|
|
||||||
if (!$protected){
|
if (!$protected){
|
||||||
my $cmd = &$rbd_cmd($scfg, $storeid, 'snap', 'protect', $newname, '--snap', $snap);
|
my $cmd = &$rbd_cmd($scfg, $storeid, 'snap', 'protect', $newname, '--snap', $snap);
|
||||||
run_command($cmd, errmsg => "rbd protect $newname snap $snap' error", errfunc => sub {});
|
run_command($cmd, errmsg => "rbd protect $newname snap $snap' error");
|
||||||
}
|
}
|
||||||
|
|
||||||
return $newvolname;
|
return $newvolname;
|
||||||
@ -327,7 +327,7 @@ sub clone_image {
|
|||||||
my $newvol = "$basename/$name";
|
my $newvol = "$basename/$name";
|
||||||
|
|
||||||
my $cmd = &$rbd_cmd($scfg, $storeid, 'clone', &$add_pool_to_disk($scfg, $basename), '--snap', $snap, &$add_pool_to_disk($scfg, $name));
|
my $cmd = &$rbd_cmd($scfg, $storeid, 'clone', &$add_pool_to_disk($scfg, $basename), '--snap', $snap, &$add_pool_to_disk($scfg, $name));
|
||||||
run_command($cmd, errmsg => "rbd clone $basename' error", errfunc => sub {});
|
run_command($cmd, errmsg => "rbd clone $basename' error");
|
||||||
|
|
||||||
return $newvol;
|
return $newvol;
|
||||||
}
|
}
|
||||||
@ -342,7 +342,7 @@ sub alloc_image {
|
|||||||
$name = &$find_free_diskname($storeid, $scfg, $vmid);
|
$name = &$find_free_diskname($storeid, $scfg, $vmid);
|
||||||
|
|
||||||
my $cmd = &$rbd_cmd($scfg, $storeid, 'create', '--format' , 2, '--size', int(($size+1023)/1024), $name);
|
my $cmd = &$rbd_cmd($scfg, $storeid, 'create', '--format' , 2, '--size', int(($size+1023)/1024), $name);
|
||||||
run_command($cmd, errmsg => "rbd create $name' error", errfunc => sub {});
|
run_command($cmd, errmsg => "rbd create $name' error");
|
||||||
|
|
||||||
return $name;
|
return $name;
|
||||||
}
|
}
|
||||||
@ -358,15 +358,15 @@ sub free_image {
|
|||||||
my (undef, undef, undef, $protected) = rbd_volume_info($scfg, $storeid, $name, $snap);
|
my (undef, undef, undef, $protected) = rbd_volume_info($scfg, $storeid, $name, $snap);
|
||||||
if ($protected){
|
if ($protected){
|
||||||
my $cmd = &$rbd_cmd($scfg, $storeid, 'snap', 'unprotect', $name, '--snap', $snap);
|
my $cmd = &$rbd_cmd($scfg, $storeid, 'snap', 'unprotect', $name, '--snap', $snap);
|
||||||
run_command($cmd, errmsg => "rbd unprotect $name snap $snap' error", errfunc => sub {});
|
run_command($cmd, errmsg => "rbd unprotect $name snap $snap' error");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
my $cmd = &$rbd_cmd($scfg, $storeid, 'snap', 'purge', $name);
|
my $cmd = &$rbd_cmd($scfg, $storeid, 'snap', 'purge', $name);
|
||||||
run_command($cmd, errmsg => "rbd snap purge $volname' error", outfunc => sub {}, errfunc => sub {});
|
run_command($cmd, errmsg => "rbd snap purge $volname' error");
|
||||||
|
|
||||||
$cmd = &$rbd_cmd($scfg, $storeid, 'rm', $name);
|
$cmd = &$rbd_cmd($scfg, $storeid, 'rm', $name);
|
||||||
run_command($cmd, errmsg => "rbd rm $volname' error", outfunc => sub {}, errfunc => sub {});
|
run_command($cmd, errmsg => "rbd rm $volname' error");
|
||||||
|
|
||||||
return undef;
|
return undef;
|
||||||
}
|
}
|
||||||
@ -467,7 +467,7 @@ sub volume_resize {
|
|||||||
my ($vtype, $name, $vmid) = $class->parse_volname($volname);
|
my ($vtype, $name, $vmid) = $class->parse_volname($volname);
|
||||||
|
|
||||||
my $cmd = &$rbd_cmd($scfg, $storeid, 'resize', '--size', ($size/1024/1024), $name);
|
my $cmd = &$rbd_cmd($scfg, $storeid, 'resize', '--size', ($size/1024/1024), $name);
|
||||||
run_command($cmd, errmsg => "rbd resize $volname' error", errfunc => sub {});
|
run_command($cmd, errmsg => "rbd resize $volname' error");
|
||||||
return undef;
|
return undef;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -479,7 +479,7 @@ sub volume_snapshot {
|
|||||||
my ($vtype, $name, $vmid) = $class->parse_volname($volname);
|
my ($vtype, $name, $vmid) = $class->parse_volname($volname);
|
||||||
|
|
||||||
my $cmd = &$rbd_cmd($scfg, $storeid, 'snap', 'create', '--snap', $snap, $name);
|
my $cmd = &$rbd_cmd($scfg, $storeid, 'snap', 'create', '--snap', $snap, $name);
|
||||||
run_command($cmd, errmsg => "rbd snapshot $volname' error", errfunc => sub {});
|
run_command($cmd, errmsg => "rbd snapshot $volname' error");
|
||||||
return undef;
|
return undef;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -489,7 +489,7 @@ sub volume_snapshot_rollback {
|
|||||||
my ($vtype, $name, $vmid) = $class->parse_volname($volname);
|
my ($vtype, $name, $vmid) = $class->parse_volname($volname);
|
||||||
|
|
||||||
my $cmd = &$rbd_cmd($scfg, $storeid, 'snap', 'rollback', '--snap', $snap, $name);
|
my $cmd = &$rbd_cmd($scfg, $storeid, 'snap', 'rollback', '--snap', $snap, $name);
|
||||||
run_command($cmd, errmsg => "rbd snapshot $volname to $snap' error", errfunc => sub {});
|
run_command($cmd, errmsg => "rbd snapshot $volname to $snap' error");
|
||||||
}
|
}
|
||||||
|
|
||||||
sub volume_snapshot_delete {
|
sub volume_snapshot_delete {
|
||||||
@ -500,7 +500,7 @@ sub volume_snapshot_delete {
|
|||||||
my ($vtype, $name, $vmid) = $class->parse_volname($volname);
|
my ($vtype, $name, $vmid) = $class->parse_volname($volname);
|
||||||
|
|
||||||
my $cmd = &$rbd_cmd($scfg, $storeid, 'snap', 'rm', '--snap', $snap, $name);
|
my $cmd = &$rbd_cmd($scfg, $storeid, 'snap', 'rm', '--snap', $snap, $name);
|
||||||
run_command($cmd, errmsg => "rbd snapshot $volname' error", errfunc => sub {});
|
run_command($cmd, errmsg => "rbd snapshot $volname' error");
|
||||||
return undef;
|
return undef;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user