Cinder Volume is deployed on infra hosts instead of LXC containers despite cinder_volume_hosts and env.d/cinder.yml

Asked by Salvatore Aurnia

Hello everyone,

I am deploying OpenStack-Ansible with an external Ceph RBD backend.
I expected Cinder Volume to be deployed inside LXC containers (as with other OpenStack services), but instead the cinder-volume service is being installed directly on the infra hosts, not in containers.
What I configured
In /etc/openstack_deploy/openstack_user_config.yml:
storage_hosts:
  infra1:
    ip: 172.29.xx.xx
    container_vars:
      cinder_backends:
        rbd:
          volume_backend_name: rbd
          volume_driver: cinder.volume.drivers.rbd.RBDDriver
          rbd_pool: xxx
          rbd_user: xxx
          rbd_secret_uuid: "xxx"
          rbd_ceph_conf: /etc/ceph/ceph.conf
          report_discard_supported: true

  infra2:
    ip: 172.29.xx.xx
    container_vars:
      cinder_backends:
        rbd:
          volume_backend_name: rbd
          volume_driver: cinder.volume.drivers.rbd.RBDDriver
          rbd_pool: xxx
          rbd_user: xxx
          rbd_secret_uuid: "xxx"
          rbd_ceph_conf: /etc/ceph/ceph.conf
          report_discard_supported: true

  infra3:
    ip: 172.29.xx.xx
    container_vars:
      cinder_backends:
        rbd:
          volume_backend_name: rbd
          volume_driver: cinder.volume.drivers.rbd.RBDDriver
          rbd_pool: xxx
          rbd_user: xxx
          rbd_secret_uuid: "xxxx"
          rbd_ceph_conf: /etc/ceph/ceph.conf
          report_discard_supported: true

In /etc/openstack_deploy/env.d/cinder.yml:
container_skel:
  cinder_api_container:
    properties:
      is_metal: false

  cinder_scheduler_container:
    properties:
      is_metal: false

  cinder_volume_container:
    properties:
      is_metal: false

cinder-volume is installed on hosts instead of containers.
Thanks.

Question information

Language:
English Edit question
Status:
Solved
For:
OpenStack-Ansible Edit question
Assignee:
No assignee Edit question
Solved by:
Salvatore Aurnia
Solved:
Last query:
Last reply:
Revision history for this message
Dmitriy Rabotyagov (noonedeadpunk) said (last edit ):
#1

Hi,

So, multiple things here to unpack.

1. env.d content. You can copy-paste this file to your openstack_deploy/env.d folder to ensure that cinder_volume will be spawned in LXC:
https://opendev.org/openstack/openstack-ansible/src/commit/0d2896768604fa1943a1a37b79666fc0f71aa8bc/etc/openstack_deploy/env.d/cinder-volume.yml.container.example

You might also need to remove the metal hosts from cinder_volume group, as dynamic_inventory.py is not removing content once it was added, as a "safety" measure.

2. I would suggest moving `cinder_backends` definition to user_variables.yml or, even better, to openstack_deploy/group_vars/cinder_volume.yml

Ie: https://opendev.org/openstack/openstack-ansible/src/commit/0d2896768604fa1943a1a37b79666fc0f71aa8bc/etc/openstack_deploy/user_variables.yml.prod-ceph.example#L32-L41

Hope this helps.

Revision history for this message
Salvatore Aurnia (salvatorea) said :
#2

Thanks for your reply. In the openstack_user_config.yml I must leave
storage_hosts:
   Infra1:
      Ip:xxxx
   Infra2:
      Ip: xxx
   Infra3:
      Ip:xxxx
 ?

Revision history for this message
Dmitriy Rabotyagov (noonedeadpunk) said :
#3

Yes, this should remain in openstack_user_config, as it defines which hosts will be assigned to the cinder_volume group.

Revision history for this message
Salvatore Aurnia (salvatorea) said :
#4

Thanks a lot for your support