Added LVM support to DISK IO Performance test

This commit is contained in:
SRIKKANTH 2016-02-11 00:15:38 +05:30
Родитель 429ca46fd3
Коммит 28d919d858
5 изменённых файлов: 124 добавлений и 52 удалений

Просмотреть файл

@ -4193,17 +4193,32 @@
<Priority>P0</Priority>
</test>
<test>
<testName>ICA-IO-DISK-PERF-TEST</testName>
<testName>ICA-IO-DISK-PERF-TEST-RAID</testName>
<testScript>io-test-setup.sh</testScript>
<testScriptps1>ICA-IO-DISK-PERF-TEST.ps1</testScriptps1>
<files>.\remote-scripts\sysbench-full-io-test.sh,.\remote-scripts\sysbench-log-parser.sh,.\remote-scripts\io-test-setup.sh,.\remote-scripts\keep_cmds_in_startup.sh</files>
<setupType>D14DISK32</setupType>
<!-- <setupType>DS14DISK32</setupType> -->
<TestType></TestType>
<DiskType>RAID</DiskType>
<TestFeature></TestFeature>
<SupportedExecutionModes>AzureServiceManagement,AzureResourceManager</SupportedExecutionModes>
<TestID>Perf_004</TestID>
<Priority>P0</Priority>
</test>
<test>
<testName>ICA-IO-DISK-PERF-TEST-LVM</testName>
<testScript>io-test-setup.sh</testScript>
<testScriptps1>ICA-IO-DISK-PERF-TEST.ps1</testScriptps1>
<files>.\remote-scripts\sysbench-full-io-test.sh,.\remote-scripts\sysbench-log-parser.sh,.\remote-scripts\io-test-setup.sh,.\remote-scripts\keep_cmds_in_startup.sh</files>
<setupType>D14DISK32</setupType>
<!-- <setupType>DS14DISK32</setupType> -->
<TestType></TestType>
<DiskType>LVM</DiskType>
<TestFeature></TestFeature>
<SupportedExecutionModes>AzureServiceManagement,AzureResourceManager</SupportedExecutionModes>
<TestID>Perf_006</TestID>
<Priority>P0</Priority>
</test>
<test>
<testName>ICA-NETWORK-PERF-TEST</testName>
@ -5266,12 +5281,17 @@
</test>
</Cycle>
<Cycle>
<cycleName>IOPERF</cycleName>
<cycleName>IOPERF-RAID</cycleName>
<test>
<Name>ICA-IO-DISK-PERF-TEST</Name>
<Name>ICA-IO-DISK-PERF-TEST-RAID</Name>
</test>
</Cycle>
<Cycle>
<cycleName>IOPERF-LVM</cycleName>
<test>
<Name>ICA-IO-DISK-PERF-TEST-LVM</Name>
</test>
</Cycle>
<!-- E2E tests -->
<Cycle>

Просмотреть файл

@ -1,5 +1,5 @@
# This script deploys the VMs for the IO performance test and trigger the test.
# 1. sysstat sysbench mdadm and dos2unix must be installed in the test image
# 1. sysstat sysbench mdadm lvm lvm2 and dos2unix must be installed in the test image
# Author: Sivakanth R
# Email : v-sirebb@microsoft.com
#
@ -10,6 +10,7 @@ Import-Module .\TestLibs\RDFELibs.psm1 -Force
$result = ""
$testResult = ""
$resultArr = @()
$DiskType = ""
$isDeployed = DeployVMS -setupType $currentTestData.setupType -Distro $Distro -xmlConfig $xmlConfig
@ -26,7 +27,7 @@ if ($isDeployed)
$hs1vm1sshport = $allVMData.SSHPort
$hs1vm1tcpport = $allVMData.TCPtestPort
$hs1vm1udpport = $allVMData.UDPtestPort
$DiskType = $currentTestData.DiskType
RemoteCopy -uploadTo $hs1VIP -port $hs1vm1sshport -files $currentTestData.files -username $user -password $password -upload
RunLinuxCmd -username $user -password $password -ip $hs1VIP -port $hs1vm1sshport -command "mkdir code" -runAsSudo
RunLinuxCmd -username $user -password $password -ip $hs1VIP -port $hs1vm1sshport -command "cp *.sh code/" -runAsSudo
@ -34,13 +35,12 @@ if ($isDeployed)
$KernelVersion = RunLinuxCmd -username $user -password $password -ip $hs1VIP -port $hs1vm1sshport -command "uname -a" -runAsSudo
LogMsg "VM1 kernel version:- $KernelVersion"
$out = RunLinuxCmd -username $user -password $password -ip $hs1VIP -port $hs1vm1sshport -command "bash /home/$user/code/$($currentTestData.testScript) $user" -runAsSudo -runmaxallowedtime 7200
$raidStatus = RunLinuxCmd -username $user -password $password -ip $hs1VIP -port $hs1vm1sshport -command "cat /home/$user/code/iotest.log.txt | grep 'Raid mount: Success'" -runAsSudo
if ($raidStatus -imatch 'Raid mount: Success')
$out = RunLinuxCmd -username $user -password $password -ip $hs1VIP -port $hs1vm1sshport -command "yum install -y lvm2" -runAsSudo
$out = RunLinuxCmd -username $user -password $password -ip $hs1VIP -port $hs1vm1sshport -command "bash /home/$user/code/$($currentTestData.testScript) $user $DiskType" -runAsSudo -runmaxallowedtime 7200
$iosetupStatus = RunLinuxCmd -username $user -password $password -ip $hs1VIP -port $hs1vm1sshport -command "cat /home/$user/code/iotest.log.txt | grep 'mount: Success'" -runAsSudo
if ($iosetupStatus -imatch 'mount: Success')
{
LogMsg "Raid is created Successfully and VM is ready for IOPerf test"
LogMsg "$DiskType is created Successfully and VM is ready for IOPerf test"
$restartvmstatus = RestartAllDeployments -allVMData $allVMData
if ($restartvmstatus -eq "True")
@ -54,7 +54,7 @@ if ($isDeployed)
for($testDuration -le 260000)
{
$sysbenchStatus = RunLinuxCmd -username $user -password $password -ip $hs1VIP -port $hs1vm1sshport -command "pgrep -lf sysbench-full-io-test" -runAsSudo
$sysbenchStatus = RunLinuxCmd -username $user -password $password -ip $hs1VIP -port $hs1vm1sshport -command "pgrep sysbench 2>/dev/null" -runAsSudo -ignoreLinuxExitCode
if ($sysbenchStatus)
{
$iterationStatus = RunLinuxCmd -username $user -password $password -ip $hs1VIP -port $hs1vm1sshport -command "grep iteration /home/$user/code/sysbenchlog/sysbench.log.txt | tail -1" -runAsSudo -ignoreLinuxExitCode
@ -63,31 +63,33 @@ if ($isDeployed)
else{
WaitFor -seconds 30
$sysbenchStatus = RunLinuxCmd -username $user -password $password -ip $hs1VIP -port $hs1vm1sshport -command "pgrep -lf sysbench-full-io-test" -runAsSudo
$sysbenchStatus = RunLinuxCmd -username $user -password $password -ip $hs1VIP -port $hs1vm1sshport -command "pgrep sysbench 2>/dev/null" -runAsSudo -ignoreLinuxExitCode
if ($sysbenchStatus)
{
$iterationStatus = RunLinuxCmd -username $user -password $password -ip $hs1VIP -port $hs1vm1sshport -command "grep iteration /home/$user/code/sysbenchlog/sysbench.log.txt | tail -1" -runAsSudo -ignoreLinuxExitCode
LogMsg "Sysbench test is RUNNING.. `n $iterationStatus"
}
else{
$iotestStatus = RunLinuxCmd -username $user -password $password -ip $hs1VIP -port $hs1vm1sshport -command " cat /home/$user/code/sysbenchlog/sysbench.log.txt | grep 'SYSBENCH TEST COMPLETED' " -runAsSudo
$iotestStatus = RunLinuxCmd -username $user -password $password -ip $hs1VIP -port $hs1vm1sshport -command "cat /home/$user/code/sysbenchlog/sysbench.log.txt | grep 'SYSBENCH TEST COMPLETED' " -runAsSudo
if ($iotestStatus -imatch "SYSBENCH TEST COMPLETED")
{
LogMsg "Sysbench test is COMPLETED.."
$testResult = "PASS"
WaitFor -seconds 30
$logparserStatus = RunLinuxCmd -username $user -password $password -ip $hs1VIP -port $hs1vm1sshport -command " cat /home/$user/code/sysbenchlog/sysbench.log.txt | grep 'LOGPARSER COMPLETED' " -runAsSudo
$logparserStatus = RunLinuxCmd -username $user -password $password -ip $hs1VIP -port $hs1vm1sshport -command " cat /home/$user/code/sysbenchlog/sysbench.log.txt | grep 'LOGPARSER COMPLETED' " -runAsSudo -ignoreLinuxExitCode
if ($logparserStatus -imatch "LOGPARSER COMPLETED")
{
LogMsg "IO perf test and its log parser is COMPLETED.."
$testResult = "PASS"
$out = RemoteCopy -download -downloadFrom $hs1VIP -files "/home/$user/code/*.tar" -downloadTo $LogDir -port $hs1vm1sshport -username $user -password $password 2>&1 | Out-Null
break
}
else{
LogErr "IO perf test is COMPLETED.. and its log parser is FAILED.."
LogMsg "Check Log Parser and run manully for .csv file"
LogMsg "IO perf test is COMPLETED.. and its log parser is FAILED.."
LogMsg "Check Log Parser and run it manully to generate .csv file"
$testResult = "PASS"
$out = RemoteCopy -download -downloadFrom $hs1VIP -files "/home/$user/code/*.tar" -downloadTo $LogDir -port $hs1vm1sshport -username $user -password $password 2>&1 | Out-Null
break
}
}
@ -109,7 +111,7 @@ if ($isDeployed)
}
}
else{
LogErr "Raid is creation FAILED.. and IOPerf test is ABORTED"
LogErr "$DiskType creation is FAILED.. and IOPerf test is ABORTED"
$testResult = "Aborted"
}
LogMsg "Test result : $testResult"

Просмотреть файл

@ -10,46 +10,93 @@
#
#####
username=$1
raidName="/dev/md1"
test_type=$2
mountdir="/dataIOtest"
code_path="/home/$username/code"
LOGFILE="${code_path}/iotest.log.txt"
echo "IO test setup started.." >> $LOGFILE
[ -d $mountdir ] && umount $mountdir && rm -rf $mountdir
mkdir $mountdir
echo "IO test setup started.." > $LOGFILE
list=(`fdisk -l | grep 'Disk.*/dev/sd[a-z]' |awk '{print $2}' | sed s/://| sort| grep -v "/dev/sd[ab]$" `)
count=0
while [ "x${list[count]}" != "x" ]
do
echo ${list[$count]} >> $LOGFILE
(echo n; echo p; echo 2; echo; echo; echo t; echo fd; echo w;) | fdisk ${list[$count]} >> $LOGFILE
count=$(( $count + 1 ))
done
lsblk >> $LOGFILE
echo "--- Raid $raidName creation started ---" >> $LOGFILE
(echo y)| mdadm --create $raidName --level 0 --raid-devices ${#list[@]} ${list[@]} >> $LOGFILE
if [ $? -ne 0 ]; then
echo "$raidName Raid creation: Failed" >> $LOGFILE
exit 80
fi
echo "$raidName Raid creation: Success" >> $LOGFILE
if [ "$test_type" == "LVM" ]; then
deviceName="/dev/vg1/lv1"
echo "--- LVM $deviceName creation started ---" >> $LOGFILE
time mkfs.ext4 $raidName >> $LOGFILE
if [ $? -ne 0 ]; then
echo "$raidName Raid format: Failed" >> $LOGFILE
exit 80
yes | pvcreate ${list[@]} >> $LOGFILE
if [ $? -ne 0 ]; then
echo "pvcreate: Failed" >> $LOGFILE
exit 80
fi
echo "pvcreate: Success" >> $LOGFILE
vgcreate vg1 ${list[@]} >> $LOGFILE
if [ $? -ne 0 ]; then
echo "vgcreate : Failed" >> $LOGFILE
exit 80
fi
echo "vgcreate : Success" >> $LOGFILE
lvcreate -l 100%FREE -i 32 -I 64 vg1 -n lv1
if [ $? -ne 0 ]; then
echo "lvcreate: Failed" >> $LOGFILE
exit 80
fi
echo "lvcreate : Success" >> $LOGFILE
time mkfs.ext4 $deviceName >> $LOGFILE
mount -o barrier=0 $deviceName $mountdir
if [ $? -ne 0 ]; then
echo "$deviceName LVM mount: Failed" >> $LOGFILE
exit 80
fi
echo "$deviceName LVM mount: Success on $mountdir" >> $LOGFILE
uuid=`blkid $deviceName| sed "s/.*UUID=\"//"| sed "s/\".*\"//"`
echo $uuid
echo "UUID=$uuid $mountdir ext4 defaults,barrier=0 0 2" >> /etc/fstab
elif [ "$test_type" == "RAID" ]; then
count=0
while [ "x${list[count]}" != "x" ]
do
echo ${list[$count]} >> $LOGFILE
(echo n; echo p; echo 2; echo; echo; echo t; echo fd; echo w;) | fdisk ${list[$count]} >> $LOGFILE
count=$(( $count + 1 ))
done
deviceName="/dev/md1"
echo "--- Raid $deviceName creation started ---" >> $LOGFILE
(echo y)| mdadm --create $deviceName --level 0 --raid-devices ${#list[@]} ${list[@]} >> $LOGFILE
if [ $? -ne 0 ]; then
echo "$deviceName Raid creation: Failed" >> $LOGFILE
exit 80
fi
echo "$deviceName Raid creation: Success" >> $LOGFILE
time mkfs.ext4 $deviceName >> $LOGFILE
if [ $? -ne 0 ]; then
echo "$deviceName Raid format: Failed" >> $LOGFILE
exit 80
fi
echo "$deviceName Raid format: Success" >> $LOGFILE
mount -o nobarrier $deviceName $mountdir
if [ $? -ne 0 ]; then
echo "$deviceName Raid mount: Failed" >> $LOGFILE
exit 80
fi
echo "$deviceName Raid mount: Success on $mountdir" >> $LOGFILE
uuid=`blkid $deviceName| sed "s/.*UUID=\"//"| sed "s/\".*\"//"`
echo $uuid
echo "UUID=$uuid $mountdir ext4 defaults,barrier=0 0 2" >> /etc/fstab
else
echo "Unknown DiskType $test_type: Aborted" >> $LOGFILE
fi
echo "$raidName Raid format: Success" >> $LOGFILE
mkdir $mountdir
uuid=`blkid $raidName| sed "s/.*UUID=\"//"| sed "s/\".*\"//"`
echo $uuid
echo "UUID=$uuid $mountdir ext4 defaults 0 2" >> /etc/fstab
mount -o nobarrier $raidName $mountdir
if [ $? -ne 0 ]; then
echo "$raidName Raid mount: Failed" >> $LOGFILE
exit 80
fi
echo "$raidName Raid mount: Success on $mountdir" >> $LOGFILE
df -hT >> $LOGFILE
cp $code_path/sysbench-full-io-test.sh $mountdir
bash $code_path/keep_cmds_in_startup.sh "cd $mountdir ; bash $mountdir/sysbench-full-io-test.sh $username &"

Просмотреть файл

@ -121,3 +121,6 @@ fi
bash $code_path/sysbench-log-parser.sh $LOGFILE
echo "Test logs are located at ${LOGDIR}"
vm_bus_ver=`modinfo hv_vmbus| grep ^version| awk '{print $2}'`
tar -cvf $code_path/logs-`hostname`-`uname -r`-$vm_bus_ver.tar $code_path/*

Просмотреть файл

@ -63,7 +63,7 @@ sed -i -e "s/seqrd/Sequential read/" $csv_file
sed -i -e "s/seqrewr/Sequential write/" $csv_file
sed -i -e "s/rndwr/Random write/" $csv_file
echo "Output csv file: $csv_file created successfully."
echo "LOGPARSER COMPLETED."
echo "Output csv file: $csv_file created successfully." >> $syslog_file_name
echo "LOGPARSER COMPLETED." >> $syslog_file_name
rm -rf $TEMP_DIR