OpenStack Learning Cinder LVM configuration

Source: Internet
Author: User

0. Background

Instances in OpenStack are not persisted and need to be mounted volume to be persisted in volume. Cinder provides persistent block storage and is currently only available for virtual machine mounts. It does not implement the management and the actual service to the block device, but provides the unified interface for the different storage structure of the backend, and the different block equipment service vendors implement their driver support in Cinder to integrate with OpenStack. It provides storage services to the outside world with API interfaces by consolidating multiple backend storage. The primary core is the management of volumes, which allow both volumes, types, and snapshots to be processed.

Cinder storage is divided into a variety of back-end storage types such as local block storage, distributed block storage, and SAN storage:
1. Local storage: Linux is supported by default via LVM
2. SAN Storage:
(1) Support NAS Storage via NFS protocol, such as NetApp
(2) to support different types and models of commercial storage devices, such as EMC,IBM storage, by adding different vendors to develop driver. You can see the list of supported vendor stores in Https://wiki.openstack.org/wiki/CinderSupportMatrix.
3. Distributed System: Support Sheepdog,ceph, and IBM's GPFS etc.

For local storage, Cinder-volume uses the LVM driver by default, and the current implementation of this driver requires that a volume group be created in advance with the LVM command on the host, and when that host is accepted to create a volume request, Cinder-volume creates a logical volume on the volume group and uses Openi SCSI uses this volume as an iSCSI TGT for output. You can also use the local storage of several hosts as a shared storage with sheepdog and then drive using Sheepdog.

1. Cinder LVM Configuration
In the cinder configuration file, the default backend lvmdriver is to use local storage via LVM:

[Lvmdriver-1]
Volume_group = Stack-volumes-lvmdriver-1
Volume_driver = Cinder.volume.drivers.lvm.LVMISCSIDriver
Volume_backend_name = Lvmdriver-1

    • VOLUME_GROUP Specifies the volume group used by Cinder. The name is stack-volumes-lvmdriver-1 when Devstack is installed by default, and its default name is Cinder-volumes when Cinder is actually deployed.
    • VOLUME_DRIVER Specifies the driver type, LVM is Cinder.volume.drivers.lvm.LVMISCSIDriver
    • Volume_backend_name is backend name and can be selected when creating volume.

If the volume group with the name Stack-volumes-lvmdriver-1 does not exist, its status will be error after the volume is created, and the following error can be seen in the Cinder C-vol log:

Exception during message handling:unexpected error while running command.
Command:none
Exit Code:-
Stdout:u ' unexpected error while running Command.\ncommand:sudo cinder-rootwrap/etc/cinder/rootwrap.conf lvcreate-n vo Lume-f3aef3b9-1a71-41d4-956e-a00044544b74 stack-volumes-lvmdriver-1-l 1g\nexit code:5\nstdout:u\ ' \ ' \nstderr:u\ ' Volume Group "stack-volumes-lvmdriver-1" not found\\n\ "
Stderr:none

Refer to my blog post http://www.cnblogs.com/sammyliu/p/4157491.html to configure LVM.

3. Cinder using LVM

Once you have successfully created a cinder volume, you can see the newly created logical volume in the VG:

[Email protected]:/home/s1# lvdisplay/dev/stack-volumes-lvmdriver-1/ volume-02f986b0-418f-4f84-a5ec-7af61f5d5293
---Logical volume---
LV name/dev/stack-volumes-lvmdriver-1/volume-02f986b0-418f-4f84-a5ec-7af61f5d5293
VG Name stack-volumes-lvmdriver-1
LV UUID 9OESR2-4V7F-QP22-F5TE-HF2V-DWOY-ESHTNN
LV Write Access read/write
LV Status Available
# Open 0
LV Size 1.00 GiB
Current LE
Segments 1
Allocation inherit
Read ahead Sectors Auto
-currently set to
Block Device 252:0

OpenStack Learning Cinder LVM configuration

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.