Beispiel #1
0
add_auth_group = assign_iniator_gp_to_LUN(STDURL, vol_id, account_id, 'ALL')
verify_add_auth_gp(add_auth_group, 'ALL')

logging.debug('getting iqn for volume %s', volumeDict['name'])
iqn = discover_iscsi_lun(VSM_IP, vol_iqn)
iqn = verify_iqn(iqn)
logging.debug('iqn for discovered iSCSI LUN... %s', iqn)

login_result = iscsi_login_logout(iqn, VSM_IP, 'login')
verify_iscsi_operation(login_result, volumeDict['name'], 'login')
time.sleep(2)
result = getDiskAllocatedToISCSI(VSM_IP, mnt_point)
iscsi_device = verify_getDiskAllocatedToISCSI(result, mnt_point)
result = execute_mkfs(iscsi_device, 'ext3')
verify_execute_mkfs(result)
mount_result = mount_iscsi(iscsi_device, volumeDict['name'])
verify_mount(mount_result)
#mount_dir = 'mount/%s' %(volumeDict['name'])
mount_dir = {'name': volumeDict['name'], 'mountPoint': volumeDict['name']}
logging.info('...executing vdbench....')
executeVdbenchFile(mount_dir, 'filesystem_iscsi')
time.sleep(20)
logging.info('verifying the IOPS before Node goes to reset...')
iops_datapath = poolName + '/' + accName + tsm_name + '/' + volumeDict['name']
verify_IOPS(NODE1_IP, PASSWD, iops_datapath)
logging.debug('going to move node to reset...')
getControllerInfo(NODE1_IP, PASSWD, 'reboot', 'reboot.txt')

logging.debug('verifying pool import at peer Node: %s', NODE2_IP)
verify_pool_import(poolName, NODE2_IP, PASSWD)
logging.debug(
result = assign_iniator_gp_to_LUN(stdurl, volid, accId, 'ALL')
verify_add_auth_gp(result)
logging.debug('getting iqn for volume %s', volname)
iqn = discover_iscsi_lun(tsm_ip, vol_iqn)
iqn = verify_iqn(iqn)
logging.debug('iqn for discovered iSCSI LUN... %s', iqn)
login_result = iscsi_login_logout(iqn, tsm_ip, 'login')
verify_iscsi_login(login_result, volname)
time.sleep(5)
mountpoint = accName + volname
result = getDiskAllocatedToISCSI(tsm_ip, mountpoint)
device = verify_getDiskAllocatedToISCSI(result, mountpoint)
mkfs_result = execute_mkfs(device, 'ext3')
verify_execute_mkfs(mkfs_result)
mount_result = mount_iscsi(device, volname)
verify_mount(mount_result)
mount_dir = {'name': volname, 'mountPoint': volname}

qos_datapath = poolName + '/' + accName + tsm_name + '/' + volname

logging.info('Running vdbench  by using file')
exe = executeVdbenchFile(mount_dir, 'filesystem_iscsi')
time.sleep(5)
check_vdbench = is_vdbench_alive(volname)
if check_vdbench:
    logging.info('vdbench is running')
    logging.info('Editing LUN attributes while IOs are running....')
    #-------------------------IOPS------------------------------------
    logging.info('Editing IOPS....')
    startTime = ctime()
    vdConfigFileName = fileConfigFiles[key]
    VOL_NAME = key

    confFile = VOL_NAME  # creating a configuration file as VOL_NAME

    # output directory for vdbench
    outputDir = '%s_%s' % (VOL_NAME, indianTime.isoformat())

    #copying perticular vdconf template to new file to execute vdbench
    executeCmd('cp vdbench/templates/%s vdbench/%s' %
               (vdConfigFileName, VOL_NAME))
    iscsiDevice, vol_id, account_id, vol_mnt_point, iqn = \
            getiSCSIDevice(VOL_NAME, vsm_id, POOL_IOPS, vsm_dataset_id, STDURL)
    result = execute_mkfs(iscsiDevice, 'ext3')
    verify_execute_mkfs(result)
    mountResult = mount_iscsi(iscsiDevice, VOL_NAME)
    verify_mount(mountResult)
    volMntPoint = 'mount/%s' % (VOL_NAME)
    userValues['anchor'] = volMntPoint

    #updating configuration file before executing vdbench
    createRunTimeConfig('vdbench/%s' % (VOL_NAME), userValues)

    executeVdbench(confFile, outputDir)
    flatfile = '%s/flatfile.html' % (outputDir)
    #vdParseAndPlotImage(flatfile, 'rate')
    #vdParseAndPlotImage(flatfile, 'resp')
    #vdParseAndPlotImage(flatfile, 'MB/sec')

    time.sleep(2)
    umountResult = executeCmd('umount %s' % (volMntPoint))
Beispiel #4
0
         iops_volid, iopsgroup_id, iops_volname)
 result = assign_iniator_gp_to_LUN(stdurl, iops_volid, accId, 'ALL')
 verify_add_auth_gp(result)
 logging.debug('getting iqn for volume %s', iops_volname)
 iqn = discover_iscsi_lun(tsm_ip, iops_vol_iqn)
 iqn = verify_iqn(iqn)
 logging.debug('iqn for discovered iSCSI LUN... %s', iqn)
 login_result = iscsi_login_logout(iqn, tsm_ip, 'login')
 verify_iscsi_login(login_result, iops_volname)
 time.sleep(5)
 mountpoint = accName + iops_volname
 result = getDiskAllocatedToISCSI(tsm_ip, mountpoint)
 device = verify_getDiskAllocatedToISCSI(result, mountpoint)
 mkfs_result = execute_mkfs(device, 'ext3')
 verify_execute_mkfs(mkfs_result)
 mount_result = mount_iscsi(device, iops_volname)
 verify_mount(mount_result)
 ##executing vd bench
 mount_dir = {'name': iops_volname, 'mountPoint': iops_volname}
 logging.info('...executing vdbench....')
 executeVdbenchFile(mount_dir, 'filesystem_iscsi')
 time.sleep(14)
 logging.info('verifying the Iops in volume')
 iops_datapath = poolName + '/' + accName + tsm_name + '/' + iops_volname
 cmd = 'reng stats access dataset %s qos | head -n 4 ; sleep 10 ;\
         echo "-----------------"; reng stats access dataset %s qos |\
         head -n 4' % (iops_datapath, iops_datapath)
 logging.debug('executing the command %s in controller', str(cmd))
 iops_res = getControllerInfo(node_ip, passwd, cmd, 'iopsoutput.txt')
 print iops_res
 logging.debug('iops result is %s', (iops_res))