
This article is intended for administrators wishing to create a 2x node + witness High Availability cluster utilizing Proxmox Virtual Environment (https://www.proxmox.com/en/proxmox-virtual-environment/overview) and StorMagic SvSAN (https://stormagic.com/svsan/).
Note: All images are clickable for enlarging, or can be opened in a new tab
Information
Guide Summary/shortcuts
This multipart guide will walk through the process to deploy 2x hyperconverged Proxmox VE nodes utilizing SvSAN virtualized block storage and a lightweight witness node, such as a Raspberry Pi.
Create an iSCSI login script
This next step/setup ensures that iSCSI storage provided by SvSAN virtual appliances is reconnected at boot and that all required Proxmox HA resources are properly configured to start automatically, in the event of a cluster down scenario.
Note: The following configuration needs to be done on every pve cluster member.
The below script will check the path count and login to paths if not the expected number.
Modify the $count value to your expected number of paths.
nano /root/iscsi_login.sh
#!/bin/bash
#check Multipath
#set -x
/usr/sbin/iscsiadm -m session
ret=$?
if [ $ret -ne 0 ]; then
/usr/sbin/iscsiadm -m node -l
else
for i in `/usr/sbin/multipath -ll | grep StorMagc | awk '{print $1}'`
do
count=`/usr/sbin/multipath -ll $i | grep sd | wc -l`
echo $count
#modify count to expected number of sessions e.g. 2 or 4 usually
if [ $count = 2 ]
then echo "ALL OK"
else
echo "rescan iSCSI login targets"
/usr/sbin/iscsiadm -m node -l
fi
done
fiNext chmod the script file to enable the execute bit
root@edgeline01:~# chmod +x /root/iscsi_login.shSet the script to run via crontab using the -e for edit switch
crontab -e
If this is the first time running you will be prompted for an editor - choose option1
root@edgeline01:~# crontab -e
no crontab for root - using an empty one
Select an editor. To change later, run select-editor again.
1. /bin/nano <---- easiest
2. /usr/bin/vim.tinyAdd the below lines to the crontab
*/5 * * * * /root/iscsi_login.sh > /dev/null 2>&1
@reboot /root/iscsi_login.sh
Such that it looks like:
# Edit this file to introduce tasks to be run by cron.
#
# Each task to run has to be defined through a single line
# indicating with different fields when the task will be run
# and what command to run for the task
#
# To define the time you can provide concrete values for
# minute (m), hour (h), day of month (dom), month (mon),
# and day of week (dow) or use '*' in these fields (for 'any').
#
# Notice that tasks will be started based on the cron's system
# daemon's notion of time and timezones.
#
# Output of the crontab jobs (including errors) is sent through
# email to the user the crontab file belongs to (unless redirected).
#
# For example, you can run a backup of all your user accounts
# at 5 a.m every week with:
# 0 5 * * 1 tar -zcf /var/backups/home.tgz /home/
#
# For more information see the manual pages of crontab(5) and cron(8)
#
# m h dom mon dow command
*/5 * * * * /root/iscsi_login.sh > /dev/null 2>&1
@reboot /root/iscsi_login.shSee Also
Comments
0 comments
Article is closed for comments.