ãä»®æ³åéä¿¡ã¡ã¼ã«ãã¬ã¸ã³ Vol.010ã§ã¬ãã¼ããã¾ããvirt-v2vã®ç§»è¡æé ããç´¹ä»ãã¾ãã
ãç¨æãããã®ã¯æ¬¡ã®2å°ã®ãã·ã³ï¼ãããã¯ã1å°ã®ãã·ã³ã§ãã¼ããã£ã¹ã¯ãå·®ãæ¿ãã¦ãå¯ï¼ã§ãã
- RHEL5ã®Xenç°å¢ã§ä½ãããRHEL5ã®ä»®æ³ãã·ã³
- ä»®æ³ãã·ã³ã¯libvirtã§ç®¡çããã¦ããå¿ è¦ãããã¾ã
- RHEL5ããªãå ´åã¯CentOS5ã§ãåé¡ããã¾ãããã¾ããæ¬ç¨¿ã§ã¯CentOS5ãåæã¨ãã¾ã
- 移è¡å
ã¨ãªãRHEL6(ãã¼ã¿)ã®KVMç°å¢
- ããªãã¸è¨å®ã¯é©å®æåã§è¡ãå¿ è¦ãããã¾ã
ãã¾ããä»®æ³ãã·ã³ã®ãã¼ã¿ã移è¡å ã®ãã·ã³ã«ç¨æãã¾ããXenç°å¢ã§ä½æããVMãã³ãã¼ããã°è¯ãã§ãããããã£ã¹ã¯ã¤ã¡ã¼ã¸ã¯ã³ãã¼å ã¨åããã¹ã«é ç½®ãã¾ã(/var/lib/xen/imagesãä½æãã¾ã)ãè¨å®ãã¡ã¤ã«ã¯ãlibvirtã®XMLå½¢å¼ã¨ãã¦åºåãããã®ãä½æ¥ãã£ã¬ã¯ããªï¼æ¬ç¨¿ã§ã¯/rootã¨ãã¾ãï¼ã«ã³ãã¼ãã¾ããåºåæ¹æ³ã¯æ¬¡ã®ã¨ããã§ãã
# virsh dumpxml /etc/xen/ï¼VMåï¼ > /root/ï¼VMåï¼.xml
ã次ã«ãvirt-v2vãã¤ã³ã¹ãã¼ã«ãã¾ããRHEL6æ¨æºã®ããã±ã¼ã¸ã§ã¯ãã¼ã¸ã§ã³ãå¤ã使ãæ¹ãããä¸æã§ãã®ã§ãææ°ã®ã½ã¼ã¹ãGitãªãã¸ããªãããã¦ã³ãã¼ããã¦ãã«ããããã®ã使ç¨ãã¾ãã2010/5/14ç¾å¨ã®ææ°ã¯0.5.3ã§ãããã«ãã®åã«ãããããã次ã®ããã±ã¼ã¸ãYumããã³CPANã§ã¤ã³ã¹ãã¼ã«ãã¾ãã
# yum install git perl-libguestfs perl-XML-DOM-XPath perl-Sys-Virt # cpan Locale::TextDomain
ãã¤ã³ã¹ãã¼ã«ãæ¸ãã ããvirt-v2vã®ææ°ã½ã¼ã¹ããã¦ã³ãã¼ããã¾ãã
# git clone git://git.fedorahosted.org/virt-v2v.git
ãã³ã³ãã¤ã«ããã³ã¤ã³ã¹ãã¼ã«ã®æé ã¯æ¬¡ã®ã¨ããã§ãã
# perl Build.pl # ./Build # ./Build install
ã次ã«ãå¤æãããã£ã¹ã¯ã¤ã¡ã¼ã¸ã«çµã¿è¾¼ãã«ã¼ãã«ã¨ãã®é¢é£ããã±ã¼ã¸æ å ±ãè¨è¿°ããè¨å®ãã¡ã¤ã«ãä½æãã¾ããããã¯ãXenç¨ã®ã«ã¼ãã«ããé常ã®ã«ã¼ãã«ã«å·®ãæ¿ããå¿ è¦ãããããã§ãããã§ã«åºæ¥ä¸ãã£ãè¨å®ãã¡ã¤ã«ãç¨æãã¾ããã®ã§ããã¡ãã使ç¨ï¼ãããã¯åèã«ï¼ãã¦ä¸ããã
ãããã±ã¼ã¸ã®ãã¼ã¸ã§ã³ã¯2010/5/10æç¹ã®ãã®ã§ãããvirtioããµãã¼ãããã¦ãããã¼ã¸ã§ã³(RHEL5 Update3 or CentOS5.3以é)ã§ããã°åé¡ããã¾ããã®ã§ãå¿ ãããææ°ã§ããå¿ è¦ã¯ããã¾ããããã®è¨å®ãã¡ã¤ã«ã¯ã¿ã°å½¢å¼ã§è¨è¿°ãã¾ãã以ä¸ã«ã¿ã°ã®èª¬æã示ãã¾ãã
<root-path> | åããã±ã¼ã¸æ å ±ãè¨è¿°ããéã®ãã¼ã¹ãã¹ã§ã |
<iso-path> | ãã®è¨å®ã§è¨è¿°ããããã±ã¼ã¸ã¯virt-v2vã«ãã£ã¦ISOã¤ã¡ã¼ã¸åããã¾ãããã®ISOã¤ã¡ã¼ã¸ä¿åå ãæå®ãã¾ãã |
<app> | ããã±ã¼ã¸ã®æ å ±ãè¨è¿°ãã¾ãããos='**'ãã®é¨åã¯RHELãªããredhatããCentOSãªããcentosãã¨ãªãã¾ãã |
<path> | <root-path>ã«ç¶ããã¹ãæå®ãã¾ãã |
<dep> | é¢é£ããã±ã¼ã¸ãæå®ãã¾ããé¢é£ããã±ã¼ã¸ãå¥é<app>ãè¨è¿°ãã¾ãã |
<network> | ãããã¯ã¼ã¯ã®å¤ææ å ±ãè¨è¿°ãã¾ããå¤å´ã®networkã¿ã°ã移è¡å ãä¸ã®networkã¿ã°ã¯ç§»è¡å ã®ãããã¯ã¼ã¯æ å ±ã§ãã |
ãããã±ã¼ã¸æ å ±ãè¨è¿°ãçµããããããããã®ããã±ã¼ã¸ãæå®ãããã¹ã«ãã¦ã³ãã¼ããã¾ã(è¨å®ãã¡ã¤ã«å ã«ãã¦ã³ãã¼ãç¨ã®wgetã³ãã³ããåãè¾¼ãã§ããã¾ãã)ã
ãæå¾ã«ã次ã®2ç¹ãè¡ãã¾ãã
- ã¹ãã¬ã¼ã¸ã®ãã¼ã«ãvirt-managerãããã¯virshã³ãã³ãã§ä½æãã¾ãã
- /var/lib/virt-v2vãã£ã¬ã¯ããªãä½æãã¾ãã
ã以ä¸ã§æºåã¯å®äºã§ããããããvirt-v2vã³ãã³ããå®è¡ãã¦ãå¤æãè¡ãã¾ãã
# virt-v2v -i libvirtxml -op ï¼ã¹ãã¬ã¼ã¸ã®ãã¼ã«åï¼ -f virt-v2v.conf ï¼VMåï¼.xml
ãå¤æä¸ã¯ãã°ããä½ãã¡ãã»ã¼ã¸ã表示ããã¾ããããåé¡ããã¾ãããåé¡ããã£ãå ´åã¯ã¡ãã»ã¼ã¸ã表示ãããå¦çãä¸æããã¾ããä»åã®ä¾ã§ã¯æå¾ã«æ¬¡ã®ã¡ãã»ã¼ã¸ã表示ããããã¨æãã¾ããVMã®ããã¤ã¹ã«virtioãå©ç¨ããã¦ãã¾ããã¨ã®ãã¨ã§ãã
virt-v2v: ï¼VMåï¼ configured with virtiodrivers
ãå¤æãå®äºãããlibvirtã«ç»é²ããã®ã§ãããqemuã®æ¨©éè¨å®ã®åé¡ã§ã¨ã©ã¼ã¨ãªã£ã¦ãã¾ãããã対çãè¡ãã¾ãã/etc/libvirt/qemu.confãéãã¦ã次ã®ç®æã®ã³ã¡ã³ãã¢ã¦ããæ»ãã¾ããä¿åãããlibvirtdãåèµ·åãã¦ä¸ããã
# The user ID for QEMU processes run by the system instance user = "root" â#ãã¨ã # The group ID for QEMU processes run by the system instance group = "root" â#ãã¨ã
ãvirshã³ãã³ãã§å¤æããVMãç»é²ãã¾ããç»é²ãæåããã¨ãå³åº§ã«VMãèµ·åããã®ã§ãæ°ãä»ãã¦ä¸ãããvirsh create(ç»é²ã¨åæã«èµ·å)ãããã¯virsh define(ç»é²ã®ã¿)ã§ç»é²å¯è½ã§ã(peo3ãããææãããã¨ããããã¾ãã)ã
# virsh create /etc/libvirt/qemu/ï¼VMåï¼.xml ãã¡ã¤ã³ï¼VMåï¼ã/etc/libvirt/qemu/ï¼VMåï¼.xmlããä½æããã¾ãã
ã以ä¸ã§å¤æä½æ¥ã¯å®äºã§ãã