12. OpenStack Cinder Driver¶
The TrueNAS® Cinder driver for OpenStack provides an iSCSI (Block) Storage service for OpenStack. Detection and management of connected TrueNAS® iSCSI resources is available from within the OpenStack web interface.
12.1. Requirements¶
- A TrueNAS® 11.0 or newer system to provide storage.
- A computer running the
Newton release
of OpenStack or newer, with these minimum hardware requirements:
- 4 GiB of RAM
- 4-core CPU
- 40 GiB storage disk
12.2. Installation¶
The Cinder driver is packaged as a .zip file for simple
download and extraction. To obtain the driver, please contact
iXsystems Customer Support at
truenas-support@ixsystems.com.
Log in to a console on the OpenStack system. Switch user to stack
with su - stack. Extract the contents of the Cinder driver
.zip file to /opt/stack/cinder/cinder/volume/drivers/.
Note
Be sure the stack user has ownership or permissions for all the extracted Cinder files.
Log in to the TrueNAS® system and
create a new dataset named cinder.
Note the TrueNAS® IP address, root username, and password. Locate the
base name of the iSCSI target by navigating to
Sharing → Block(iSCSI) → Target → Global Configuration → Base Name.
This information is needed to configure the Cinder driver before it
can be used in the OpenStack interface.
12.3. Configuration¶
On the OpenStack computer, edit /etc/cinder/cinder.conf. Some
sections of this file must be edited and some user-defined parameters
must be added.
Modify the existing lines in cinder.conf to these values:
default_volume_type = ixsystems-iscsi
enabled_backends = ixsystems-iscsi, lvmdriver-1
Table 12.3.1 explains the added parameters and their possible values:
| Parameter | Description | Possible Values |
|---|---|---|
| iscsi_helper | iSCSI target user-land tool; the default is recommended | tgtadm (default), lioadm, scstadmin, iscsictl, ietadm, fake (testing only) |
| volume_dd_blocksize | Default block size used when copying or clearing volumes | Block size string value: 512, 1M |
| volume_driver | Driver used in volume creation; provide the path to the driver | Default path for the iX driver: cinder.volume.drivers.ixsystems.iscsi.FreeNASISCSIDriver |
| ixsystems_login | Username of the connected host | |
| ixsystems_password | Password of the connected host | |
| ixsystems_server_hostname | IP address of the host | |
| ixsystems_volume_backend_name | Backend name for a given driver implementation | The default is iXsystems_FREENAS_Storage |
| ixsystems_iqn_prefix | Base name of the iSCSI target | User defined. Found in the web interface by navigating to
Sharing -> Block(iscsi) -> Target Global Configuration -> Base Name |
| ixsystems_datastore_pool | Name of the dataset on the connected system | If the cinder dataset is created, the value is cinder-tank |
| ixsystems_vendor_name | iXsystems | |
| ixsystems_storage_protocol | iscsi |
Here is an example of typical additional parameter settings for a
TrueNAS® system at IP address 10.3.1.81:
[ixsystems-iscsi]
iscsi_helper = tgtadm
volume_dd_blocksize = 512
volume_driver = cinder.volume.drivers.ixsystems.iscsi.FreeNASISCSIDriver
ixsystems_login = root
ixsystems_password = thisisdummypassword
ixsystems_server_hostname = 10.3.1.81
ixsystems_volume_backend_name = iXsystems_FREENAS_Storage
ixsystems_iqn_prefix = iqn.2005-10.org.freenas.ctl
ixsystems_datastore_pool = cinder-tank
ixsystems_vendor_name = iXsystems
ixsystems_storage_protocol = iscsi
Tip
The
OpenStack documentation
also provides examples of cinder.conf configurations.
Restart the OpenStack computer to reload cinder.conf and
initialize the Cinder service properly. After this reboot, the Cinder
service can be restarted manually:
# /usr/local/bin/cider-volume --config-file /etc/cinder/cinder.conf & echo $! >/opt/stack/status/stack/c-vol.pid; fg || echo "c-vol failed to start" | tee "/opt/stack/status/stack/c-vol.failure".
The Cinder driver is now available in the OpenStack web interface.
Open a web browser, go to the IP address of the OpenStack system, and
log in with the OpenStack user name and password. Click
Connect. Navigate from
Admin → System → Volumes → Volume Types
and click Create Volume Type. The window shown in
Figure 12.3.1 appears.
Fig. 12.3.1 Creating the ixsystems-iscsi Volume Type
Enter ixsystems-iscsi in the Name field and ensure the Public box is checked. An optional Description field is also available. Click Create Volume Type to create the volume type. The list is automatically refreshed when the task is finished.
12.4. Using the Cinder Driver¶
Cinder is used to manage volumes in the Project and Admin sections of the OpenStack interface.
12.4.1. Managing Volumes with Cinder by Project¶
The
Project → Compute → Volumes
section manages volumes on a per-project basis. To change projects,
click the project name dropdown menu displayed in the upper left
area of the interface, next to the openstack logo.
Figure 12.4.1 shows an example of the Project/Compute/Volumes interface with the Volumes tab visible:
Fig. 12.4.1 Interface for Managing Project Volumes
Every volume in the project displays in a reference list. The list is sortable by any of the column titles. Users can also type custom filters to locate specific items. Options to Create, Accept Transfer of a volume from another project, and Delete Volumes are available.
An existing volume can be modified by checking the checkbox next to the volume Name, then opening the Actions pulldown menu. Table 12.4.1 lists the action, the equivalent cinder CLI command, and a description of the configurable settings:
| Action | Configurables |
|---|---|
| Edit Volume | Adjust name and description of a volume, or make a volume Bootable |
| Extend Volume | Enter a new size in GiB |
| Manage Attachments | View and adjust volume attachment to instances |
| Create Snapshot | Enter a snapshot name and description; snapshot limits are shown |
| Change Volume Type | Choose a new type and migration policy |
| Upload to Image | Enter an image name and choose a disk format: QCOW2, Raw, VDI, or VMDK |
| Create Transfer | Enter recipient project name |
| Update Metadata | Move items into the existing metadata column or create a custom metadata key |
12.4.1.1. Project Volume Snapshots¶
Any snapshot of a volume displays in the Volume Snapshots tab, seen in Figure 12.4.2:
Fig. 12.4.2 Project Volume Snapshots Tab
As with the other interface elements, the list can be sorted and filtered. The Actions drop-down menu has options to create a volume from an existing snapshot, edit a snapshot name and description, delete snapshots, and update snapshot metadata.
12.4.2. Administering All Volumes with Cinder¶
Cinder functions within the Admin section manage
volumes, volume types, and volume snapshots for all projects on
the system. Navigate from
Admin → System → Volumes
to see these management tabs. Every created item is displayed in the
master list regardless of project. This list can be sorted or filtered
as needed.
12.4.2.1. Managing Volumes¶
Figure 12.4.3 shows the Volumes tab:
Fig. 12.4.3 OpenStack Volumes Tab
Table 12.4.2 shows the different options, the cinder CLI equivalents, and a description of the configurable elements.
Tip
Volumes can be managed or deleted in this section, but not
created. Volume creation is handled in the
Project → Compute → Volumes tab.
| Action | Configurables |
|---|---|
| Manage Volumes | Type the volume identifier, host, and volume name to make it visible in OpenStack; other configurable elements are Volume Name, Description, Metadata, Volume Type, Availability Zone, and Bootable |
| Delete Volumes | Warning: volumes deleted here cannot be recovered |
| Update Volume Status | Select a new status from the dropdown menu; volume status is normally set automatically |
| Unmanage Volume | Unmanaging a volume makes it invisible in OpenStack, but does not delete it |
| Migrate Volume | Choose a new Destination Host from the dropdown menu; there is also an option to Force Host Copy, which bypasses driver optimizations |
| Update Metadata | Choose items to move to the Existing Metadata column; custom keys can also be added |
12.4.2.2. Manage Volume Types¶
Figure 12.4.4
shows how all created volume types are listed in this tab. If the
cinder.conf file was edited as shown above in the Cinder
driver installation, two types are visible:
ixsystems-iscsi and lvmdriver-1.
Fig. 12.4.4 OpenStack Volume Types Tab
A number of actions can be applied to either volume type, as Table 12.4.3 shows:
| Action | Configurables |
|---|---|
| Create Volume Type | Name, description, and visible to “Public” |
| Delete Volume Types | Warning: action is permanent |
| Create QoS Spec | Provide a name and consumer for the new Quality of Service spec; choose back-end to associate the policy with Cinder |
| Create Encryption | Type a provider and control location; custom cipher and key size can also be designated |
| View/Create Extra Specs | Click Create to enter and save a new key/value pair |
| Manage QoS Spec Association | Select a QoS spec from the drop-down menu |
| Edit Volume Type | Modify the volume type name, description, and public fields |
| Update Metadata | Add new metadata items to the volume type; custom keys can be created |
12.4.2.3. Manage Volume Snapshots¶
This tab is very similar to managing snapshots of a single project. The only difference is that snapshots from all projects are visible in the list. Figure 12.4.5 shows an example:
Fig. 12.4.5 Manage All Projects Volume Snapshots
Options to Delete, Update Status, and Update Metadata for each listed snapshot are available.