Пример #1
0
from __future__ import print_function
from functions_ovirt import read_config
import sqlsoup

db_string = "postgresql+psycopg2://engine:[email protected]/engine"
db = sqlsoup.SQLSoup(db_string)

for iscsi in db.storage_server_connections.filter(db.storage_server_connections.iqn != None):
    print("iqn: %s -- connection: %s " % (str(iscsi.iqn), str(iscsi.connection)))

config = read_config(file_config="config.yml")
luns = config["luns"]
portals = config["mpath"]

#####
# modify DB
import itertools

lun_local = luns["lunIDA"]
lun_remote = luns["lunIDB"]
portals_local = portals["iscsiportalA"]
portals_remote = portals["iscsiportalB"]
i = 0
# for lunsa, lunsb in itertools.izip(lun_local, lun_remote):
# print("changing %s by %s " % (lunsa, lunsb))
# print(db.storage_server_connections.filter_by(iqn=lunsa))
# lunx = db.storage_server_connections.filter_by(iqn=lunsa).all()
# i += 1
# print(i)
# print(lunx)
Пример #2
0
from __future__ import print_function

import sys
import os
from time import sleep
from progress.spinner import Spinner
from functions_ovirt import connect, read_config

path = os.path.dirname(os.path.abspath(__file__))
config = read_config(file_config=path + '/config.yml')
manager = config['manager']
url_manager = 'https://' + manager
username = '******'
password = '******'
api = connect(url_manager, password, username)

clusters = api.clusters.list()
hosts = api.hosts.list()

#for data_center in data_centers:
#    print("DataCenter Name: %s Status: %s" % (data_center.name, data_center.get_status().get_state()))

for cluster in clusters:
    print("Cluster Name: %s " % (cluster.name))


def spm_status(host):
    if host.storage_manager.valueOf_ == 'true':
        return 1
    else:
        return 0
Пример #3
0
from __future__ import print_function
from functions_ovirt import read_config
import sqlsoup

db_string = 'postgresql+psycopg2://engine:[email protected]/engine'
db = sqlsoup.SQLSoup(db_string)

for iscsi in db.storage_server_connections.filter(db.storage_server_connections.iqn != None):
    print("iqn: %s -- connection: %s " % (str(iscsi.iqn), str(iscsi.connection)))

config = read_config(file_config='config.yml')
luns = config['luns']
portals = config['mpath']

#####
# modify DB
import itertools

lun_local = luns['lunIDA']
lun_remote = luns['lunIDB']
portals_local = portals['iscsiportalA']
portals_remote = portals['iscsiportalB']
i=0
#for lunsa, lunsb in itertools.izip(lun_local, lun_remote):
    #print("changing %s by %s " % (lunsa, lunsb))
    #print(db.storage_server_connections.filter_by(iqn=lunsa))
    #lunx = db.storage_server_connections.filter_by(iqn=lunsa).all()
    #i += 1
    #print(i)
    #print(lunx)
Пример #4
0
from __future__ import print_function

import sys
import os
from time import sleep
from progress.spinner import Spinner
from functions_ovirt import connect, read_config


path = os.path.dirname(os.path.abspath(__file__))
config = read_config(file_config=path + "/config.yml")
manager = config["manager"]
url_manager = "https://" + manager
username = "******"
password = "******"
api = connect(url_manager, password, username)


clusters = api.clusters.list()
hosts = api.hosts.list()

# for data_center in data_centers:
#    print("DataCenter Name: %s Status: %s" % (data_center.name, data_center.get_status().get_state()))


for cluster in clusters:
    print("Cluster Name: %s " % (cluster.name))


def spm_status(host):
    if host.storage_manager.valueOf_ == "true":