Implement ceph fs
Implements: blueprint cephfs Change-Id: I5bf14a668a9e8976a18aa28a5bbfe586690bbd31
This commit is contained in:
parent
df4641b547
commit
d11ba606d8
@ -374,6 +374,7 @@ enable_cadf_notifications: "no"
|
||||
enable_ceilometer: "no"
|
||||
enable_central_logging: "no"
|
||||
enable_ceph: "no"
|
||||
enable_ceph_mds: "no"
|
||||
enable_ceph_rgw: "no"
|
||||
enable_chrony: "no"
|
||||
enable_cinder: "no"
|
||||
|
@ -290,6 +290,9 @@ neutron
|
||||
neutron
|
||||
|
||||
# Ceph
|
||||
[ceph-mds:children]
|
||||
ceph
|
||||
|
||||
[ceph-mgr:children]
|
||||
ceph
|
||||
|
||||
|
@ -309,6 +309,9 @@ neutron
|
||||
neutron
|
||||
|
||||
# Ceph
|
||||
[ceph-mds:children]
|
||||
ceph
|
||||
|
||||
[ceph-mgr:children]
|
||||
ceph
|
||||
|
||||
|
@ -8,6 +8,10 @@ project_name: "ceph"
|
||||
ceph_install_type: "{{ kolla_install_type }}"
|
||||
ceph_tag: "{{ openstack_release }}"
|
||||
|
||||
ceph_mds_image: "{{ docker_registry ~ '/' if docker_registry else '' }}{{ docker_namespace }}/{{ kolla_base_distro }}-{{ ceph_install_type }}-ceph-mds"
|
||||
ceph_mds_tag: "{{ ceph_tag }}"
|
||||
ceph_mds_image_full: "{{ ceph_mds_image }}:{{ ceph_mds_tag }}"
|
||||
|
||||
ceph_mon_image: "{{ docker_registry ~ '/' if docker_registry else '' }}{{ docker_namespace }}/{{ kolla_base_distro }}-{{ ceph_install_type }}-ceph-mon"
|
||||
ceph_mon_tag: "{{ ceph_tag }}"
|
||||
ceph_mon_image_full: "{{ ceph_mon_image }}:{{ ceph_mon_tag }}"
|
||||
@ -43,6 +47,20 @@ ceph_rgw_keystone_user: "ceph_rgw"
|
||||
|
||||
openstack_swift_auth: "{{ openstack_auth }}"
|
||||
|
||||
##########
|
||||
# Ceph MDS
|
||||
##########
|
||||
cephfs_data_pool_name: "cephfs_data"
|
||||
cephfs_data_pool_type: "{{ ceph_pool_type }}"
|
||||
cephfs_data_pool_cache_mode: "{{ ceph_cache_mode }}"
|
||||
cephfs_data_pool_pg_num: "{{ ceph_pool_pg_num }}"
|
||||
cephfs_data_pool_pgp_num: "{{ ceph_pool_pgp_num }}"
|
||||
cephfs_metadata_pool_name: "cephfs_metadata"
|
||||
cephfs_metadata_pool_type: "{{ ceph_pool_type }}"
|
||||
cephfs_metadata_pool_cache_mode: "{{ ceph_cache_mode }}"
|
||||
cephfs_metadata_pool_pg_num: "{{ ceph_pool_pg_num }}"
|
||||
cephfs_metadata_pool_pgp_num: "{{ ceph_pool_pgp_num }}"
|
||||
|
||||
####################
|
||||
# Kolla
|
||||
####################
|
||||
|
@ -9,6 +9,7 @@
|
||||
- "ceph-osd"
|
||||
- "ceph-rgw"
|
||||
- "ceph-mgr"
|
||||
- "ceph-mds"
|
||||
|
||||
- name: Copying over config.json files for services
|
||||
template:
|
||||
@ -25,6 +26,8 @@
|
||||
group: ceph-rgw
|
||||
- name: "ceph-mgr"
|
||||
group: "ceph-mgr"
|
||||
- name: "ceph-mds"
|
||||
group: "ceph-mds"
|
||||
|
||||
- name: Copying over ceph.conf
|
||||
vars:
|
||||
@ -40,3 +43,4 @@
|
||||
- "ceph-osd"
|
||||
- "ceph-rgw"
|
||||
- "ceph-mgr"
|
||||
- "ceph-mds"
|
||||
|
@ -27,3 +27,8 @@
|
||||
when:
|
||||
- enable_ceph_rgw_keystone | bool
|
||||
- inventory_hostname in groups['ceph-rgw']
|
||||
|
||||
- include: start_mdss.yml
|
||||
when:
|
||||
- enable_ceph_mds | bool
|
||||
- inventory_hostname in groups['ceph-mds']
|
||||
|
@ -27,3 +27,12 @@
|
||||
image: "{{ ceph_mgr_image_full }}"
|
||||
when:
|
||||
- inventory_hostname in groups['ceph-mgr']
|
||||
|
||||
- name: Pulling ceph-mds image
|
||||
kolla_docker:
|
||||
action: "pull_image"
|
||||
common_options: "{{ docker_common_options }}"
|
||||
image: "{{ ceph_mds_image_full }}"
|
||||
when:
|
||||
- enable_ceph_mds | bool
|
||||
- inventory_hostname in groups['ceph-mds']
|
||||
|
58
ansible/roles/ceph/tasks/start_mdss.yml
Normal file
58
ansible/roles/ceph/tasks/start_mdss.yml
Normal file
@ -0,0 +1,58 @@
|
||||
---
|
||||
- include: ../../ceph_pools.yml
|
||||
vars:
|
||||
pool_name: "{{ item.pool_name }}"
|
||||
pool_type: "{{ item.pool_type }}"
|
||||
cache_mode: "{{ item.cache_mode }}"
|
||||
pool_pg_num: "{{ item.pool_pg_num }}"
|
||||
pool_pgp_num: "{{ item.pool_pgp_num }}"
|
||||
with_items:
|
||||
- pool_name: "{{ cephfs_data_pool_name }}"
|
||||
pool_type: "{{ cephfs_data_pool_type }}"
|
||||
cache_mode: "{{ cephfs_data_pool_cache_mode }}"
|
||||
pool_pg_num: "{{ cephfs_data_pool_pg_num }}"
|
||||
pool_pgp_num: "{{ cephfs_data_pool_pgp_num }}"
|
||||
- pool_name: "{{ cephfs_metadata_pool_name }}"
|
||||
pool_type: "{{ cephfs_metadata_pool_type }}"
|
||||
cache_mode: "{{ cephfs_metadata_pool_cache_mode }}"
|
||||
pool_pg_num: "{{ cephfs_metadata_pool_pg_num }}"
|
||||
pool_pgp_num: "{{ cephfs_metadata_pool_pgp_num }}"
|
||||
|
||||
- name: Geting ceph mds keyring
|
||||
command: docker exec ceph_mon ceph auth get-or-create mds.{{ hostvars[item]['inventory_hostname'] }} mds 'allow ' osd 'allow *' mon 'allow rwx'
|
||||
register: ceph_mds_auth
|
||||
run_once: true
|
||||
delegate_to: "{{ groups['ceph-mon'][0] }}"
|
||||
changed_when: false
|
||||
with_items: "{{ groups['ceph-mds'] }}"
|
||||
|
||||
- name: Pushing ceph mds keyring to ceph-mds
|
||||
copy:
|
||||
content: "{{ item.stdout }}\n"
|
||||
dest: "{{ node_config_directory }}/ceph-mds/ceph.mds.{{ inventory_hostname }}.keyring"
|
||||
when:
|
||||
- inventory_hostname == item.item
|
||||
with_items: "{{ ceph_mds_auth.results }}"
|
||||
|
||||
- name: Starting ceph-mds container
|
||||
kolla_docker:
|
||||
action: "start_container"
|
||||
common_options: "{{ docker_common_options }}"
|
||||
image: "{{ ceph_mds_image_full }}"
|
||||
name: "ceph_mds"
|
||||
volumes:
|
||||
- "{{ node_config_directory }}/ceph-mds/:{{ container_config_directory }}/:ro"
|
||||
- "/etc/localtime:/etc/localtime:ro"
|
||||
- "kolla_logs:/var/log/kolla/"
|
||||
|
||||
- name: Checking whether cephfs is created
|
||||
command: docker exec ceph_mon ceph fs get cephfs
|
||||
register: cephfs_stat
|
||||
failed_when: false
|
||||
changed_when: false
|
||||
run_once: true
|
||||
|
||||
- name: Creating ceph new filesystem
|
||||
command: docker exec ceph_mon ceph fs new cephfs cephfs_metadata cephfs_data
|
||||
run_once: true
|
||||
when: cephfs_stat.rc != 0
|
@ -11,3 +11,8 @@
|
||||
when:
|
||||
- enable_ceph_rgw | bool
|
||||
- inventory_hostname in groups['ceph-rgw']
|
||||
|
||||
- include: start_mdss.yml
|
||||
when:
|
||||
- enable_ceph_mds | bool
|
||||
- inventory_hostname in groups['ceph-mds']
|
||||
|
17
ansible/roles/ceph/templates/ceph-mds.json.j2
Normal file
17
ansible/roles/ceph/templates/ceph-mds.json.j2
Normal file
@ -0,0 +1,17 @@
|
||||
{
|
||||
"command": "/usr/bin/ceph-mds -f -c /etc/ceph/ceph.conf -i {{ inventory_hostname }}",
|
||||
"config_files": [
|
||||
{
|
||||
"source": "{{ container_config_directory }}/ceph.conf",
|
||||
"dest": "/etc/ceph/ceph.conf",
|
||||
"owner": "ceph",
|
||||
"perm": "0600"
|
||||
},
|
||||
{
|
||||
"source": "{{ container_config_directory }}/ceph.mds.{{ inventory_hostname }}.keyring",
|
||||
"dest": "/var/lib/ceph/mds/ceph-{{ inventory_hostname }}/keyring",
|
||||
"owner": "root",
|
||||
"perm": "0644"
|
||||
}
|
||||
]
|
||||
}
|
@ -142,6 +142,7 @@ kolla_internal_vip_address: "10.10.10.254"
|
||||
#enable_ceilometer: "no"
|
||||
#enable_central_logging: "no"
|
||||
#enable_ceph: "no"
|
||||
#enable_ceph_mds: "no"
|
||||
#enable_ceph_rgw: "no"
|
||||
#enable_chrony: "no"
|
||||
#enable_cinder: "no"
|
||||
|
@ -0,0 +1,4 @@
|
||||
---
|
||||
features:
|
||||
- |
|
||||
Cephfs is implemented
|
Loading…
Reference in New Issue
Block a user