{"id":7462,"date":"2014-06-19T03:59:39","date_gmt":"2014-06-19T03:59:39","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2014\/06\/19\/how-can-i-use-the-hosts-lvm-vg-as-a-kvm-pool-collection-of-common-programming-errors\/"},"modified":"2014-06-19T03:59:39","modified_gmt":"2014-06-19T03:59:39","slug":"how-can-i-use-the-hosts-lvm-vg-as-a-kvm-pool-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2014\/06\/19\/how-can-i-use-the-hosts-lvm-vg-as-a-kvm-pool-collection-of-common-programming-errors\/","title":{"rendered":"How can I use the host&#39;s lvm VG as a kvm pool?-Collection of common programming errors"},"content":{"rendered":"<p>I have a machine setup with Centos6 as a virtualisation host. It has a single 250G hard drive that is configured as a single lvm volume group(vg_fluke). Now I would like to use the host&#8217;s lvm as a storage pool for KVM.<\/p>\n<p>I found this question on SF and method one describes what I would like to achieve. But I can&#8217;t find a way to go about it.<\/p>\n<p>I tried the following, but since the documentation is sketchy, I am certain that I am doing something wrong.<\/p>\n<pre><code>virsh # pool-define-as guest_images_lvm logical - - - - \/dev\/vg_fluke\nPool guest_images_lvm defined\n<\/code><\/pre>\n<p>And followed it with,<\/p>\n<pre><code>virsh # pool-start guest_images_lvm\nerror: Failed to start pool guest_images_lvm\nerror: internal error Child process (\/sbin\/vgchange -ay -) status unexpected: exit status 5\n<\/code><\/pre>\n<p>More Information on the LVM setup:<\/p>\n<pre><code>[root@fluke ~]# pvs\n  PV         VG       Fmt  Attr PSize   PFree  \n  \/dev\/sdb2  vg_fluke lvm2 a--  232.39g 125.45g\n[root@fluke ~]# lvs\n  LV      VG       Attr   LSize   Origin Snap%  Move Log Copy%  Convert\n  lv_home vg_fluke -wi-ao   5.00g                                      \n  lv_root vg_fluke -wi-ao 100.00g                                      \n  lv_swap vg_fluke -wi-ao   1.94g                                      \n[root@fluke ~]# vgs\n  VG       #PV #LV #SN Attr   VSize   VFree  \n  vg_fluke   1   3   0 wz--n- 232.39g 125.45g\n<\/code><\/pre>\n<p>Update:<\/p>\n<p>Followed @sitaktif&#8217;s advice and now get the following error:<\/p>\n<pre><code>virsh # pool-define-as lv_guest_vm logical --target \/dev\/vg-main\nPool lv_guest_vm defined\n\nvirsh # pool-start lv_guest_vm\nerror: Failed to start pool lv_guest_vm\nerror: internal error '\/sbin\/vgchange -ay lv_guest_vm' exited with non-zero status 5 and signal 0:   Volume group \"lv_guest_vm\" not found\n<\/code><\/pre>\n<p>Note: I am on trying this on a different machine where the VG is vg-main. Do I have to create a second VG for libvirt to use for virtual machines? How can I set it up use a LV in the existing VG?<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I have a machine setup with Centos6 as a virtualisation host. It has a single 250G hard drive that is configured as a single lvm volume group(vg_fluke). Now I would like to use the host&#8217;s lvm as a storage pool for KVM. I found this question on SF and method one describes what I would [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-7462","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/7462","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=7462"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/7462\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=7462"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=7462"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=7462"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}