Bug 1253710

Summary: [RFE] Add template methods to work with Cloud-Init/Sysprep settings through RHEVM API
Product: Red Hat Enterprise Virtualization Manager Reporter: Javier Ramirez <javier.ramirez>
Component: ovirt-engineAssignee: Shahar Havivi <shavivi>
Status: CLOSED ERRATA QA Contact: sefi litmanovich <slitmano>
Severity: medium Docs Contact:
Priority: medium    
Version: 3.5.3CC: bazulay, bgraveno, dfediuck, gklein, istein, lsurette, mavital, michal.skrivanek, rbalakri, Rhev-m-bugs, shavivi, sherold, slitmano, srevivo, ykaul
Target Milestone: ovirt-4.0.0-alphaKeywords: FutureFeature
Target Release: 4.0.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: ovirt 4.0.0 alpha1 Doc Type: Enhancement
Doc Text:
Cloud-Init and Sysprep settings can now be modified using REST APIs.
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-08-23 20:28:33 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: Virt RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Comment 1 Javier Ramirez 2015-08-14 14:05:11 UTC
- What is the nature and description of the request?  

	Customer have several (6 to 8) RHEV-Ms and they are moving to using cloud-init to create base templates for provisioning VMs and they would like to automate some of this work using RHEV API.

- Why does the customer need this? (List the business requirements here)  

Customer are moving from a Satellite based provisioning approach to cloud-init and templates.

With 6 to 8 RHEV-Ms an easier way to edit and display Cloud-Init/Sysprep settings in templates using the API is required.
      
- How would the customer like to achieve this? (List the functional requirements here)  

Available template methods in the RHEVM API to edit and display Cloud-Init/Sysprep settings.
      
- For each functional requirement listed, specify how Red Hat and the customer can test to confirm the requirement is successfully implemented.  

Cloud-Init/Sysprep settings in templates to be displayed in the XML using the browser.

Cloud-Init/Sysprep settings in templates be able to be modified using API calls.
      
- Is there already an existing RFE upstream or in Red Hat Bugzilla?  

None found.
      
- Does the customer have any specific timeline dependencies and which release would they like to target (i.e. RHEL5, RHEL6)?  

As soon as possible.
      
- Is the sales team involved in this request and do they have any additional input?  

No

- List any affected packages or components.  

Unknown.

- Would the customer be able to assist in testing this functionality if implemented?  

Yes.

Comment 2 Scott Herold 2015-08-21 01:58:56 UTC
RFE flagged for 3.6 after dev freeze.  Proposing for RHEV 4.0.

Comment 3 Juan Hernández 2016-04-07 18:46:02 UTC
*** Bug 1324962 has been marked as a duplicate of this bug. ***

Comment 4 sefi litmanovich 2016-04-19 12:54:00 UTC
Test but not yet verified with ovirt-engine-4.0.0-0.0.master.20160405102116.git3819ab7.el7.centos.noarch.

Verified flows:
1. Create a template from Vm with initialization params. -> Template inherits all the different params values successfully, initialization attribute and it's sub attributes appear on API as in Vm entity. Test case works both when creating template trough webadmin and API.

2. Edit an existing template, fill initialization params with values - > Same result. Test case works both when editing template through webadmin and API.

3. Create a vm from a template with initialization params -> Vm inherits all params values successfully. Test case works both when creating vm through webadmin and API.

4. Create a vm pool from a template with initialization params -> Vm pool and the specific vms in it inherit all params values successfully. Test case works both when creating vm pool through webadmin and API.

Bugs:

1. Editing some sub attribute of vm's or template's initialization attr via API will override all other sub_attributes e.g.

say you have a template with:

<initialization>
<host_name>foo.bar.com</host_name>
<dns_servers>1.2.3.4</dns_servers
</initialization>

and now you want to change the dns_servers value:

PUT https://{engine_url/ovirt-engine/api/templates/{template_id}

<template>
<initialization>
<dns_servers>5.6.7.8</dns_servers
</initialization>
</template>

Result is that host_name is overridden and is now blank, only dns_servers will be updated. 


2. There is a related bug which I will open because is not blocking the feature:
when you set some initialization params on template and then try to create a new vm from webadmin templates tab, it overrides the initialization params of the template. this doesn't happen if you create a new vm from VMS tab and chose that template.

Comment 5 Shahar Havivi 2016-04-20 07:44:59 UTC
This is a bug but a different one,
Please open a new bug for that issue.

Comment 6 sefi litmanovich 2016-04-20 08:26:10 UTC
verified with ovirt-engine-4.0.0-0.0.master.20160405102116.git3819ab7.el7.centos.noarch.
Verified according to flows mentioned in comment #4.
two related bugs  were opened:

https://bugzilla.redhat.com/show_bug.cgi?id=1328737
https://bugzilla.redhat.com/show_bug.cgi?id=1328463

Comment 8 errata-xmlrpc 2016-08-23 20:28:33 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://rhn.redhat.com/errata/RHEA-2016-1743.html