code cleanups
This commit is contained in:
@ -548,25 +548,23 @@ sub storage_migrate {
|
|||||||
if (($scfg->{type} eq $tcfg->{type}) &&
|
if (($scfg->{type} eq $tcfg->{type}) &&
|
||||||
($tcfg->{type} eq 'lvmthin' || $tcfg->{type} eq 'lvm')) {
|
($tcfg->{type} eq 'lvmthin' || $tcfg->{type} eq 'lvm')) {
|
||||||
|
|
||||||
my (undef, $volname) = parse_volname($cfg, $volid);
|
my (undef, $volname, $vmid) = parse_volname($cfg, $volid);
|
||||||
my $size = volume_size_info($cfg, $volid, 5);
|
my $size = volume_size_info($cfg, $volid, 5);
|
||||||
my $path = path($cfg, $volid);
|
my $src = path($cfg, $volid);
|
||||||
|
my $dst = path($cfg, $target_volid);
|
||||||
$volname =~ m/^vm-(\d+)-/;
|
|
||||||
my $vmid = $1;
|
|
||||||
|
|
||||||
run_command(['/usr/bin/ssh', "root\@${target_host}",
|
run_command(['/usr/bin/ssh', "root\@${target_host}",
|
||||||
'pvesm', 'alloc', $target_storeid, $vmid,
|
'pvesm', 'alloc', $target_storeid, $vmid,
|
||||||
$volname, $size/1024]);
|
$target_volname, int($size/1024)]);
|
||||||
|
|
||||||
eval {
|
eval {
|
||||||
run_command([["dd", "if=$path"],
|
run_command([["dd", "if=$src"],
|
||||||
["/usr/bin/ssh", "root\@${target_host}", "-C",
|
["/usr/bin/ssh", "root\@${target_host}", "-C",
|
||||||
"dd", 'conv=sparse', "of=$path"]]);
|
"dd", 'conv=sparse', "of=$dst"]]);
|
||||||
};
|
};
|
||||||
if (my $err = $@) {
|
if (my $err = $@) {
|
||||||
run_command(['/usr/bin/ssh', "root\@${target_host}",
|
run_command(['/usr/bin/ssh', "root\@${target_host}",
|
||||||
'pvesm', 'free', $volid]);
|
'pvesm', 'free', $target_volid]);
|
||||||
} else {
|
} else {
|
||||||
vdisk_free($cfg, $volid);
|
vdisk_free($cfg, $volid);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -6,6 +6,8 @@ libpve-storage-perl (4.0-52) unstable; urgency=medium
|
|||||||
|
|
||||||
* fix 1012: dir: add mkdir option
|
* fix 1012: dir: add mkdir option
|
||||||
|
|
||||||
|
* Add LVM/LVM-thin storage migration
|
||||||
|
|
||||||
-- Proxmox Support Team <support@proxmox.com> Tue, 07 Jun 2016 10:30:02 +0200
|
-- Proxmox Support Team <support@proxmox.com> Tue, 07 Jun 2016 10:30:02 +0200
|
||||||
|
|
||||||
libpve-storage-perl (4.0-51) unstable; urgency=medium
|
libpve-storage-perl (4.0-51) unstable; urgency=medium
|
||||||
|
|||||||
Reference in New Issue
Block a user