Feature #15939

Add ability to edit default values for volumes and nics for compute resource and compute profile

Added by Ivan Necas over 1 year ago. Updated 10 months ago.

Status:New
Priority:Normal
Assigned To:-
Category:Compute resources
Target version:Team Marek backlog
Difficulty:medium Bugzilla link:1339172
Found in release: Pull request:
Story points-
Velocity based estimate-

Description

Cloned from https://bugzilla.redhat.com/show_bug.cgi?id=1339172

Description of problem:
Impossible to change default value 'thin' for new volumes in Vmware compute profile

How reproducible:
Always

Steps to Reproduce:
1. Check that 'thin' value is set to false for new_volumes section:

$ curl -s -X GET -H "Authorization: Basic xxxxxxxxxxxxxx" -H "Accept:application/json" -H "Content-Type: application/json" https://foreman.example.com.com/api/v2/compute_profiles/4|python -mjson.tool
{
    "compute_attributes": [
        {
            "id": 1,
# ...
            "vm_attrs": {

                "volumes_attributes": {
                    "0": {
                        "_delete": "",
                        "datastore": "my-store-1",
                        "eager_zero": "false",
                        "name": "Hard disk",
                        "size_gb": "50",
                        "thin": "false" 
                    },
                    "new_volumes": {
                        "_delete": "",
                        "datastore": "my-store-1",
                        "eager_zero": "false",
                        "name": "Hard disk",
                        "size_gb": "10",
                        "thin": "true"  <----------
                    }
                }
            }
        }
    ],
2. Update 'thin' field:

curl -s -X PUT -H "Authorization: Basic xxxxxxxxxxxxxxx" -H "Accept:application/json" -H "Content-Type: application/json" https://foreman.example.com/api/v2/compute_resources/1 -d '{"compute_attributes":[{"id":1,"name":"1CPUsand2048MBmemory","compute_resource_id":1,"compute_resource_name":"my-resource","compute_profile_id":4,"compute_profile_name":"my-profile","vm_attrs":{"volumes_attributes":{"new_volumes":{"datastore":"my-store-1","name":"Harddisk","size_gb":"30",

"thin":"false",  <-----

"eager_zero":"false","_delete":""}}}}]}'

Actual results:
"thin" is still "true" 

Expected results:
"thin" should be changed to "false"

History

#1 Updated by Ivan Necas over 1 year ago

  • Subject changed from Impossible to change default value 'thin' for new volumes in Vmware compute profile to Impossible to change default value 'thin' for new volumes in Vmware compute profile
  • Target version set to Team Ivan Iteration 1

#2 Updated by Ivan Necas over 1 year ago

  • Status changed from New to Assigned
  • Assigned To set to Ivan Necas

#3 Updated by Ivan Necas over 1 year ago

  • Target version changed from Team Ivan Iteration 1 to Team Ivan Iteration 2

#4 Updated by Ivan Necas over 1 year ago

  • Status changed from Assigned to New

#5 Updated by Shimon Shtein over 1 year ago

  • Assigned To changed from Ivan Necas to Shimon Shtein

#6 Updated by Ivan Necas over 1 year ago

  • Target version changed from Team Ivan Iteration 2 to Team Ivan Iteration 3

#7 Updated by Ivan Necas about 1 year ago

  • Target version changed from Team Ivan Iteration 3 to Team Ivan Iteration 4

#8 Updated by Ivan Necas about 1 year ago

  • Target version changed from Team Ivan Iteration 4 to Team Ivan Iteration 5

#9 Updated by Ivan Necas about 1 year ago

  • Target version changed from Team Ivan Iteration 5 to Team Ivan backlog

Waiting for prioritization response on BZ

#10 Updated by Dominic Cleal about 1 year ago

  • Category changed from Compute resources to Compute resources - VMware
  • Status changed from New to Assigned

#11 Updated by Ivan Necas about 1 year ago

  • Status changed from Assigned to New
  • Target version deleted (Team Ivan backlog)

#12 Updated by Shimon Shtein about 1 year ago

  • Tracker changed from Bug to Feature
  • Subject changed from Impossible to change default value 'thin' for new volumes in Vmware compute profile to Add ability to edit volumes and nics template for compute resource
  • Category changed from Compute resources - VMware to Compute resources
  • Difficulty set to medium

Right now we are generating a hidden html template from static default data, that gets cloned each time we press the "add volume/nic" button.
I suggest exposing this template, so the user could update it. This way the template that will be copied will be generated using default previously set by the user.

#13 Updated by Tomáš Strachota 10 months ago

  • Subject changed from Add ability to edit volumes and nics template for compute resource to Add ability to edit default values for volumes and nics for compute resource and compute profile
  • Assigned To deleted (Shimon Shtein)
  • Target version set to Team Marek backlog

Exposing the template for modifications brings high risk of users breaking the template (and rest of the UI) by either typo or misconfiguration. Rather than that I'd suggest to change the template to use default data from serialized json saved in our db for each compute resource. This default values would be editable via simple UI that can reuse the templates. It would be good to allow for defining default values for all compute fields, not only volumes and nics.

BTW the "new_volumes" node that we save in compute attributes isn't used anywhere and should be removed. It comes from the aforementioned hidden template. The only reason it gets saved is that we don't filter incoming data from the form.

I removed Shim from "assigned to" since the feature isn't under active development. Feel free to assign it back if you work on it.

Also available in: Atom PDF