Project

General

Profile

Actions

Feature #15939

open

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

Added by Ivan Necas over 7 years ago. Updated over 5 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
Compute resources
Target version:
-
Difficulty:
medium
Triaged:
Fixed in Releases:
Found in Releases:

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"
Actions #1

Updated by Ivan Necas over 7 years 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 1.7.0
Actions #2

Updated by Ivan Necas over 7 years ago

  • Status changed from New to Assigned
  • Assignee set to Ivan Necas
Actions #3

Updated by Ivan Necas over 7 years ago

  • Target version changed from 1.7.0 to 1.6.1
Actions #4

Updated by Ivan Necas over 7 years ago

  • Status changed from Assigned to New
Actions #5

Updated by Shimon Shtein over 7 years ago

  • Assignee changed from Ivan Necas to Shimon Shtein
Actions #6

Updated by Ivan Necas over 7 years ago

  • Target version changed from 1.6.1 to 127
Actions #7

Updated by Ivan Necas over 7 years ago

  • Target version changed from 127 to 1.5.1
Actions #8

Updated by Ivan Necas over 7 years ago

  • Target version changed from 1.5.1 to 1.4.1
Actions #9

Updated by Ivan Necas over 7 years ago

  • Target version changed from 1.4.1 to 113

Waiting for prioritization response on BZ

Actions #10

Updated by Dominic Cleal over 7 years ago

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

Updated by Ivan Necas over 7 years ago

  • Status changed from Assigned to New
  • Target version deleted (113)
Actions #12

Updated by Shimon Shtein over 7 years 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.

Actions #13

Updated by Tomáš Strachota about 7 years 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
  • Assignee deleted (Shimon Shtein)
  • Target version set to 115

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.

Actions

Also available in: Atom PDF