We moved this page to our Documentation Portal. You can find the latest updates here. |
Question
How do I configure CHAP authentication on a Cloud-boot Hypervisor?
Answer
The following snippet is an example of the custom config that will allow you to use CHAP authentication if that is what your settings are set to:
#ISCSI NIC Config
ifconfig eth1 192.168.90.105 netmask 255.255.254.0 mtu 9000 up
#ISCSI initiatorname (This should be different for each HV)
echo 'InitiatorName=iqn.2013-11.com.hvx' > /etc/iscsi/initiatorname.iscsi
# Discovery & CHAP auth Login
iscsiadm -m discovery -t st -p 192.168.90.90
iscsiadm -m node -T iqn.2000-01.com.synology:gpntdcrs.31 --op=update --name=node.session.auth.authmethod --value=CHAP
iscsiadm -m node -T iqn.2000-01.com.synology:gpntdcrs.31 --op=update --name=node.session.auth.username --value=youruser
iscsiadm -m node -T iqn.2000-01.com.synology:gpntdcrs.31 --op=update --name=node.session.auth.password --value=yourpass
# Remove any unwanted portals
iscsiadm -m node --op=delete -p 192.168.109.131
iscsiadm -m node --op=delete -p 192.168.96.89
iscsiadm -m node --op=delete -p 192.168.96.88
iscsiadm -m node --op=delete -p 169.254.117.49
iscsiadm -m node --op=delete -p 192.168.96.87
iscsiadm -m node -l -T iqn.2000-01.com.synology:gpntdcrs.31
Additional Info
Cloud-boot Hypervisors have stateless configuration. That means that any configuration applied is not persistent. To have the configuration saved, you can edit the custom-config parameters on your HV. This will ensure that anytime your HV is rebooted, those parameters will execute. It's like an rc.local for cloud-boot HVs. It has the same limitations as rc.local, it is the last script executed.