Use Rados and add Ceph entries to pvcnoded.yaml

This commit is contained in:
2020-06-06 21:12:51 -04:00
parent 70b787d1fd
commit 598b2025e8
3 changed files with 13 additions and 4 deletions

View File

@ -179,3 +179,10 @@ pvc:
mtu: 1500
# address: Storage (Ceph OSD) interface IP address, options: None, by-id, <static>/<mask>
address: by-id
# storage; PVC storage configuration
# OPTIONAL if enable_storage: False
storage:
# ceph_config_file: The config file containing the Ceph cluster configuration
ceph_config_file: "/etc/ceph/ceph.conf"
# ceph_admin_keyring: The file containing the Ceph client admin keyring
ceph_admin_keyring: "/etc/ceph/ceph.client.admin.keyring"

View File

@ -43,10 +43,9 @@ import ipaddress
import apscheduler.schedulers.background
from distutils.util import strtobool
from queue import Queue
from xml.etree import ElementTree
from rados import Rados
import pvcnoded.log as log
import pvcnoded.zkhandler as zkhandler
@ -263,7 +262,10 @@ def readConfig(pvcnoded_config_file, myhostname):
# Handle the storage config
if config['enable_storage']:
try:
config_storage = dict()
config_storage = {
'ceph_config_file': o_config['pvc']['cluster']['storage']['ceph_config_file'],
'ceph_admin_keyring': o_config['pvc']['cluster']['storage']['ceph_admin_keyring']
}
except Exception as e:
print('ERROR: Failed to load configuration: {}'.format(e))
exit(1)