Bug 1687846 - Deleting a disk of RHV vm via API throws a 405 error in the response
Summary: Deleting a disk of RHV vm via API throws a 405 error in the response
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat CloudForms Management Engine
Classification: Red Hat
Component: Providers
Version: 5.10.0
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: GA
: 5.10.2
Assignee: Boriso
QA Contact: Parthvi Vala
Red Hat CloudForms Documentation
URL:
Whiteboard:
Depends On: 1666593
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-03-12 13:31 UTC by Satoe Imaishi
Modified: 2019-04-02 07:46 UTC (History)
13 users (show)

Fixed In Version: 5.10.2.1
Doc Type: If docs needed, set a value
Doc Text:
Clone Of: 1666593
Environment:
Last Closed: 2019-04-02 07:46:17 UTC
Category: ---
Cloudforms Team: RHEVM
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2019:0694 0 None None None 2019-04-02 07:46:21 UTC

Comment 3 CFME Bot 2019-03-12 13:37:48 UTC
New commit detected on ManageIQ/manageiq-providers-ovirt/hammer:

https://github.com/ManageIQ/manageiq-providers-ovirt/commit/292239cc99e49cebe0b84e68ef85c36fa24b3e70
commit 292239cc99e49cebe0b84e68ef85c36fa24b3e70
Author:     Adam Grare <agrare>
AuthorDate: Mon Mar 11 10:03:03 2019 -0400
Commit:     Adam Grare <agrare>
CommitDate: Mon Mar 11 10:03:03 2019 -0400

    Merge pull request #348 from borod108/bugs/fix1666593

    Fix deleting a disk from VM

    (cherry picked from commit c4063dd78b9c0fac8131ae51d68d92fb994de0be)

    Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1687846

 app/models/manageiq/providers/redhat/infra_manager/ovirt_services/strategies/v4.rb | 12 +-
 spec/models/manageiq/providers/redhat/infra_manager/ovirt_services/strategies/v4_spec.rb | 45 +-
 2 files changed, 54 insertions(+), 3 deletions(-)

Comment 4 Parthvi Vala 2019-03-20 06:41:46 UTC
NOT FIXED. Tested on 5.10.2.1.20190318201733_b8aa100.

Steps taken to test:
1. Create a VM.
2. Add a disk to VM and not disk ID
3. Send request: POST /api/requests
Query: {
	"action": "create",
	"options": {
		"src_ids": [
			"32"
		],
		"request_type": "vm_reconfigure",
		"disk_remove": [
			{
				"disk_name": "3edb81b3-1d71-44d7-8cae-06c74b07996f",
				"delete_backing": false
			}
		]
	},
	"auto_approve": false
}

Response: {
  "href": "https://<ip_address>/api/requests/6",
  "id": "6",
  "description": "VM Reconfigure for: test_pvala_rhv_disk_vm - Remove Disks: 1",
  "approval_state": "approved",
  "type": "VmReconfigureRequest",
  "created_on": "2019-03-20T06:37:15Z",
  "updated_on": "2019-03-20T06:37:37Z",
  "fulfilled_on": "2019-03-20T06:37:37Z",
  "requester_id": "1",
  "requester_name": "Administrator",
  "request_type": "vm_reconfigure",
  "request_state": "finished",
  "message": "Error: no disk with the name 3edb81b3-1d71-44d7-8cae-06c74b07996f is attached to the vm: test_pvala_rhv_disk_vm",
  "status": "Error",
  "options": {
    "src_ids": [
      "32"
    ],
    "request_type": "vm_reconfigure",
    "disk_remove": [
      {
        "disk_name": "3edb81b3-1d71-44d7-8cae-06c74b07996f",
        "delete_backing": false
      }
    ],
    "executed_on_servers": [
      1,
      1
    ],
    "delivered_on": "2019-03-20T06:37:32.925Z"
  },
  "userid": "admin",
  "source_id": null,
  "source_type": null,
  "destination_id": null,
  "destination_type": null,
  "tenant_id": "1",
  "service_order_id": null,
  "process": true,
  "cancelation_status": null,
  "actions": [
    ...
  ]
}

Result:
Request finished with error: Error: no disk with the name 3edb81b3-1d71-44d7-8cae-06c74b07996f is attached to the vm: test_pvala_rhv_disk_vm
I checked the VM, disk is still present.

Comment 5 Boriso 2019-03-20 07:54:31 UTC
Hi!
Please provide a reproduction environment.
Also - 3edb81b3-1d71-44d7-8cae-06c74b07996f looks like an id, not a disk name.

Comment 8 Parthvi Vala 2019-03-20 13:06:08 UTC
Hey Boris,

I checked with the names that you provided and it worked. I'll open a BZ for disk guid.
Changing it to Verified.

Thanks for your help.

-Parthvi

Comment 10 errata-xmlrpc 2019-04-02 07:46:17 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2019:0694


Note You need to log in before you can comment on or make changes to this bug.