Troubleshooting your Block Storage Configuration
This section is intended to help solve some basic and common errors that are encountered
during setup and configuration of the Cinder block storage service. The focus here is on
failed creation of volumes. The most important thing to know is where to look in case of a
failure.
There are two log files that are especially helpful for solving volume creation failures,
the cinder-api log and the cinder-volume log. The cinder-api log is useful for determining if you have endpoint or
connectivity issues. If you send a request to create a volume and it fails, it's a good idea
to look in the cinder-api log first and see if the
request even made it to the Cinder service. If the request is logged and there are no errors
or trace-backs, then you can check the cinder-volume log for errors or trace-backs.
Create commands are listed in the cinder-api log.
Here are some common issues discovered during configuration, and some suggested solutions
.
Isusues with state_path and volumes_dir
settings.
Cinder uses tgtd as the default iscsi helper and implements
persistent targets. This means that in the case of a tgt restart or even a node
reboot your existing volumes on that node will be restored automatically with
their original IQN.
In order to make this possible the iSCSI target information needs to be stored
in a file on creation that can be queried in case of restart of the tgt daemon.
By default, Cinder uses a state_path variable, which if
installing with Yum or APT should be set to
/var/lib/cinder/. The next part is the
volumes_dir variable, by default this just simply appends
a "volumes" directory to the state_path.
The result is a file-tree /var/lib/cinder/volumes/.
While this should all be handled by the installer, it can go wrong. If you are
having trouble creating volumes and this directory does not exist you should see
an error message in the cinder-volume
log indicating that the volumes_dir doesn't exist, and it
should give you information to specify what path exactly it was looking
for.
The persistent tgt include file.
Along with the volumes_dir mentioned above, the iSCSI
target driver also needs to be configured to look in the correct place for the
persist files. This is a simple entry in /etc/tgt/conf.d,
and you should have created this when you went through the install guide. If you
haven't or you're running into issues, verify that you have a file
/etc/tgt/conf.d/cinder.conf.
If the file is not there, you can create with the following
command:
sudo sh -c "echo 'include /var/lib/cinder/volumes/*' >> /etc/tgt/conf.d/cinder.conf"
No sign of attach call in the cinder-api log.
This is most likely going to be a minor adjustment to your
nova.conf file. Make sure that your
nova.conf has the following
entry:
volume_api_class=nova.volume.cinder.API
Make certain that you explicitly set enabled_apis
because the default will include
osapi_volume:
enabled_apis=ec2,osapi_compute,metadata
Failed to create iscsi target error in the
cinder-volume.log file.
2013-03-12 01:35:43 1248 TRACE cinder.openstack.common.rpc.amqp ISCSITargetCreateFailed: Failed to create iscsi target for volume volume-137641b2-af72-4a2f-b243-65fdccd38780.
You may see this error in cinder-volume.log after trying
to create a volume that is 1 GB. To fix this issue:
Change content of the /etc/tgt/targets.conf from "include
/etc/tgt/conf.d/*.conf" to: include /etc/tgt/conf.d/cinder_tgt.conf:
include /etc/tgt/conf.d/cinder_tgt.conf
include /etc/tgt/conf.d/cinder.conf
default-driver iscsi
Then restart tgt and cinder-* services so they pick up the
new configuration.