{"id":6886,"date":"2016-09-30T11:46:10","date_gmt":"2016-09-30T03:46:10","guid":{"rendered":"http:\/\/jpuyy.com\/?p=6886"},"modified":"2016-09-30T11:46:10","modified_gmt":"2016-09-30T03:46:10","slug":"cloudstack-kvm","status":"publish","type":"post","link":"https:\/\/jpuyy.com\/?p=6886","title":{"rendered":"cloudstack kvm"},"content":{"rendered":"<blockquote class=\"wp-embedded-content\" data-secret=\"nykjrCY4wi\"><p><a href=\"https:\/\/kashyapc.wordpress.com\/2011\/09\/24\/creating-a-qcow2-virtual-machine\/\">Creating a Qcow2 virtual&nbsp;machine<\/a><\/p><\/blockquote>\n<p><iframe loading=\"lazy\" class=\"wp-embedded-content\" sandbox=\"allow-scripts\" security=\"restricted\" style=\"position: absolute; clip: rect(1px, 1px, 1px, 1px);\" title=\"&#8220;Creating a Qcow2 virtual&nbsp;machine&#8221; &#8212; Kashyap Chamarthy\" src=\"https:\/\/kashyapc.wordpress.com\/2011\/09\/24\/creating-a-qcow2-virtual-machine\/embed\/#?secret=WNxyqqbdaH#?secret=nykjrCY4wi\" data-secret=\"nykjrCY4wi\" width=\"500\" height=\"282\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\"><\/iframe><\/p>\n<p>&nbsp;<\/p>\n<div>xenserver vhd\u683c\u5f0f\u6a21\u677f\u5236\u4f5c<\/div>\n<div>1.\u865a\u62df\u673a\u7528cobbler\u88c5\u7cfb\u7edf\uff0ccobbler\u4e2d\u8bbe\u7f6e\u78c1\u76d8\u7c7b\u578b\u4e3axvda\uff0c\u5b89\u88c5xenserver tools\uff0c<a href=\"http:\/\/support.citrix.com\/proddocs\/topic\/xencenter-61\/xs-xc-vms-installtools.html\" target=\"_blank\" shape=\"rect\">http:\/\/support.citrix.com\/proddocs\/topic\/xencenter-61\/xs-xc-vms-installtools.html<\/a><\/div>\n<div>2.\u5c06\u865a\u62df\u673a\u8bbe\u7f6e\u6210\u6a21\u677f\uff0c\u5bfc\u51fa\uff0c\u4e00\u822c\u4e3axva\u6a21\u5f0f<\/div>\n<div>3.\u5728xenserver\u4e2d\u6dfb\u52a0\u4e00\u4e2aSR\uff0c\u53738.34\u7684192.168.8.34:\/templates<\/div>\n<div>4.\u5bfc\u5165\u4e4b\u524d\u5bfc\u51faxva\u6a21\u677f\uff0c\u5bfc\u5165\u7684\u4f4d\u7f6e\u4e3anfs\uff0c\u5bfc\u5165\u5b8c\u6210\u540e\uff0c\u5728everything\u4e2d\u53ef\u4ee5\u5f97\u5230\u4e00\u4e2ahttp\u7684\u94fe\u63a5\uff0c\u683c\u5f0f\u4e3avhd\u3002<\/div>\n<div>5.\u5728cloudstack\u4e2d\u6dfb\u52a0xenserver\u6a21\u677f\uff0c\u7cfb\u7edf\u9009\u62e9Other PV(64bit)\u3002<\/div>\n<div><\/div>\n<div>kvm qcow2\u683c\u5f0f\u6a21\u677f\u5236\u4f5c<\/div>\n<div>1.\u627e\u5230\u4e00\u53f0qemu-kvm\u7684\u5bbf\u4e3b\u673a\uff0c\u521b\u5efa\u4e00\u4e2aqcow2\u78c1\u76d8<\/div>\n<div>\n<p>qemu-img create -f qcow2 -o preallocation=metadata \/data\/kvm003.qcow2 20G<\/p>\n<p>2.\u521b\u5efa\u4e00\u4e2a\u5230cobbler\u7684\u6865cloudbr1<\/p>\n<p>3.\u4f7f\u7528cobbler\u5b89\u88c5\u7cfb\u7edf<\/p>\n<p>virt-install &#8211;connect=qemu:\/\/\/system &#8211;network=bridge:cloudbr1 &#8211;initrd-inject=\/data\/201HD-kvm-test &#8211;extra-args=&#8221;ks=file:\/201HD-kvm-test console=tty0 console=ttyS0,115200&#8243; &#8211;name=kvm003 &#8211;disk path=\/data\/kvm003.qcow2 &#8211;ram 2048 &#8211;vcpus=2 &#8211;check-cpu &#8211;hvm &#8211;location=http:\/\/192.168.0.42\/cblr\/ks_mirror\/CentOS-6.5-x86_64\/<\/p>\n<p>4.\u88c5\u597d\u7cfb\u7edf\u540e\uff0c\u68c0\u67e5\u7f51\u5361\u8bbe\u7f6e\uff0c\u5c06mac\u7b49\u4fe1\u606f\u53bb\u6389\uff0c\u6d4b\u8bd5\u865a\u62df\u673a\u5207\u6362\u56de8\u6bb5\u7684\u6865\u540e\u662f\u5426\u6b63\u5e38.\u5173\u673a<\/p>\n<p>5.\u7528file\u53ef\u4ee5\u67e5\u770bkvm003.qcow2\u662fraw\u683c\u5f0f\uff0c\u8f6c\u6362\u4e3aqcow2\u683c\u5f0f\uff0c<\/p>\n<p>qemu-img convert -c -O qcow2 kvm003.qcow2 convert.kvm003.qcow2<\/p>\n<p>\u68c0\u6d4b\u662f\u5426\u6709\u95ee\u9898<\/p>\n<p>qemu-img check convert.kvm003.qcow2<\/p>\n<p>6.\u6302\u8f7dnfs\uff0c\u4e0a\u4f20\u5230192.168.8.34:\/templates<\/p>\n<p>7.\u5728cloudstack\u4e2d\u6dfb\u52a0kvm\u7684\u6a21\u677f<\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Creating a Qcow2 virtual&nbsp;machine &nbsp; xenserver vhd\u683c\u5f0f\u6a21\u677f\u5236\u4f5c 1.\u865a\u62df\u673a\u7528cobbler\u88c5\u7cfb\u7edf\uff0ccobbler\u4e2d\u8bbe\u7f6e\u78c1\u76d8\u7c7b\u578b\u4e3axvda\uff0c\u5b89\u88c5xenserver tools\uff0chttp:\/\/support.citrix.com\/proddocs\/topic\/xencenter-61\/xs-xc-vms-installtools.html 2.\u5c06\u865a\u62df\u673a\u8bbe\u7f6e\u6210\u6a21\u677f\uff0c\u5bfc\u51fa\uff0c\u4e00\u822c\u4e3axva\u6a21\u5f0f 3.\u5728xenserver\u4e2d\u6dfb\u52a0\u4e00\u4e2aSR\uff0c\u53738.34\u7684192.168.8.34:\/templates 4.\u5bfc\u5165\u4e4b\u524d\u5bfc\u51faxva\u6a21\u677f\uff0c\u5bfc\u5165\u7684\u4f4d\u7f6e\u4e3anfs\uff0c\u5bfc\u5165\u5b8c\u6210\u540e\uff0c\u5728everything\u4e2d\u53ef\u4ee5\u5f97\u5230\u4e00\u4e2ahttp\u7684\u94fe\u63a5\uff0c\u683c\u5f0f\u4e3avhd\u3002 5.\u5728cloudstack\u4e2d\u6dfb\u52a0xenserver\u6a21\u677f\uff0c\u7cfb\u7edf\u9009\u62e9Other PV(64bit)\u3002 kvm qcow2\u683c\u5f0f\u6a21\u677f\u5236\u4f5c 1.\u627e\u5230\u4e00\u53f0qemu-kvm\u7684\u5bbf\u4e3b\u673a\uff0c\u521b\u5efa\u4e00\u4e2aqcow2\u78c1\u76d8 qemu-img create -f qcow2 -o preallocation=metadata \/data\/kvm003.qcow2 20G 2.\u521b\u5efa\u4e00\u4e2a\u5230cobbler\u7684\u6865cloudbr1 3.\u4f7f\u7528cobbler\u5b89\u88c5\u7cfb\u7edf virt-install &#8211;connect=qemu:\/\/\/system &#8211;network=bridge:cloudbr1 &#8211;initrd-inject=\/data\/201HD-kvm-test &#8211;extra-args=&#8221;ks=file:\/201HD-kvm-test console=tty0 console=ttyS0,115200&#8243; &#8211;name=kvm003 &#8211;disk path=\/data\/kvm003.qcow2 &#8211;ram 2048 &#8211;vcpus=2 &#8211;check-cpu &#8211;hvm &#8211;location=http:\/\/192.168.0.42\/cblr\/ks_mirror\/CentOS-6.5-x86_64\/ 4.\u88c5\u597d\u7cfb\u7edf\u540e\uff0c\u68c0\u67e5\u7f51\u5361\u8bbe\u7f6e\uff0c\u5c06mac\u7b49\u4fe1\u606f\u53bb\u6389\uff0c\u6d4b\u8bd5\u865a\u62df\u673a\u5207\u6362\u56de8\u6bb5\u7684\u6865\u540e\u662f\u5426\u6b63\u5e38.\u5173\u673a 5.\u7528file\u53ef\u4ee5\u67e5\u770bkvm003.qcow2\u662fraw\u683c\u5f0f\uff0c\u8f6c\u6362\u4e3aqcow2\u683c\u5f0f\uff0c qemu-img convert -c -O qcow2 kvm003.qcow2 convert.kvm003.qcow2 \u68c0\u6d4b\u662f\u5426\u6709\u95ee\u9898 qemu-img check [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7],"tags":[],"class_list":["post-6886","post","type-post","status-publish","format-standard","hentry","category-life"],"_links":{"self":[{"href":"https:\/\/jpuyy.com\/index.php?rest_route=\/wp\/v2\/posts\/6886","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/jpuyy.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/jpuyy.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/jpuyy.com\/index.php?rest_route=\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/jpuyy.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=6886"}],"version-history":[{"count":2,"href":"https:\/\/jpuyy.com\/index.php?rest_route=\/wp\/v2\/posts\/6886\/revisions"}],"predecessor-version":[{"id":6888,"href":"https:\/\/jpuyy.com\/index.php?rest_route=\/wp\/v2\/posts\/6886\/revisions\/6888"}],"wp:attachment":[{"href":"https:\/\/jpuyy.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=6886"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jpuyy.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=6886"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jpuyy.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=6886"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}