[Openstack] LVM over LVM is acceptable?

Lei Zhang zhang.lei.fly at gmail.com
Tue Nov 27 02:04:16 UTC 2012


Understood.

Another question. If the vm treat the vol-0 as a normal block device, is it
necessary to partition? If not, the fdisk will show Disk /dev/vdb doesn't
contain a valid partition table. If yes, how can I extend the volume on the
vm? It seems that treat the volume as a normal block device is not a good
idea.


On Tue, Nov 27, 2012 at 4:52 AM, Dean Troyer <dtroyer at gmail.com> wrote:

> On Mon, Nov 26, 2012 at 6:51 AM, Lei Zhang <zhang.lei.fly at gmail.com>
> wrote:
> > I creat a lvm named vol-0 and attach it to the machine com-0. After a
> period
> > of time, the vol-0 is full and I want to extend it. At now, I have two
> > solutions.
>
> Nested LVM gets tricky so I want to be sure I am clear on your setup:
>
> * Your host has a logical volume (LV) 'vol-0' that is attached to a VM
> named 'com-0'.
> * com-0 uses the attached logical volume (vol-0 on the host) as a
> physical volume (PV) for its own LVM configuration.
>
> > Because the vol-0 is manage by the LVM on the hoster. So I can extend the
> > size of it by using lvextend. But I meet that the vm(com-0) can not be
> aware
> > this. Should I make some extrac operations like reseize2fs? I have no
> ideas.
>
> If vol-0 is used directly as a block device with a filesystem on it
> (older Xen installs often did this) then a resize2fs is sufficient to
> recognize the additional space.  It appears this is _not_ your
> configuration, correct?
>
> If vol-0 is used as a PV in com-0 then you can run pvresize inside
> com-0 and have com-0's LVM recognize the additional space.
>
> > In the vm (com-0), I can treat the vol-0 as a normal block device and
> create
> > lvm on it. When need more space, the hoster can "plug" a new lvm
> > device(vol-1) on it. In the vm, I can add it to the lvm. But I found
> another
>
> Correct, this is another way to increase the space available to
> cpm-0's volume groups.
>
> > problem. Because the vol-* is not real block device, when I create lvm on
> > it, the hoster is aware of it. The result is that on the hoster, another
> PV
> > is created base on a lvm partition like bellow. I want to know, it is
> > acceptable?
>
> To fix this you need to adjust the filter on your host's
> /etc/lvm/lvm.conf.  You can either reject any physical volumes found
> for VMs:
>
>     filter = ["r|/dev/cinder-volumes/.*", "a/.*/"]   # reject cinder
> devices, alow everything else
>
> or you can only look at particular divice files for physical devices:
>
>     filter = ["a/dev/sd.*"]   # look only at SCSI disks for physical
> devices
>
> That last one will likely need adjusting for your local block device names.
>
> dt
>
> --
>
> Dean Troyer
> dtroyer at gmail.com
>



-- 
Lei Zhang

Blog: http://jeffrey4l.github.com
twitter/weibo: @jeffrey4l
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstack.org/pipermail/openstack/attachments/20121127/e334eb93/attachment.html>


More information about the Openstack mailing list