[pve-devel] Storage migration: online design solution

Alexandre DERUMIER aderumier at odiso.com
Thu Jan 10 14:22:02 CET 2013


I have send a new version of my vm copy/clone feature,
I have added drive-mirror for live vm copy.

So you can look a it to get inspiration for your needs. (check patch 14/14)

I check the uuid of the partitions, they have not changed after the copy.


----- Mail original ----- 

De: "Michael Rasmussen" <mir at datanom.net> 
À: "Alexandre DERUMIER" <aderumier at odiso.com> 
Cc: pve-devel at pve.proxmox.com 
Envoyé: Jeudi 10 Janvier 2013 10:23:23 
Objet: Re: [pve-devel] Storage migration: online design solution 

I more or less have a complete solution. Need some more tests, though. I have discovered a potential problem. When a disk is migrated due to the fact that a new disk is created the UUID is changed. 


Alexandre DERUMIER <aderumier at odiso.com> wrote: 

for the uri, you can do 

#info block 

in monitor, this is the file=  part. 

you can use proxmox sub path to generate it 

my path = PVE::Storage::path($storecfg, $dst_volid); 




migration part should be something like 

$drive = "virtio0"; 
my $targetpath = PVE::Storage::path($storecfg, $dst_volid); 
PVE::QemuServer::vm_mon_cmd($vmid, "drive-mirror", device => "drive-$drive", target => $targetpath); 

while{ 
PVE::QemuServer::vm_mon_cmd($vmid, "block-migrate-status"); 
} 

PVE::QemuServer::vm_mon_cmd($vmid, "block-job-complete", device => "drive-$drive"); 

----- Mail original ----- 

De: "Michael Rasmussen" <mir at datanom.net> 
À: pve-devel at pve.proxmox.com 
Envoyé: Mercredi 9 Janvier 2013 22:12:47 
Objet: Re: [pve-devel] S
 torage
migration: online design solution 

On Wed, 9 Jan 2013 22:01:42 +0100 
Michael Rasmussen <mir at datanom.net> wrote: 


<blockquote>
On Wed, 09 Jan 2013 12:05:05 +0100 (CET) 
Alexandre DERUMIER <aderumier at odiso.com> wrote: 



<blockquote>
#drive_mirror -n -f drive-virtio0 sheepdog: 127.0.0.1:7000 :vm-144-disk-1 


# info block 
drive-virtio2: removable=0 io-status=ok 
file=/dev/pve-storage1_vg/vm-102-disk-1 ro=0 drv=raw encrypted=0 bps=0 
bps_rd=0 bps_wr=0 iops=0 iops_rd=0 iops_wr=0 

# drive_mirror -f drive-virtio2 pve-storage2_lvm:vm-102-disk-2 
Invalid block format 'raw' 

Is raw only supported for destinations other than LVM? 
</blockquote>

Found out that it has to be a URI: /dev/pve-storage2_vg/vm-102-disk-1 
works:-) 

</blockquote>

-- 
Sent from my Android phone with K-9 Mail. Please excuse my brevity. 



More information about the pve-devel mailing list