How to configure Cloud-init in Guest OS ?

Hi, I am trying to use cloud-int to provide some text file in guest OS as mention in below link. (tried using sdk) But it is not working. http://www.ovirt.org/develop/release-management/features/cloud/cloud-init-in... 1> Do I need to do some configure cloud-init in Guest OS ? -> I hav just install cloud-init package in my 2 guest For centos 6.8 => yum install cloud-init For ubuntu 14.05 => apt-get install cloud-init 2> Do cloud-init permanently write network configuration in ifconfig file(Centos) or interface file (ubuntu)? Thanks, ~Rohit

On 03/16/2017 02:22 PM, TranceWorldLogic . wrote:
Hi,
I am trying to use cloud-int to provide some text file in guest OS as mention in below link. (tried using sdk) But it is not working. http://www.ovirt.org/develop/release-management/features/cloud/cloud-init-in...
What SDK are you using? I guess that the Python SDK. Did you try this example: https://github.com/oVirt/ovirt-engine-sdk/blob/master/sdk/examples/start_vm_...
1> Do I need to do some configure cloud-init in Guest OS ? -> I hav just install cloud-init package in my 2 guest For centos 6.8 => yum install cloud-init For ubuntu 14.05 => apt-get install cloud-init
That should be eough, at least in CentOS. Not sure about Ubuntu. Note that you are using a quite old version of CentOS, so you may also be using an old or buggy version of cloud-init. Did you try with latest CentOS 7?
2> Do cloud-init permanently write network configuration in ifconfig file(Centos) or interface file (ubuntu)?
It does, in CentOS. Not sure about Ubuntu.

Hi, I am trying to create file using same API, as shown below: -------------------------------------------------- scontent="Hello World !!" vm_service.start( use_cloud_init=True, vm = types.Vm( initialization=types.Initialization( cloud_init=types.CloudInit( files=[types.File(name="/root/hello.conf", content=scontent, type="PLAINTEXT")], ), ), ), ) ---------------------------------------------------- Can someone help me to understand ? why it is not working. Or Is that variable "cloud_init=" not handled in ovirt ? Thanks, ~Rohit On Thu, Mar 16, 2017 at 7:33 PM, Juan Hernández <jhernand@redhat.com> wrote:
On 03/16/2017 02:22 PM, TranceWorldLogic . wrote:
Hi,
I am trying to use cloud-int to provide some text file in guest OS as mention in below link. (tried using sdk) But it is not working. http://www.ovirt.org/develop/release-management/features/ cloud/cloud-init-integration/
What SDK are you using? I guess that the Python SDK. Did you try this example:
https://github.com/oVirt/ovirt-engine-sdk/blob/master/ sdk/examples/start_vm_with_cloud_init.py
1> Do I need to do some configure cloud-init in Guest OS ? -> I hav just install cloud-init package in my 2 guest For centos 6.8 => yum install cloud-init For ubuntu 14.05 => apt-get install cloud-init
That should be eough, at least in CentOS. Not sure about Ubuntu.
Note that you are using a quite old version of CentOS, so you may also be using an old or buggy version of cloud-init. Did you try with latest CentOS 7?
2> Do cloud-init permanently write network configuration in ifconfig file(Centos) or interface file (ubuntu)?
It does, in CentOS. Not sure about Ubuntu.

On 03/16/2017 04:09 PM, TranceWorldLogic . wrote:
Hi,
I am trying to create file using same API, as shown below: -------------------------------------------------- scontent="Hello World !!"
vm_service.start( use_cloud_init=True, vm = types.Vm( initialization=types.Initialization( cloud_init=types.CloudInit( files=[types.File(name="/root/hello.conf", content=scontent, type="PLAINTEXT")], ), ), ), ) ----------------------------------------------------
Can someone help me to understand ? why it is not working. Or Is that variable "cloud_init=" not handled in ovirt ?
That may have been the initial design of the feature, but it doesn't currently work. That 'files' element isn't used at all. The recommended way to create a file is using the custom script, as explained in this example: https://github.com/oVirt/ovirt-engine-sdk/blob/master/sdk/examples/start_vm_... The use of 'types.CloudInit' is also disencouraged, use directly the attributes of 'types.Initialization', as explained here: https://github.com/oVirt/ovirt-engine-sdk/blob/master/sdk/examples/start_vm_...
On Thu, Mar 16, 2017 at 7:33 PM, Juan Hernández <jhernand@redhat.com <mailto:jhernand@redhat.com>> wrote:
On 03/16/2017 02:22 PM, TranceWorldLogic . wrote: > Hi, > > I am trying to use cloud-int to provide some text file in guest OS as > mention in below link. (tried using sdk) > But it is not working. > http://www.ovirt.org/develop/release-management/features/cloud/cloud-init-in... <http://www.ovirt.org/develop/release-management/features/cloud/cloud-init-integration/> >
What SDK are you using? I guess that the Python SDK. Did you try this example:
https://github.com/oVirt/ovirt-engine-sdk/blob/master/sdk/examples/start_vm_... <https://github.com/oVirt/ovirt-engine-sdk/blob/master/sdk/examples/start_vm_with_cloud_init.py>
> 1> Do I need to do some configure cloud-init in Guest OS ? > -> I hav just install cloud-init package in my 2 guest > For centos 6.8 => yum install cloud-init > For ubuntu 14.05 => apt-get install cloud-init >
That should be eough, at least in CentOS. Not sure about Ubuntu.
Note that you are using a quite old version of CentOS, so you may also be using an old or buggy version of cloud-init. Did you try with latest CentOS 7?
> 2> Do cloud-init permanently write network configuration in ifconfig > file(Centos) or interface file (ubuntu)? >
It does, in CentOS. Not sure about Ubuntu.
_______________________________________________ Users mailing list Users@ovirt.org http://lists.ovirt.org/mailman/listinfo/users

Thanks Juan for helping me. ~Rohit On Fri, Mar 17, 2017 at 12:51 AM, Juan Hernández <jhernand@redhat.com> wrote:
On 03/16/2017 04:09 PM, TranceWorldLogic . wrote:
Hi,
I am trying to create file using same API, as shown below: -------------------------------------------------- scontent="Hello World !!"
vm_service.start( use_cloud_init=True, vm = types.Vm( initialization=types.Initialization( cloud_init=types.CloudInit( files=[types.File(name="/root/hello.conf", content=scontent, type="PLAINTEXT")], ), ), ), ) ----------------------------------------------------
Can someone help me to understand ? why it is not working. Or Is that variable "cloud_init=" not handled in ovirt ?
That may have been the initial design of the feature, but it doesn't currently work. That 'files' element isn't used at all. The recommended way to create a file is using the custom script, as explained in this example:
https://github.com/oVirt/ovirt-engine-sdk/blob/master/ sdk/examples/start_vm_with_cloud_init.py#L48-L57
The use of 'types.CloudInit' is also disencouraged, use directly the attributes of 'types.Initialization', as explained here:
https://github.com/oVirt/ovirt-engine-sdk/blob/master/ sdk/examples/start_vm_with_cloud_init.py#L59-L86
On Thu, Mar 16, 2017 at 7:33 PM, Juan Hernández <jhernand@redhat.com <mailto:jhernand@redhat.com>> wrote:
On 03/16/2017 02:22 PM, TranceWorldLogic . wrote: > Hi, > > I am trying to use cloud-int to provide some text file in guest OS
as
> mention in below link. (tried using sdk) > But it is not working. > http://www.ovirt.org/develop/release-management/features/
cloud/cloud-init-integration/
cloud/cloud-init-integration/>
>
What SDK are you using? I guess that the Python SDK. Did you try this example:
sdk/examples/start_vm_with_cloud_init.py
sdk/examples/start_vm_with_cloud_init.py>
> 1> Do I need to do some configure cloud-init in Guest OS ? > -> I hav just install cloud-init package in my 2 guest > For centos 6.8 => yum install cloud-init > For ubuntu 14.05 => apt-get install cloud-init >
That should be eough, at least in CentOS. Not sure about Ubuntu.
Note that you are using a quite old version of CentOS, so you may
also
be using an old or buggy version of cloud-init. Did you try with
latest
CentOS 7?
> 2> Do cloud-init permanently write network configuration in
ifconfig
> file(Centos) or interface file (ubuntu)? >
It does, in CentOS. Not sure about Ubuntu.
_______________________________________________ Users mailing list Users@ovirt.org http://lists.ovirt.org/mailman/listinfo/users
participants (2)
-
Juan Hernández
-
TranceWorldLogic .