Failed to attach volume to instance [closed]
I've just installed OpenStack Ocata (via RDO), then I created a volume, an instance, and attached the volume to the instance.
After a sudden power surge, the controller got rebooted. Now, the volume is not attached to the instance anymore, and I can't attach it using the following command (or the web interface):
nova volume-attach 5f3033e1-55a3-4962-bd5e-d242462a6380 2567c36c-7897-43ea-b27a-bad2d00ec105 auto
I tried to create a new volume and managed to attach it succesfully. For testing purposes, I forced the controller to shutdown, but the same problem happened again.
Cinder's volume.log shows the following error:
2017-05-15 09:47:53.604 22417 INFO cinder.volume.targets.lio [req-329b83a5-9396-4ed6-aba2-d8fce8bf3252 acfeb5bc5d6b470a9a0c2c9541a45778 e5a510637914482eadef78c8a6bd5e3a - default default] Creating iscsi_target for volume: volume-2567c36c-7897-43ea-b27a-bad2d00ec105
2017-05-15 09:47:54.189 22417 ERROR cinder.volume.targets.lio [req-329b83a5-9396-4ed6-aba2-d8fce8bf3252 acfeb5bc5d6b470a9a0c2c9541a45778 e5a510637914482eadef78c8a6bd5e3a - default default] Failed to create iscsi target for volume id:volume-2567c36c-7897-43ea-b27a-bad2d00ec105.
2017-05-15 09:47:54.189 22417 ERROR cinder.volume.targets.lio Traceback (most recent call last):
2017-05-15 09:47:54.189 22417 ERROR cinder.volume.targets.lio File "/usr/lib/python2.7/site-packages/cinder/volume/targets/lio.py", line 127, in create_iscsi_target
2017-05-15 09:47:54.189 22417 ERROR cinder.volume.targets.lio self._execute(*command_args, run_as_root=True)
2017-05-15 09:47:54.189 22417 ERROR cinder.volume.targets.lio File "/usr/lib/python2.7/site-packages/oslo_concurrency/lockutils.py", line 271, in inner
2017-05-15 09:47:54.189 22417 ERROR cinder.volume.targets.lio return f(*args, **kwargs)
2017-05-15 09:47:54.189 22417 ERROR cinder.volume.targets.lio File "/usr/lib/python2.7/site-packages/cinder/volume/targets/lio.py", line 52, in _execute
2017-05-15 09:47:54.189 22417 ERROR cinder.volume.targets.lio return utils.execute(*args, **kwargs)
2017-05-15 09:47:54.189 22417 ERROR cinder.volume.targets.lio File "/usr/lib/python2.7/site-packages/cinder/utils.py", line 123, in execute
2017-05-15 09:47:54.189 22417 ERROR cinder.volume.targets.lio return processutils.execute(*cmd, **kwargs)
2017-05-15 09:47:54.189 22417 ERROR cinder.volume.targets.lio File "/usr/lib/python2.7/site-packages/oslo_concurrency/processutils.py", line 400, in execute
2017-05-15 09:47:54.189 22417 ERROR cinder.volume.targets.lio cmd=sanitized_cmd)
2017-05-15 09:47:54.189 22417 ERROR cinder.volume.targets.lio ProcessExecutionError: Unexpected error while running command.
2017-05-15 09:47:54.189 22417 ERROR cinder.volume.targets.lio Command: sudo cinder-rootwrap /etc/cinder/rootwrap.conf cinder-rtstool create /dev/cinder-volumes/volume-2567c36c-7897-43ea-b27a-bad2d00ec105 iqn.2010-10.org.openstack:volume-2567c36c-7897-43ea-b27a-bad2d00ec105 nBU4v8TsSCU5H6di7dYC f9TdkwtKXbUWgSR8 False -p3260 -a192.168.0.208
2017-05-15 09:47:54.189 22417 ERROR cinder.volume.targets.lio Exit code: 1
2017-05-15 09:47:54.189 22417 ERROR cinder.volume.targets.lio Stdout: u''
2017-05-15 09:47:54.189 22417 ERROR cinder.volume.targets.lio Stderr: u'Traceback (most recent call last):\n File "/bin/cinder-rtstool", line 10, in <module>\n sys.exit(main())\n File "/usr/lib/python2.7/site-packages/cinder/cmd/rtstool.py", line 293, in main\n **optional_args)\n File "/usr/lib/python2.7/site-packages/cinder/cmd/rtstool.py", line 61, in create ...
Are you using Packstack with LVM as Cinder backend and a loopback device as physical volume? If so, my guess is that something in LVM broke during the outage. Do you still have the LVM volume that implements the Cinder volume?
Is the volume in an error state? What's the output of cinder list? You could first try to do a
cinder reset-state --attach-status detached
and see if that works. If not, you'll probably have to manipulate the database.@Bernd Yes, I'm using the Packstack with LVM as Cinder backend and a loopback device as PV. I still have the LVM volume, but I made some alterations.
@eblock No, everything seems right with the volume. Cinder list shows it as available.
I think I discovered something about the problem. Part of my cinder-volumes was inside another volume group (cl). I think I'll have to reformat the controller.
Is this issue fixed?