volume_attach action registers volume attachment even on failure
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Cinder |
Invalid
|
Undecided
|
krishna | ||
OpenStack Compute (nova) |
Invalid
|
Undecided
|
Unassigned |
Bug Description
When attaching volumes to instances, if the volume attachment fails, it is still noted as successful by the system in some cases.
This is the information reflected when requesting the details of a servers volume attachments
http://
/v2/{tenant_
Show volume attachment details
In the example, I have 2 test servers and 1 test volume.
I attach the volume to test_server1 and it is successful (though please see: https:/
Next, I try to attach the same volume to test_server2.
This call fails as expected, but the mountpoint / attachment is still registered.
To demonstrate, I repeat the previous call. It fails again, but this time due to the requested mountpoint being in-use vs. the volume being attached.
I next make a call to list the volume attachments for test_server2. It lists volume attachments even though there are none and the Cinder api server does not register this.
description: | updated |
Changed in cinder: | |
status: | New → Confirmed |
Changed in cinder: | |
status: | Confirmed → New |
Changed in cinder: | |
status: | New → Confirmed |
Changed in nova: | |
assignee: | nobody → Srikar Deshmukh (srikardeshmukh) |
assignee: | Srikar Deshmukh (srikardeshmukh) → nobody |
Changed in cinder: | |
assignee: | nobody → krishna (leburu-reddy) |
# Listing our test servers 192.168. 0.5:5000/ v2.0 list ------- ------- ------- ------- ----+-- ------- -----+- ------- +------ ------+ ------- ------+ ------- ------- ----+ ------- ------- ------- ------- ----+-- ------- -----+- ------- +------ ------+ ------- ------+ ------- ------- ----+ 8a88-45c3- 83d0-a2ac5e7fb2 32 | test_server1 | ACTIVE | - | Running | private=10.0.0.2 | a218-46b8- a714-c96e9cff20 66 | test_server2 | ACTIVE | - | Running | private=10.0.0.3 | ------- ------- ------- ------- ----+-- ------- -----+- ------- +------ ------+ ------- ------+ ------- ------- ----+
nova --os-auth-url=http://
+------
| ID | Name | Status | Task State | Power State | Networks |
+------
| 9991ead8-
| 44d13e4b-
+------
# Listing our test volume erlking- dev:~/git/ rannsaka$ cinder list ------- ------- ------- ------- ----+-- ------- --+---- ------- ---+--- ---+--- ------- ---+--- ------- +------ ------- + ------- ------- ------- ------- ----+-- ------- --+---- ------- ---+--- ---+--- ------- ---+--- ------- +------ ------- + ac6b-477e- 84f9-bbe62da29a 6a | available | test_volume1 | 1 | lvmdriver-1 | false | | ------- ------- ------- ------- ----+-- ------- --+---- ------- ---+--- ---+--- ------- ---+--- ------- +------ ------- +
pcrews@
+------
| ID | Status | Display Name | Size | Volume Type | Bootable | Attached to |
+------
| 41dcbd0b-
+------
# Attaching volume to test_server1 on /dev/vdc erlking- dev:~/git/ rannsaka$ nova --os-auth-url=http:// 192.168. 0.5:5000/ v2.0 volume-attach 9991ead8- 8a88-45c3- 83d0-a2ac5e7fb2 32 41dcbd0b- ac6b-477e- 84f9-bbe62da29a 6a /dev/vdc ----+-- ------- ------- ------- ------- ------- -+ ----+-- ------- ------- ------- ------- ------- -+ ac6b-477e- 84f9-bbe62da29a 6a | 8a88-45c3- 83d0-a2ac5e7fb2 32 | ac6b-477e- 84f9-bbe62da29a 6a | ----+-- ------- ------- ------- ------- ------- -+
pcrews@
+------
| Property | Value |
+------
| device | /dev/vdc |
| id | 41dcbd0b-
| serverId | 9991ead8-
| volumeId | 41dcbd0b-
+------
# Attaching same volume to test_server2 on /dev/vdb erlking- dev:~/git/ rannsaka$ nova --os-auth-url=http:// 192.168. 0.5:5000/ v2.0 volume-attach 44d13e4b- a218-46b8- a714-c96e9cff20 66 41dcbd0b- ac6b-477e- 84f9-bbe62da29a 6a /dev/vdb e920-425d- 9c7a-e1b6b78b3e ea)
pcrews@
ERROR (BadRequest): Invalid volume: status must be 'available' (HTTP 400) (Request-ID: req-0eed3b96-
# Second request repeating the previous one - NOTE the device path is now in-use: erlking- dev:~/git/ rannsaka$ nova --os-auth-url=http:// 192.168. 0.5:5000/ v2.0 volume-attach 44d13e4b- a218-46b8- a714-c96e9cff20 66 41dcbd0b- ac6b-477e- 84f9-bbe62da29a 6a /dev/vdb 5fa8-4f3d- 8880-ea399aecbf d1)
pcrews@
ERROR (Conflict): The supplied device path (/dev/vdb) is in use. (HTTP 409) (Request-ID: req-708dcc24-
# Making a curl call to get detail volume attachments for test_server2 to demonstrate that the system now considers the volume to be mounted, even though cinder does not track the same information erlking- dev:~/git/ rannsaka$ curl -i 'http:// 192.168. 0.5:8774/ v2/c8d54cca25a9 496ab264be0c2d9 6e567/servers/ 44d13e4b- a218-46b8- a714-c96e9cff20 66/os-volume_ attachments' -X GET -H "Accept: application/json" -H...
pcrews@