Ask Your Question
0

failed to volume-attach to a instance

asked 2017-02-21 07:26:34 -0500

seachina gravatar image

updated 2017-02-22 01:37:44 -0500

I have finished openstack installation with Centos7.3.1611+newton exactly following the guide:https://docs.openstack.org/newton/install-guide-rdo/cinder.html. i can create the server and start from image and it's working, now i want attach a volume to the instance.

[root@controller ~]# nova list
+--------------------------------------+----------------------+--------+------------+-------------+---------------------+
| ID                                   | Name                 | Status | Task State | Power State | Networks            |
+--------------------------------------+----------------------+--------+------------+-------------+---------------------+
| 0d13f1ef-6c02-4688-ac0d-ee7e9fe48a95 | selfservice-instance | ACTIVE | -          | Running     | selfservice=3.3.3.5 |
+--------------------------------------+----------------------+--------+------------+-------------+---------------------+
[root@controller ~]# cinder list
+--------------------------------------+-----------+------+------+-------------+----------+-------------+
| ID                                   | Status    | Name | Size | Volume Type | Bootable | Attached to |
+--------------------------------------+-----------+------+------+-------------+----------+-------------+
| 32e01f2b-fda0-4245-a60a-6bb03bafa21b | available | test | 1    | -           | false    |             |
+--------------------------------------+-----------+------+------+-------------+----------+-------------+
[root@controller ~]# nova volume-attach selfservice-instance 32e01f2b-fda0-4245-a60a-6bb03bafa21b /dev/vdb
+----------+--------------------------------------+
| Property | Value                                |
+----------+--------------------------------------+
| device   | /dev/vdb                             |
| id       | 32e01f2b-fda0-4245-a60a-6bb03bafa21b |
| serverId | 0d13f1ef-6c02-4688-ac0d-ee7e9fe48a95 |
| volumeId | 32e01f2b-fda0-4245-a60a-6bb03bafa21b |
+----------+--------------------------------------+
[root@controller ~]#

it's looks succesful without error, now i check the cloud disk status on storage, i did not found the target:

[root@storage1 ~]# lvs
  LV                                          VG             Attr       LSize Pool Origin Data%  Meta%  Move Log Cpy%Sync Convert
  volume-32e01f2b-fda0-4245-a60a-6bb03bafa21b cinder-volumes -wi-a----- 1.00g                                                    
[root@storage1 ~]# targetcli
targetcli shell version 2.1.fb41
Copyright 2011-2013 by Datera, Inc and others.
For help on commands, type 'help'.

/> ls
o- / ......................................................................................................................... [...]
  o- backstores .............................................................................................................. [...]
  | o- block .................................................................................................. [Storage Objects: 0]
  | o- fileio ................................................................................................. [Storage Objects: 0]
  | o- pscsi .................................................................................................. [Storage Objects: 0]
  | o- ramdisk ................................................................................................ [Storage Objects: 0]
  o- iscsi ............................................................................................................ [Targets: 0]
  o- loopback ......................................................................................................... [Targets: 0]
/>

Then i try to check the cinder logs in /var/log/cinder/api.log :

2017-02-21 20:35:28.459 15057 INFO cinder.api.openstack.wsgi [req-1ffca51d-18b5-4d47-ae42-3fe60fe919e0 090c13cc34ef44d9b1c44f9ca588fa2f d512da13581f43dd8bf42a525afb830f - default default] POST http://controller:8776/v2/d512da13581f43dd8bf42a525afb830f/volumes
2017-02-21 20:35:28.463 15057 INFO cinder.api.v2.volumes [req-1ffca51d-18b5-4d47-ae42-3fe60fe919e0 090c13cc34ef44d9b1c44f9ca588fa2f d512da13581f43dd8bf42a525afb830f - default default] Create volume of 1 GB
2017-02-21 20:35:28.476 15057 INFO cinder.volume.api [req-1ffca51d-18b5-4d47-ae42-3fe60fe919e0 090c13cc34ef44d9b1c44f9ca588fa2f d512da13581f43dd8bf42a525afb830f - default default] Availability Zones retrieved successfully.
2017-02-21 20:35:28.812 15057 INFO cinder.volume.api [req-1ffca51d-18b5-4d47-ae42-3fe60fe919e0 090c13cc34ef44d9b1c44f9ca588fa2f d512da13581f43dd8bf42a525afb830f - default default] Volume created successfully.
2017-02-21 20:35:28.814 15057 INFO cinder.api.openstack.wsgi [req-1ffca51d-18b5-4d47-ae42-3fe60fe919e0 090c13cc34ef44d9b1c44f9ca588fa2f d512da13581f43dd8bf42a525afb830f - default default] http://controller:8776/v2/d512da13581f43dd8bf42a525afb830f/volumes returned with HTTP 202
2017-02-21 20:35:28.815 15057 INFO eventlet.wsgi.server [req-1ffca51d-18b5-4d47-ae42-3fe60fe919e0 090c13cc34ef44d9b1c44f9ca588fa2f d512da13581f43dd8bf42a525afb830f - default default] 1.1.1.5 "POST /v2/d512da13581f43dd8bf42a525afb830f/volumes HTTP/1.1" status: 202  len: 1064 time: 0.9083891
2017-02-21 20:35:28.852 15057 INFO cinder.api.openstack.wsgi [req-2192b1a0-cbcf-40b1-abd1-0ee4712fe9e0 090c13cc34ef44d9b1c44f9ca588fa2f d512da13581f43dd8bf42a525afb830f - default default] GET http://controller:8776/v2/d512da13581f43dd8bf42a525afb830f/volumes/32e01f2b-fda0-4245-a60a-6bb03bafa21b
2017-02-21 20:35:28.920 15057 INFO cinder.volume.api [req-2192b1a0-cbcf-40b1-abd1-0ee4712fe9e0 090c13cc34ef44d9b1c44f9ca588fa2f d512da13581f43dd8bf42a525afb830f - default default] Volume info retrieved successfully.
2017-02-21 20:35:28.927 15057 INFO cinder.api.openstack.wsgi [req-2192b1a0-cbcf-40b1-abd1-0ee4712fe9e0 090c13cc34ef44d9b1c44f9ca588fa2f d512da13581f43dd8bf42a525afb830f - default default] http://controller:8776/v2/d512da13581f43dd8bf42a525afb830f/volumes/32e01f2b-fda0-4245-a60a-6bb03bafa21b returned with HTTP 200
2017-02-21 20:35:28.928 15057 INFO eventlet.wsgi.server [req-2192b1a0-cbcf-40b1-abd1-0ee4712fe9e0 090c13cc34ef44d9b1c44f9ca588fa2f d512da13581f43dd8bf42a525afb830f - default default] 1.1.1.5 "GET /v2/d512da13581f43dd8bf42a525afb830f/volumes/32e01f2b-fda0-4245-a60a-6bb03bafa21b HTTP/1.1" status: 200  len: 1237 time: 0.1092041
2017-02-21 20:35:41.201 15049 INFO cinder.api.openstack.wsgi [req-29a8fa7b-fe92-4035-98fd-0f9ab6c3fad9 090c13cc34ef44d9b1c44f9ca588fa2f d512da13581f43dd8bf42a525afb830f - default default] GET http://controller:8776/v2/d512da13581f43dd8bf42a525afb830f/volumes/detail
2017-02-21 20:35:41.275 15049 INFO cinder.volume.api [req-29a8fa7b-fe92-4035-98fd-0f9ab6c3fad9 090c13cc34ef44d9b1c44f9ca588fa2f d512da13581f43dd8bf42a525afb830f - default default] Get all volumes ...
(more)
edit retag flag offensive close merge delete

Comments

Two suggestions. 1: I don't know what Cinder wants with /var/lib/nova; search the Cinder configuration for this string and correct it if necessary. 2: If /var/lib/nova is legitimate, perhaps you have an SELinux issue. Cinder is supposed to create the directory as root.

Bernd Bausch gravatar imageBernd Bausch ( 2017-02-22 05:06:15 -0500 )edit

My cinder.conf has a config variable named lock_path which "Defaults to environment variable OSLO_LOCK_PATH". Could be a candidate.

Bernd Bausch gravatar imageBernd Bausch ( 2017-02-22 05:08:38 -0500 )edit

1 answer

Sort by ยป oldest newest most voted
0

answered 2017-02-22 05:59:14 -0500

seachina gravatar image

thanks for your kindly answer, i found the reason is that the lock_path=/var/lib/nova/tmp in /etc/nova/nova.conf is wrong,i have changed it to lock_path=/var/lib/cinder/tmp, and now it's working,thank you!

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower

Stats

Asked: 2017-02-21 07:25:15 -0500

Seen: 94 times

Last updated: Feb 22 '17