Ask Your Question
3

How to set cinder multi-backend default

asked 2014-03-23 07:52:03 -0500

toMeloos gravatar image

updated 2014-04-15 06:06:27 -0500

dachary gravatar image

I am testing a Havana cinder multi-backend setup with two Ceph backends (volumes-hdd and volumes-ssd) and two types:

  • Regular, linked to volume_backend_name "volumes-hdd"
  • Gold, linked to volume_backend_name "volumes-ssd"

This works well and running cinder create from the command line with the --volume-type parameter or selecting a type in the Create Volume form in the Horizon dashboard allows me to create volumes in either backend.

Turns out that if I don't provide a volume type preference then cinder will automatically create the volume in volumes-ssd. I'm assumning it's because that's the first backend in cinder.conf. Of course in this use case I don't want volumes without the type specified to be distributed evenly accross backends. In stead I want the volumes-hdd backend to always be the default backend for all volumes created without type being specified. I've had no luck adding "default_volume_type=volumes-hdd" or "default_volume_type=Regular" to the cinder.conf [DEFAULT] section but that didn't seem to do the trick. I've added my puppet-generated cinder.conf below.

So how do I set which "default backend" to use in case no volume type is provided?

[DEFAULT]
rootwrap_config = /etc/cinder/rootwrap.conf
api_paste_confg = /etc/cinder/api-paste.ini
iscsi_helper = tgtadm
volume_name_template = volume-%s
volume_group = cinder-volumes
verbose = False
auth_strategy = keystone
state_path = /var/lib/cinder
lock_path = /var/lock/cinder
volumes_dir = /var/lib/cinder/volumes
rabbit_host=127.0.0.1
backup_ceph_user=cinder
backup_ceph_conf=/etc/ceph/ceph.conf
sql_connection=mysql://cinder:<<password redacted>>@127.0.0.1/cinder?charset=utf8
use_syslog=False
api_paste_config=/etc/cinder/api-paste.ini
enabled_backends=volumes-hdd,volumes-ssd
backup_ceph_chunk_size=134217728
backup_driver=cinder.backup.driver.ceph
backup_ceph_stripe_unit=0
debug=False
rabbit_userid=openstack
log_dir=/var/log/cinder
osapi_volume_listen=0.0.0.0
backup_ceph_stripe_count=0
backup_ceph_pool=backups
sql_idle_timeout=3600
rabbit_virtual_host=/
scheduler_driver=cinder.scheduler.filter_scheduler.FilterScheduler
rabbit_hosts=127.0.0.1:5672
control_exchange=openstack
rabbit_ha_queues=False
notification_driver=cinder.openstack.common.notifier.rpc_notifier
rabbit_password=<<password redacted>>
rabbit_port=5672
rpc_backend=cinder.openstack.common.rpc.impl_kombu

[volumes-hdd]
rbd_pool=volumes-regular
volume_driver=cinder.volume.drivers.rbd.RBDDriver
rbd_flatten_volume_from_snapshot=False
rbd_max_clone_depth=5
rbd_user=cinder
volume_backend_name=volumes-hdd
rbd_ceph_conf=/etc/ceph/ceph.conf

[volumes-ssd]
rbd_user=cinder
volume_driver=cinder.volume.drivers.rbd.RBDDriver
rbd_max_clone_depth=5
rbd_pool=volumes-performance
rbd_ceph_conf=/etc/ceph/ceph.conf
rbd_flatten_volume_from_snapshot=False
volume_backend_name=volumes-ssd
edit retag flag offensive close merge delete

Comments

1

I ran into this issue, I did solve it (it was a syntax issue). I do not have the conf file in front of me, but I will post an answer for you tomorrow if no one else does. Check your syntax and post your conf if you can please

SamYaple gravatar imageSamYaple ( 2014-03-23 12:08:17 -0500 )edit

Thanks, that would be great! The conf was too long to fit in a comment so I added it to my original question. Hope you can help me out!

toMeloos gravatar imagetoMeloos ( 2014-03-24 05:36:52 -0500 )edit

3 answers

Sort by ยป oldest newest most voted
5

answered 2014-03-24 08:19:12 -0500

SamYaple gravatar image

updated 2014-03-24 10:49:56 -0500

I have verified my configuration as well as tested changing my default backend to a different type of volume backend. This all works perfectly well.

You should be able to add the default_volume_type and specify the type you wish

rpc_backend=cinder.openstack.common.rpc.impl_kombu

default_volume_type={Name you gave to backup type}

[volumes-hdd]
rbd_pool=volumes-regular

The above change (and restarting of the correct services) should be all you need. Please also check the cinder logs for anything out of the ordinary. For the volume type name, you can run cinder extra-specs-list. Also see toMeloos answer here

edit flag offensive delete link more
4

answered 2014-03-24 10:13:06 -0500

toMeloos gravatar image

Thanks to SamYaple I've finally figured out that default_volume_type is indeed the right parameter, but the backend name used in cinder.conf is't the right value.

Suppose you create a few backends like I did. Then you run:

cinder type-create Regular
cinder type-key Regular volume_backend_name=volumes-hdd

For the default volume setting to work you'll have to use "Regular" as the default_volume_type, not "volumes-hdd"!

edit flag offensive delete link more

Comments

Good to know, my backend type and backend name are identical. That is probably why I didn't see that issue. Updating my answer. Thanks!

SamYaple gravatar imageSamYaple ( 2014-03-24 10:46:38 -0500 )edit
1

answered 2014-10-31 09:27:21 -0500

Alan gravatar image

Problem is ordering in cinder in nova. Example:

# cinder type-list
+--------------------------------------+--------------+
|                  ID                  |     Name     |
+--------------------------------------+--------------+
| 7864eef1-2e33-4385-8519-facbb9ec08f0 | CEPH-GENERAL |
| ff8aad5a-1554-40da-b67c-d91ae103c78e | CEPH-BACKUP  |
+--------------------------------------+--------------+

# nova volume-type-list
+--------------------------------------+--------------+
| ID                                   | Name         |
+--------------------------------------+--------------+
| ff8aad5a-1554-40da-b67c-d91ae103c78e | CEPH-BACKUP  |
| 7864eef1-2e33-4385-8519-facbb9ec08f0 | CEPH-GENERAL |
+--------------------------------------+--------------+

and as result in openstack frontend on volume creation form we have

<select id="id_type" name="type" data-original-title="">
    <option selected="selected" value=""></option>
    <option value="CEPH-BACKUP"></option>
    <option value="CEPH-GENERAL"></option>
</select>

then if you not select Type - you volume will be CEPH-BACKUP, how this can be fixed?

edit flag offensive delete link more

Comments

I'm added this parameter to cinder config and now default ceph backend problem solved, but still open sorting problem.

default_volume_type=CEPH-GENERAL
Alan gravatar imageAlan ( 2014-11-03 03:50:17 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower

Stats

Asked: 2014-03-23 07:52:03 -0500

Seen: 8,085 times

Last updated: Mar 24 '14