Just a thought, but I'd like to make this work like magic with cloud-init.
I just attached a volume to a 'onmetal' instance.
The dialog says "your volume is now available"
and says:
----
Note: When attaching volumes to OnMetal servers, you must SSH into your server, set the initiator name, discover the targets and then connect to the target.
Refer to the Knowledge Center for detailed directions.
Commands you will need:
# set initiator name
echo InitiatorName=iqn.2008-10.org.openstack:ae4db3d5-8580-4120-915d-a75840424f7e > /etc/iscsi/initiatorname.iscsi
# discover targets for a given portal
iscsiadm -m discovery --type sendtargets --portal 10.190.143.14:3260
# connect to the target
iscsiadm -m node --targetname=iqn.2010-11.com.rackspace:8cb1f4d5-a144-4926-a1c7-c04842c4629d --portal 10.190.143.14:3260 --login
----
i 'apt-get install -qy open-iscsi'
then
sudo su -
and paste the above, and woila! magic.