[pve-devel] Storage migration: RFC
Michael Rasmussen
mir at datanom.net
Tue Dec 18 02:21:10 CET 2012
Hi all,
I have designed the conceptual solution for off-line storage migration
as can be read below (Also attached for better readability). Every
usecase have been tested from the command line and found working. Do
you have any comments or have I left something out?
Storage migration
Two distinct usecases - offline and online.
Four storage backend - raw, qcow2 and vmdk.
Two distinct environments - NFS and iSCSI(LVM).
Implementation preserves the machine on its current node.
Requirements: Since proxmox does not provide thin provisioning space
requirements are absolute so provided storage is available when initial
actions takes place we can initiate storage migration.
iSCSI: raw
NFS: raw, qcow2 and vmdk
iSCSI -> NFS
0) lvchange -ay $class->path($scfg, $volnamesrc)
1) lvchange -p r $class->path($scfg, $volnamesrc)
2) mkdir -p $class->path($scfg, $volnamedest)
exception dir_exists: error if not empty
exception could_not_create: error
3) qemu-img convert -p -O $class->format($scfg) $class->path($scfg,
$volnamesrc) "$class->path($scfg, $volnamedest).$class->format($scfg)"
exception could_not_create: error
exception no_more_space: - rm -f "$class->path($scfg,
$volnamedest).$class->format($scfg)"
- error
4) $class->device($scfg, $volnamesrc): "$class->path($scfg,
$volnamedest).$class->format($scfg)", cache=$class->cache($scfg,
$volnamesrc), $class->size($scfg, $volnamesrc) exception write_error: -
rm -f "$class->path($scfg, $volnamedest).$class->format($scfg)"
- error
5) lvremove -f $class->path($scfg, $volnamesrc)
error:
- lvchange -p rw $class->path($scfg, $volnamesrc)
- lvchange -an $class->path($scfg, $volnamesrc)
iSCSI -> iSCSI
0) lvchange -ay $class->path($scfg, $volnamesrc)
1) lvchange -p r $class->path($scfg, $volnamesrc)
2) lvcreate -L $class->size($scfg, $volnamesrc) -n $class->name($scfg)
$class->storage($scfg, $volnamedest) exception could_not_create: error
3) dd if=$class->path($scfg, $volnamesrc) of=$class->path($scfg,
$volnamedest) bs=1M exception could_not_create: - lvremove -f
$class->path($scfg, $volnamedest)
- error
4) $class->device($scfg, $volnamesrc): $class->path($scfg,
$volnamedest), cache=$class->cache($scfg, $volnamesrc),
$class->size($scfg, $volnamesrc) exception write_error: - lvremove -f
$class->path($scfg, $volnamedest)
- error
5) lvremove -f $class->path($scfg, $volnamesrc)
error:
- lvchange -p rw $class->path($scfg, $volnamesrc)
- lvchange -an $class->path($scfg, $volnamesrc)
NFS -> iSCSI
0) chattr +i $class->path($scfg, $volnamesrc)
1) lvcreate -L $class->size($scfg, $volnamesrc) -n $class->name($scfg)
$class->storage($scfg, $volnamedest) exception could_not_create: error
2) dd if=$class->path($scfg, $volnamesrc) of=$class->path($scfg,
$volnamedest) bs=1M exception could_not_create: - lvremove -f
$class->path($scfg, $volnamedest)
- error
3) $class->device($scfg, $volnamesrc): "$class->path($scfg,
$volnamedest).$class->format($scfg)", cache=$class->cache($scfg,
$volnamesrc), $class->size($scfg, $volnamesrc) exception write_error: -
lvremove -f $class->path($scfg, $volnamedest)
- error
4) chattr -i $class->path($scfg, $volnamesrc)
5) rm -f $class->path($scfg, $volnamesrc)
error:
- chattr -i $class->path($scfg, $volnamesrc)
NFS -> NFS
0) chattr +i $class->path($scfg, $volnamesrc)
1) mkdir -p $class->path($scfg, $volnamedest)
exception dir_exists: error if not empty
exception could_not_create: error
2) dd if=$class->path($scfg, $volnamesrc) of=$class->path($scfg,
$volnamedest) bs=1M exception could_not_create: error
3) $class->device($scfg, $volnamesrc): "$class->path($scfg,
$volnamedest).$class->format($scfg)", cache=$class->cache($scfg,
$volnamesrc), $class->size($scfg, $volnamesrc) exception write_error: -
rm -f "$class->path($scfg, $volnamedest).$class->format($scfg)"
- error
4) chattr -i $class->path($scfg, $volnamesrc)
5) rm -f $class->path($scfg, $volnamesrc)
error:
- chattr -i $class->path($scfg, $volnamesrc)
PS. Does the current API contain any utility for changing a vm.conf?
--
Hilsen/Regards
Michael Rasmussen
Get my public GnuPG keys:
michael <at> rasmussen <dot> cc
http://pgp.mit.edu:11371/pks/lookup?op=get&search=0xD3C9A00E
mir <at> datanom <dot> net
http://pgp.mit.edu:11371/pks/lookup?op=get&search=0xE501F51C
mir <at> miras <dot> org
http://pgp.mit.edu:11371/pks/lookup?op=get&search=0xE3E80917
--------------------------------------------------------------
Work Hard.
Rock Hard.
Eat Hard.
Sleep Hard.
Grow Big.
Wear Glasses If You Need 'Em.
-- The Webb Wilder Credo
-------------- next part --------------
A non-text attachment was scrubbed...
Name: storage migration.txt
Type: text/x-microdvd
Size: 4006 bytes
Desc: not available
URL: <http://lists.proxmox.com/pipermail/pve-devel/attachments/20121218/d8cdbf3b/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://lists.proxmox.com/pipermail/pve-devel/attachments/20121218/d8cdbf3b/attachment.sig>
More information about the pve-devel
mailing list