Bug 1593239 - Starting VM through RestAPI doesn't add cdrom with cloud-init
Summary: Starting VM through RestAPI doesn't add cdrom with cloud-init
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: ovirt-engine
Classification: oVirt
Component: RestAPI
Version: 4.3.0
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ovirt-4.2.7
: ---
Assignee: Ori Liel
QA Contact: Vitalii Yerys
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-06-20 10:52 UTC by biakymet
Modified: 2018-11-02 14:39 UTC (History)
8 users (show)

Fixed In Version: ovirt-engine-4.2.7
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-11-02 14:35:32 UTC
oVirt Team: Virt
Embargoed:
rule-engine: ovirt-4.2+


Attachments (Terms of Use)
Engine log after starting with VmPortal (7.01 KB, text/plain)
2018-06-20 10:52 UTC, biakymet
no flags Details
Engine log after starting with AdminPortal (8.72 KB, text/plain)
2018-06-20 10:53 UTC, biakymet
no flags Details


Links
System ID Private Priority Status Summary Last Updated
oVirt gerrit 93044 0 master MERGED restapi: Cloud-Init only working in RunOnce 2020-06-02 01:33:12 UTC
oVirt gerrit 93576 0 ovirt-engine-4.2 MERGED restapi: Cloud-Init only working in RunOnce 2020-06-02 01:33:12 UTC

Description biakymet 2018-06-20 10:52:53 UTC
Created attachment 1453177 [details]
Engine log after starting with VmPortal

Description of problem:
When I try to start for the first time new VM with enabled cloud-init through RestAPI it doesn't add cdrom with cloud-init, but through AdminPortal everything works fine.

Version-Release number of selected component (if applicable):
Version 4.3.0-0.0.master.20180612172344.git9643156.el7

How reproducible:
Everytime

Steps to Reproduce:
1. Create new VM
2. Start it through VmPortal or RestAPI (used request:
http://[ENGINE_FQDN]/api/vms/[VM_ID]/start

Body:
{}
)

Actual results:
Starting without cloud-init cdrom.

Expected results:
Starting with cloud-init cdrom.

Additional info:

Comment 1 biakymet 2018-06-20 10:53:27 UTC
Created attachment 1453178 [details]
Engine log after starting with AdminPortal

Comment 2 Ori Liel 2018-06-25 08:55:00 UTC
My attempts to reproduce have led to the following findings:

1) Create a new VM with cloud-init
2) Start the VM, either via the API or via WebAdmin

Result: VM runs with cloud-init. 

Alternatively: 

1) Create a new VM with cloud-init
2) Run it
3) Shut it down
4) Run it a second time (either using WebAdmin or the API)

Result: VM runs without cloud-init.

So it works fine for a VM being run for the first time, but If this VM has been run once before the engine considers it 'initialized' and ignores cloud-init on purpose (unless it's runs as Run-Once, which in the API would mean that the VM is provided in the request body)

In summary it appears to me that this is not a bug. Could you please check, and if you agree, close this issue?

Comment 3 Ori Liel 2018-06-25 08:55:14 UTC
My attempts to reproduce have led to the following findings:

1) Create a new VM with cloud-init
2) Start the VM, either via the API or via WebAdmin

Result: VM runs with cloud-init. 

Alternatively: 

1) Create a new VM with cloud-init
2) Run it
3) Shut it down
4) Run it a second time (either using WebAdmin or the API)

Result: VM runs without cloud-init.

So it works fine for a VM being run for the first time, but If this VM has been run once before the engine considers it 'initialized' and ignores cloud-init on purpose (unless it's runs as Run-Once, which in the API would mean that the VM is provided in the request body)

In summary it appears to me that this is not a bug. Could you please check, and if you agree, close this issue?

Comment 4 André Liebe 2018-06-26 05:25:40 UTC
The problem arises when I prepare vm (with customization and prepopulated cloud-init data), make a template from it and let users create a vm from that template with cloud-init enabled (passing in used defined hostname and andmin defined custom script settings) in vm portal.

see https://github.com/oVirt/ovirt-web-ui/issues/642 for my use case

Comment 5 Greg Sheremeta 2018-07-31 15:19:21 UTC
@Ori or Michal, can we backport to 4.2.6 for web-ui 1.4.2? (this bz is currently untargeted)

Comment 6 Martin Perina 2018-08-08 11:46:05 UTC
(In reply to Greg Sheremeta from comment #5)
> @Ori or Michal, can we backport to 4.2.6 for web-ui 1.4.2? (this bz is
> currently untargeted)

Ori agreed, no problem with backport to 4.2

Comment 7 Vitalii Yerys 2018-08-30 11:04:59 UTC
Verified upstream:

ovirt-engine-4.2.6.5-0.0.master.20180827083432.git51e39c2.el7.noarch
ovirt-web-ui-1.3.9-1.el7ev.noarch
vdsm-http-4.20.38-8.git9f3cc73.el7.noarch

Comment 8 Raz Tamir 2018-09-05 08:55:49 UTC
QE verification bot: the bug was verified upstream

Comment 9 Sandro Bonazzola 2018-11-02 14:35:32 UTC
This bugzilla is included in oVirt 4.2.7 release, published on November 2nd 2018.

Since the problem described in this bug report should be
resolved in oVirt 4.2.7 release, it has been closed with a resolution of CURRENT RELEASE.

If the solution does not work for you, please open a new bug report.


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