Ejemplo n.º 1
0
def add_ceph_osd(node, cluster_name, minionId):
    failedNodes = []
    try:
        failed = salt_wrapper.add_ceph_osd(
            cluster_name, {minionId: node})
        if failed:
            log.debug("Failed:%s" % failed)
            if minionId in failed.keys():
                failedNodes.append(minionId)
    except Exception, e:
        log.exception(e)
        failedNodes.append(node)
Ejemplo n.º 2
0
def add_ceph_osds(osdlist):
    failedNodes = []
    for osd in osdlist:
        try:
            node = Host.objects.get(pk=str(osd['node']))

            storage_device = StorageDevice.objects.get(
                pk=str(osd['storage_device']))
            node_data = {'cluster_ip': str(node.cluster_ip),
                         'public_ip': str(node.public_ip),
                         'devices': {str(storage_device.storage_device_name): 'xfs'}}  # noqa
            failed = salt_wrapper.add_ceph_osd(
                str(node.cluster.cluster_name), {node.node_name: node_data})
            if failed:
                log.debug("Failed:%s" % failed)
                if node.node_name in failed.keys():
                    failedNodes.append(osd)
        except Exception, e:
            log.exception(e)
            failedNodes.append(osd)