Bug 1391791 - [Docs][Python SDK] Python SDK cloud-init example is missing use_cloud_init=True
Summary: [Docs][Python SDK] Python SDK cloud-init example is missing use_cloud_init=True
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Enterprise Virtualization Manager
Classification: Red Hat
Component: Documentation
Version: 4.0.3
Hardware: x86_64
OS: Linux
medium
low
Target Milestone: ovirt-4.1.3
: ---
Assignee: Avital Pinnick
QA Contact: Byron Gravenorst
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-11-04 04:26 UTC by Germano Veit Michel
Modified: 2020-05-14 15:23 UTC (History)
9 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-08-21 04:38:27 UTC
oVirt Team: Docs
Target Upstream Version:


Attachments (Terms of Use)

Description Germano Veit Michel 2016-11-04 04:26:58 UTC
Description of problem:

The example here:
https://access.redhat.com/documentation/en/red-hat-virtualization/4.0/paged/python-sdk-guide/220-example-starting-a-virtual-machine-with-cloud-init-using-python

To attach the cloud-init payload to the VM during startup we need to specify use_cloud_init=True in the action of starting the VM. Otherwise cloud-init is just configured by the user but the VM does not see it, so it won't run and won't init the VM.

That code does not work for me. I need to add the use_cloud_init flag, we need to:

...
action = params.Action(use_cloud_init=True, 
....
vm.start(action=action)
....

Comment 1 Yaniv Lavi 2017-01-31 08:55:39 UTC
Do we have an examples for this?

Comment 2 Juan Hernández 2017-01-31 09:03:46 UTC
Yes, there is a complete example here:

  https://github.com/oVirt/ovirt-engine-sdk/blob/master/sdk/examples/start_vm_with_cloud_init.py

Comment 3 Juan Hernández 2017-01-31 09:04:28 UTC
Note that the example above is for version 4 of the API.

Comment 4 Yaniv Lavi 2017-02-07 07:37:37 UTC
Please see the example from the SDK comment #2.

Comment 5 Germano Veit Michel 2017-02-08 05:57:37 UTC
(In reply to Yaniv Dary from comment #4)
> Please see the example from the SDK comment #2.

Hi Yaniv,

Yes, the example is correct. But our RHV Documentation is not. 

I remember testing it quite a few times at that time and it did not work. Our docs are configuring all the parameters but forgetting to "click the enable button". Following our docs the payload is not attached to the VM because it's booted without "use-cloudinit".

Maybe just copy the example to RHV Documentation? The example worked fine at the time I tested it.

Please consider reopening.

Comment 6 Lucy Bopf 2017-07-28 08:40:28 UTC
Assigning to Avital for review.

Comment 8 Germano Veit Michel 2017-07-31 01:55:36 UTC
(In reply to Avital Pinnick from comment #7)
> Germano, please review the document previews.
> 
> Updated Python SDK 4.0:
> http://file.tlv.redhat.com/~apinnick/BZ1391791_4.0/
> #Example_Starting_a_Virtual_Machine_with_Cloud-Init_using_Python
> 
> Updated Python SDK 4.1:
> http://file.tlv.redhat.com/~apinnick/BZ1391791_4.1/
> #Example_Starting_a_Virtual_Machine_with_Cloud-Init_using_Python

Looks better now, the "use_cloud_init=True" is there.

Thanks


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