else: print 'Not able to get account id...' logging.error('mount/umount 100 NFS volumes test case is blocked, '\ 'Error: %s', account_id[1]) is_blocked(startTime, FOOTER_MSG, BLOCKED_MSG) print account_id #------------------------------------------------------------------------------ ###creating 5 TSM-------------------------------------------------------------- for x in range(1, 6): tsm_dict = {'name': 'T200%s' %(x), 'accountid': account_id, 'poolid': \ pool_id, 'totaliops': '2000', 'quotasize': '1T', 'tntinterface': \ str(TSM_interface[x-1]), 'dnsserver': str(TSM_dnsserver[x-1]), \ 'ipaddress': str(TSM_IPs[x-1]), 'totalthroughput': '8000'} #calling create TSM method... result = create_tsm(tsm_dict, STDURL) if result[0] == 'FAILED': print 'Not able to create VSM/TSM %s' % (tsm_dict.get('name')) logging.error('Not able to create VSM/TSM %s', result[1]) logging.debug('mount/umount 100 NFS volumes test case is blocked...') is_blocked(startTime, FOOTER_MSG, BLOCKED_MSG) #------------------------------------------------------------------------------ ###Getting TSMs ID and dasetids------------------------------------------------ for x in range(1, 6): tsm = listTSMWithIP_new(STDURL, str(TSM_IPs[x - 1])) if tsm[0] == 'FAILED': print 'Not able to get TSM/VSM with IP: %s' % (TSM_IPs[x - 1]) logging.error('Not able to list TSM/VSM with IP: %s', TSM_IPs[x - 1]) logging.debug('mount/umount 100 NFS volumes test case is blocked...') is_blocked(startTime, FOOTER_MSG, BLOCKED_MSG)
STDURL, None) # 2nd param is acc_name, if None, taken as 1st acc if account_id[0] == 'FAILED': logging.error('Testcase %s is blocked due to' \ ': %s', tcName, account_id[1]) is_blocked(startTime, FOOTER_MSG, BLOCKED_MSG) account_id = account_id[1] # Provide variables for VSM creation (from conf & hardcode) in dict format vsm_dict = {'name': VSM_NAME, 'accountid': account_id, 'poolid': \ pool_id, 'totaliops': POOL_IOPS, 'quotasize': '1T', 'tntinterface': \ VSM_INTERFACE, 'dnsserver': VSM_DNS, \ 'ipaddress': VSM_IP, 'totalthroughput': 4*int(POOL_IOPS)} # Create VSM using the pool_id and the params received from conf file #''' result = create_tsm(vsm_dict, STDURL) # This method is an aberration, ... # ...elsewhere STDURL is 1st param if result[0] == 'FAILED': logging.error('Testcase %s is blocked due to' \ ': %s', tcName, result[1]) is_blocked(startTime, FOOTER_MSG, BLOCKED_MSG) #''' # Get the info for the VSM created above (this list method response... # ...contains id, not create, so needed) vsm = listTSMWithIP_new(STDURL, VSM_IP) if vsm[0] == 'FAILED': logging.error('Testcase %s is blocked due to' \ ': %s', tcName, tsm[1]) is_blocked(startTime, FOOTER_MSG, BLOCKED_MSG) vsminfo = vsm[1] # Extract the vsm_id & vsm_dataset_id from info obtained above
logging.error('Testcase %s is blocked due to' \ ': %s',tcName, account_id[1]) is_blocked(startTime, FOOTER_MSG, BLOCKED_MSG) account_id = account_id[1] # Provide variables for VSM creation (from conf & hardcode) in dict format vsm_dict = {'name': VSM_NAME, 'accountid': account_id, 'poolid': \ pool_id, 'totaliops': POOL_IOPS, 'quotasize': '1T', 'tntinterface': \ VSM_INTERFACE, 'dnsserver': VSM_DNS, \ 'ipaddress': VSM_IP, 'totalthroughput': 4*int(POOL_IOPS)} # Create VSM using the pool_id and the params received from conf file result = create_tsm( vsm_dict, STDURL) # This method is an aberration, elsewhere STDURL is 1st param if result[0] == 'FAILED': logging.error('Testcase %s is blocked due to' \ ': %s', tcName,result[1]) is_blocked(startTime, FOOTER_MSG, BLOCKED_MSG) # Get the info for the VSM created above (this list method response contains id, not create, so needed) vsm = listTSMWithIP_new(STDURL, VSM_IP) if vsm[0] == 'FAILED': logging.error('Testcase %s is blocked due to' \ ': %s', tcName,tsm[1]) is_blocked(startTime, FOOTER_MSG, BLOCKED_MSG) vsminfo = vsm[1] print vsminfo
logging.info("creation of TSM begins") for x in range(1, 6): tsm_params = {'name': 'TTTSM%d' %x, 'accountid': account_id, 'poolid': pool_id, \ 'ipaddress': conf["ipVSM%d" %x], 'quotasize': '1T', 'blocksize': '4k', \ 'latency': 15, 'totaliops': 1000, 'totalthroughput': '', \ 'graceallowed': 'true', 'subnet': 8, 'tntinterface': conf["interfaceVSM%d" %x], \ 'dnsname': '[email protected]', 'dnsserver': '8.8.8.8', \ 'gracecontrol': 'false', 'iopscontrol': 'true', \ 'tpcontrol': 'true', 'backuptpcontrol': 'false', \ 'totalbackupthroughput': 0} tsm_params['totalthroughput'] = tsm_params['totaliops'] * 4 # calling method to create tsm logging.info("calling method to create tsm") result_tsm = create_tsm(tsm_params, stdurl) if result_tsm[0] == 'FAILED': print "FAILED TO CREATE VSM " logging.error("FAILED TO CREATE VOLUME: %s" % result_tsm) elif result_tsm[0] == 'PASSED': print "ADDITION OF VSM WAS SUCESSFUL " logging.info("Adding TSM was sucessful") querycommand = 'command=listTsm' logging.debug("passing querycommand to list tsm \n %s" % querycommand) resp_listTsm = sendrequest(stdurl, querycommand) data = json.loads(resp_listTsm.text) logging.info("sucessfully loaded data to list TSM") tsms = data["listTsmResponse"]["listTsm"] # fetcing datasetID and tsmID to create volumes