Advertisement
Guest User

virsh migrate w/o shared storage

a guest
Apr 29th, 2012
415
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.66 KB | None | 0 0
  1. My mission: migration from iron3 -> iron4 without using shared storage.
  2.  
  3. # first see my sparse file
  4.  
  5. [root@iron3 images]# ls -lAhs
  6. [...snip]
  7. 7.6G -rwxr-xr-x. 1 root root 500G Apr 29 18:51 ncr.raw
  8.  
  9. # apparently you need to "prepare" the destination. if not, the migrate fails with:
  10. error: unable to set user and group to '107:107' on '/var/lib/libvirt/images/ncr.raw': No such file or directory
  11. # should I be doing this, or is there a better way ? Please note, this new image *is* sparse (and empty).
  12.  
  13. [root@iron4 images] time qemu-img create -f raw ncr.raw 500G
  14. Formatting 'ncr.raw', fmt=raw size=536870912000
  15.  
  16. # okay, go time!
  17.  
  18. [root@iron3 ~]# time virsh migrate --verbose --live --copy-storage-all ncr qemu+ssh://iron4/system
  19. Migration: [  0 %]
  20. ...
  21. [...finishes successfully after 78 minutes!]
  22.  
  23. # note: this took so long because it didn't copy it in a "sparse" way (such as rsync -S can)
  24. [root@iron4 images]# ls -lAhs
  25. total 501G
  26. 501G -rw-r--r-- 1 qemu qemu 500G Apr 29 21:04 ncr.raw
  27.  
  28. [root@iron4 images]# df -h
  29. Filesystem            Size  Used Avail Use% Mounted on
  30. /dev/mapper/vg_00-lv_root
  31.                       621G 1009M  588G   1% /
  32. tmpfs                  24G     0   24G   0% /dev/shm
  33. /dev/sda1             504M   42M  437M   9% /boot
  34. /dev/mapper/vg_00-lv_home
  35.                       504M   17M  462M   4% /home
  36. /dev/mapper/vg_00-lv_var
  37.                      1008G  501G  457G  53% /var
  38.  
  39. # I can "fix" the image with qemu-img, but ideally it should stay sparse to begin with! What have I done wrong?
  40. [root@iron4 images]# mv ncr.raw ncr.raw.original
  41. [root@iron4 images]# time qemu-img convert ncr.raw.original ncr.raw
  42.  
  43. Many thanks in advance,
  44. James
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement