Skip to content

Instantly share code, notes, and snippets.

@gilangvperdana
Created August 20, 2024 12:19
Show Gist options
  • Save gilangvperdana/309615c0783f98903c902284a4c03903 to your computer and use it in GitHub Desktop.
Save gilangvperdana/309615c0783f98903c902284a4c03903 to your computer and use it in GitHub Desktop.
Integrate Cinder with iSCSI (TrueNAS)

General

I have a TrueNAS node & i want to integrate it with Cinder. How to? here we go.

Pre-requirement

  • Openstack Cluster with Cinder Enabled (i use Kolla Ansible for Deployer)
  • TrueNAS with Pool & Dataset allocation

Enable Cinder with ISCSI Backend

nano /etc/kolla/globals.yaml
enable_cinder_backend_iscsi: "yes"
skip_cinder_backend_check: "true"
kolla-ansible -i inventory reconfigure -t cinder

Download Driver for TrueNAS

git clone https://github.com/iXsystems/cinder
docker cp driver/ixsystem/ cinder_volume:/var/lib/kolla/venv/lib/python3.10/site-packages/cinder/volume/drivers/ixsystems 

Add Configuration on cinder.conf

nano /etc/kolla/config/cinder/cinder-volume.conf
[DEFAULT] 
enabled_backends = ixsystems-iscsi, lvm-1 
default_volume_type = ixsystems-iscsi 
 
[ixsystems-iscsi] 
iscsi_helper = tgtadm 
volume_dd_blocksize = 512 
volume_driver = cinder.volume.drivers.ixsystems.iscsi.FreeNASISCSIDriver 
ixsystems_login = root 
ixsystems_password = P@ssw0rd 
ixsystems_server_hostname = 192.168.202.13 
ixsystems_transport_type = https 
ixsystems_volume_backend_name = iXsystems_TRUENAS_Storage 
ixsystems_iqn_prefix = iqn.2024-08.id.co.test
ixsystems_datastore_pool = HDD-POOL-01 
ixsystems_dataset_path = HDD-POOL-01/test 
ixsystems_vendor_name = iXsystems 
ixsystems_storage_protocol = iscsi 
image_volume_cache_enabled = true 

Reconfigure Cinder

kolla-ansible -i inventory reconfigure -t cinder

Add Volume Types on Horizon

  • Goes to Admin -> Volume -> Volume Types -> Create Volume Type
  • Create with this point :
    • Name : ixsystems-iscsi
    • Update Metadata :
      • Key : volume_backend_name
      • Value : iXsystems_TRUENAS_Storage

Try to create a volume on Horizon

  • Please use ixsystems-iscsi for Volume type
  • Verif on your pool TrueNAS
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment