<p dir="ltr">Also, any workaround to assign ip?</p>
<div class="gmail_quote">On 20 Feb 2014 04:11, "Moti Asayag" <<a href="mailto:masayag@redhat.com">masayag@redhat.com</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
<br>
----- Original Message -----<br>
> From: "Tejesh M" <<a href="mailto:tejeshmk@gmail.com">tejeshmk@gmail.com</a>><br>
> To: "users@oVirt.org" <<a href="mailto:users@ovirt.org">users@ovirt.org</a>><br>
> Sent: Wednesday, February 19, 2014 3:24:40 PM<br>
> Subject: [Users] Fwd: Sample code for setting NIC - CloudInit<br>
><br>
> Hi,<br>
><br>
> Can someone share me sample java code for assigning IP address for VM on eth0<br>
> through Java SDK via CloudInit ?<br>
><br>
<br>
Hi Tejesh,<br>
<br>
I've attached a sample code that sends the required request (as the output is demonstrated in debug mode).<br>
Note that the code is jdk-7 compliant.<br>
I haven't configured cloud-init and haven't tested it end-to-end.<br>
Please try to test it on your environment and provide a feedback for it.<br>
<br>
Thanks,<br>
Moti<br>
<br>
> Something Like this but in Java:<br>
> <network_configuration><br>
> <nics><br>
> <nic><br>
> <name>eth0</name><br>
> <boot_protocol>STATIC</boot_protocol><br>
> <network><br>
> <ip address="192.168.2.11" netmask="255.255.0.0"<br>
> gateway="192.168.2.1" /><br>
> </network><br>
> <on_boot>true</on_boot><br>
> </nic><br>
> <nic><br>
> <name>eth1</name><br>
> <boot_protocol>DHCP</boot_protocol><br>
> </nic><br>
> <nic><br>
> <name>eth2</name><br>
> <boot_protocol>NONE</boot_protocol><br>
> <on_boot>true</on_boot><br>
> </nic><br>
> </nics><br>
> <dns><br>
> <servers><br>
> <host><br>
> <address>1.1.2.2</address><br>
> </host><br>
> <host><br>
> <address>1.2.3.4</address><br>
> </host><br>
> </servers><br>
> <search_domains><br>
> <host><br>
> <address>qa.lab</address><br>
> </host><br>
> <host><br>
> <address> <a href="http://google.com" target="_blank">google.com</a> </address><br>
> </host><br>
> </search_domains><br>
> </dns><br>
> </network_configuration><br>
><br>
><br>
><br>
> --<br>
> Thanks & Regards<br>
> Tejesh<br>
><br>
> _______________________________________________<br>
> Users mailing list<br>
> <a href="mailto:Users@ovirt.org">Users@ovirt.org</a><br>
> <a href="http://lists.ovirt.org/mailman/listinfo/users" target="_blank">http://lists.ovirt.org/mailman/listinfo/users</a><br>
><br>
</blockquote></div>