Bug 1506449 - [API] Cannot clear vm initialization via api
Summary: [API] Cannot clear vm initialization via api
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Virtualization Manager
Classification: Red Hat
Component: ovirt-engine
Version: 4.1.5
Hardware: x86_64
OS: Linux
medium
medium
Target Milestone: ovirt-4.2.0
: ---
Assignee: jniederm
QA Contact: Vitalii Yerys
URL:
Whiteboard:
Depends On:
Blocks: 1513684
TreeView+ depends on / blocked
 
Reported: 2017-10-26 05:58 UTC by Germano Veit Michel
Modified: 2021-03-11 18:07 UTC (History)
8 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
In the current release, virtual machine initialization can be cleared with the REST API.
Clone Of:
: 1513684 (view as bug list)
Environment:
Last Closed: 2018-05-15 17:45:44 UTC
oVirt Team: Virt
Target Upstream Version:
lsvaty: testing_plan_complete-


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 1464819 0 unspecified CLOSED [API] Setting Custom Compatibility Version for a VM via REST api to a none/empty value is not working 2021-02-22 00:41:40 UTC
Red Hat Knowledge Base (Solution) 3278801 0 None None None 2017-12-13 00:46:00 UTC
Red Hat Product Errata RHEA-2018:1488 0 None None None 2018-05-15 17:46:48 UTC
oVirt gerrit 84192 0 master MERGED restapi: Empty vm/initialization tag clears VM#vmInit 2017-11-20 13:22:03 UTC

Internal Links: 1464819

Description Germano Veit Michel 2017-10-26 05:58:11 UTC
Description of problem:

Trying to set the Initialization of a VM to an empty value via REST api does not work.

Version-Release number of selected component (if applicable):
rhevm-4.1.5.2-0.1.el7.noarch

How reproducible:
100%

Steps to Reproduce:

Doing a PUT of an empty initialization does not work. All the configurations remain.

DEBUG:root:PUT /ovirt-engine/api/vms/b595e7fd-21e9-4bd7-ac5b-8559a78912b9 HTTP/1.1
DEBUG:root:Content-Length: 31
DEBUG:root:<vm>
DEBUG:root:  <initialization/>
DEBUG:root:</vm>
DEBUG:root:HTTP/1.1 200 OK

If I try just the Cloud init part, no changes as well

Everything is still there:

DEBUG:root:    <initialization>
DEBUG:root:        <configuration>
                   .....
DEBUG:root:        </configuration>
DEBUG:root:        <host_name>thisisatest</host_name>
DEBUG:root:        <nic_configurations/>
DEBUG:root:        <regenerate_ssh_keys>false</regenerate_ssh_keys>
DEBUG:root:    </initialization>

I'm using this:

vms_service = connection.system_service().vms_service()

for vm in vms_service.list():
    if vm.name.startswith("germano-"):
        print "Updating %s" % vm.name
        vm_service = vms_service.vm_service(vm.id)
        vm_service.update(
            types.Vm(
                initialization=types.Initialization(
                )
            )
        )

And the cloud_init element inside initialization seems to suffer from the same problem.

Actual results:
Initialization still there

Expected results:
Initialization removed

Comment 1 Michal Skrivanek 2017-11-15 07:57:50 UTC
where's the 4.2 bug?

Comment 3 Tomas Jelinek 2017-11-15 18:42:23 UTC
(In reply to Michal Skrivanek from comment #1)
> where's the 4.2 bug?

sorry, cloned now.

Comment 5 Vitalii Yerys 2018-02-23 11:16:14 UTC
Verified on 4.2.2-0.1.el7 build.

Comment 9 errata-xmlrpc 2018-05-15 17:45:44 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/RHEA-2018:1488

Comment 10 Franta Kust 2019-05-16 13:06:42 UTC
BZ<2>Jira Resync

Comment 11 Daniel Gur 2019-08-28 13:13:36 UTC
sync2jira

Comment 12 Daniel Gur 2019-08-28 13:17:50 UTC
sync2jira


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