Bug 1618517

Summary: unable to add disk to vm via rest-api vm reconfiguration on vmware [request backport from existing commit]
Product: Red Hat CloudForms Management Engine Reporter: Reartes Guillermo <greartes>
Component: APIAssignee: Gregg Tanzillo <gtanzill>
Status: CLOSED CURRENTRELEASE QA Contact: Parthvi Vala <pvala>
Severity: low Docs Contact:
Priority: high    
Version: 5.8.2CC: agrare, mkourim, obarenbo, simaishi, smallamp
Target Milestone: GAKeywords: TestOnly, ZStream
Target Release: 5.10.0   
Hardware: x86_64   
OS: Linux   
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1623573 1623574 (view as bug list) Environment:
Last Closed: 2019-02-12 16:49:52 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Bug Depends On:    
Bug Blocks: 1623573, 1623574    

Description Reartes Guillermo 2018-08-16 20:13:22 UTC
Description of problem:

I cannot reconfigure vm via rest-api to vmware, i am getting:

"Error: add_disk_config_spec: Disk size is required to add a new disk."

Searching for the error i found this commit:

COMMIT: https://github.com/ManageIQ/manageiq-api/pull/312

This commit says it is related to the issue.
Please check if a backport is needed.

Version-Release number of selected component (if applicable):
* vCenter 6.5

How reproducible:

Steps to Reproduce:
1. execute a rest-api to reconfigure vm
2. it will fail on vmware

Actual results:
the request ends in error:
"Error: add_disk_config_spec: Disk size is required to add a new disk."

Expected results:
The request should end ok.

Additional info 1:

Example JSON:

json_data_disk = {
            "action"  =>"create",
            "options" => {
                        "src_ids" => [
                        "request_type" => "vm_reconfigure",
                        "disk_add" => [
                                        :disk_size_in_mb   => 20480,
                                        #:disk_size         => 20480,
                                        :sync              => true,
                                        #:disk_name         => "new_disk4",
                                        :datastore         => "XXX_LUN_NAME",
                                        :persistent        => true,
                                        :thin_provisioned  => false,
                                        :dependent         => true,
                                        :bootable          => false
            "auto_approve" => false

Additional info 2:

Fails on CFME (vCenter 6.5)

Additional info 3:

On RHV 4.1 (my lab) (CFME it does work and adds the disk. It still does not honor the selected datastore, but that is another separate issue.

Additional info 4:

I could not test this with CF 4.6.x on VMWare.

It a backport is needed for 4.5, maybe it is needed for 4.6 too.

Thanks in advance.

Comment 4 Parthvi Vala 2018-11-13 10:16:16 UTC
FIXED. Verified on with vmware (vCenter 6.7).

POST /api/requests
    "action": "create",
    "options": {
        "src_ids": ["92"],
        "request_type": "vm_reconfigure",
        "disk_add": [
                "disk_size_in_mb": 20480,
                "sync": true,
                "datastore": "NFS_Datastore_1",
                "persistent": true,
                "thin_provisioned": false,
                "dependent": true,
                "bootable": false
    "auto_approve": false

GET /api/requests/:id

	"href": "https://<ip_address>/api/requests/:id",
	"id": "3",
	"description": "VM Reconfigure for: pvala_vm_001 - Add Disks: 1",
	"approval_state": "approved",
	"type": "VmReconfigureRequest",
	"created_on": "2018-11-13T10:00:35Z",
	"updated_on": "2018-11-13T10:05:17Z",
	"fulfilled_on": "2018-11-13T10:05:17Z",
	"requester_id": "1",
	"requester_name": "Administrator",
	"request_type": "vm_reconfigure",
	"request_state": "finished",
	"message": "VM Reconfigure complete",
	"status": "Ok",
	"options": {
		"src_ids": [
		"request_type": "vm_reconfigure",
		"disk_add": [
				"disk_size_in_mb": 20480,
				"sync": true,
				"disk_name": "New Disk",
				"datastore": "NFS_Datastore_1",
				"persistent": true,
				"thin_provisioned": false,
				"dependent": true,
				"bootable": false
		"executed_on_servers": [
		"delivered_on": "2018-11-13T10:00:48.109Z"
	"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": [