cinder-configuration



cinder-configuration

0 0


cinder-configuration


On Github jbernard / cinder-configuration

OpenStack Cinder

Post-Install Configuration

Created by Jon Bernard

Topics

  • Out of the Box

  • Multiple Backends

  • Volume Types

  • Using Gluster

  • When Things Go Wrong

Out of the Box

Three cinder process running:

$ openstack-status
…
== Cinder services ==
openstack-cinder-api:                   active
openstack-cinder-scheduler:             active
openstack-cinder-volume:                active
…

$ for i in api scheduler volume; do sudo service openstack-cinder-$i status; done
openstack-cinder-api (pid  2983) is running...
openstack-cinder-scheduler (pid  3028) is running...
openstack-cinder-volume (pid  3562) is running...

// status can be replaced with start, stop, or restart
// to manipulate the cinder services

Default Volume Driver

LVM is the default storage provider

$ sudo vgs
VG              #PV #LV #SN Attr   VSize   VFree
cinder-volumes    1   0   0 wz--n- 200.60g 200.60g
  • One LVM backend

  • Logical volumes are created in cinder-volumes

  • All configuration is in /etc/cinder/cinder.conf

  • Thin provisioning is not ready yet

Volume Access

  • TGT provides network access to volumes via iSCSI

  • Configuration at /etc/tgt/targets.conf

  • TGT is configured to include targets created by cinder:

    $ sudo grep cinder /etc/tgt/targets.conf
    include /etc/cinder/volumes/*
  • See current iSCSI exports

    $ sudo tgt-admin --show

Multiple Backends

/etc/cinder/cinder.conf

# a list of backends that will be served by this compute node
enabled_backends=lvmdriver-1,lvmdriver-2,lvmdriver-3

[lvmdriver-1]
volume_group=cinder-volumes-1
volume_driver=cinder.volume.drivers.lvm.LVMISCSIDriver
volume_backend_name=LVM_iSCSI

[lvmdriver-2]
volume_group=cinder-volumes-2
volume_driver=cinder.volume.drivers.lvm.LVMISCSIDriver
volume_backend_name=LVM_iSCSI    # same as 1, scheduler will balance

[lvmdriver-3]
volume_group=cinder-volumes-3
volume_driver=cinder.volume.drivers.lvm.LVMISCSIDriver
volume_backend_name=LVM_iSCSI_b  # different, scheduler will wait

Make sure these definitions are completely before or after the [DEFAULT] section

Volume Types

  • Provides scheduling to a specific backend
  • Additional information to act upon with extra-specs

Create a volume type

$ cinder type-create lvm
$ cinder type-key lvm set volume_backend_name=LVM_iSCSI
$ cinder extra-specs-list (just to check the settings are there) 

Create a volume using the specified type

$ cinder create --volume-type lvm --display-name my-volume 1

Using Gluster

Your gluster volume(s) must be mountable (test this)

/etc/cinder/cinder.conf

[gluster-driver-1]
volume_backend_name=GLUSTER
volume_driver=cinder.volume.drivers.glusterfs.GlusterfsDriver
glusterfs_shares_config=/etc/cinder/shares.conf
glusterfs_mount_point_base=/var/lib/cinder/volumes

/etc/cinder/shares.conf

hostname:gluster-volume-1
hostname:gluster-volume-2
hostname:gluster-volume-3

Using Ceph

/etc/cinder/cinder.conf

[ceph]
volume_backend_name = CEPH
volume_driver = cinder.volume.drivers.rbd.RBDDriver
rbd_user = cinder
rbd_pool = volumes

/etc/ceph/ceph.conf

[global]
mon_host = 172.16.0.12

/etc/ceph/ceph.client.cinder.keyring

[client.cinder]
        key = MY-CINDER-KEY

When Things Go Wrong

  • Lots of moving pieces, order of events is crucial

  • Even with perfect configuration, it still might break

  • Logs are your first line of defence

    $ sudo ls /var/log/cinder/
    api.log
    scheduler.log
    volume.log

The Cinder Client

/usr/bin/cinder

  • Command Line!

  • Allows you to isolate cinder from the rest of openstack

  • Helpful to understand the current state

  • Try commands directly and inspect results immediately

LVM Initialization failure

  • cinder-volume will continue running but nothing will work

  • Often the volume group is wrong or missing

2014-02-20 14:54:55 ERROR cinder.volume.manager […] Error encountered
                    during initialization of driver: LVMISCSIDriver

2014-02-20 14:54:55 ERROR cinder.volume.manager […] Unexpected error
                    while running command.

Command: vgs --noheadings -o name cinder-volumes
Exit code: 5
Stdout: ''
Stderr: '  Volume group "cinder-volumes" not found\n  Skipping volume
group cinder-volumes\n'

2014-02-20 14:56:21 INFO cinder.volume.manager [-] Updating volume status
2014-02-20 14:56:21 WARNING cinder.volume.manager [-] Unable to update
                    stats, driver is uninitialized

Volume Creation Failure

You'll see this if you've run out of space

2014-02-19 11:41:20  WARNING [cinder.scheduler.filters.capacity_filter]
                     Insufficient free space for volume creation
                     (requested / avail): 5/0.0

2014-02-19 11:41:20  ERROR [cinder.scheduler.manager] Failed to
                     schedule_create_volume: No valid host was found.

If All Else Fails

  • Verify the correct order of events
    • Gluster is configured correctly, but volume not yet started
    • LVM on Celera, volume groups not yet activated
    • May not be cinder's fault, be ready for anything
  • Failures of any kind almost always result in a stacktrace

  • If the error isn't obvious, look at the offending source code

  • Send me an email

0