<div dir="ltr"><div class="gmail_quote"><div dir="ltr"><div>Hi,<br><br></div>Can someone share me sample java code for assigning IP address for VM on eth0 through Java SDK via CloudInit ?<span class=""></span><br></div><div>
<br></div><div><u><b>Something Like this but in Java:</b></u><br></div><div><pre><network_configuration>
<nics>
<nic>
<name>eth0</name>
<boot_protocol>STATIC</boot_protocol>
<network>
<ip address="192.168.2.11" netmask="255.255.0.0" gateway="192.168.2.1" />
</network>
<on_boot>true</on_boot>
</nic>
<nic>
<name>eth1</name>
<boot_protocol>DHCP</boot_protocol>
</nic>
<nic>
<name>eth2</name>
<boot_protocol>NONE</boot_protocol>
<on_boot>true</on_boot>
</nic>
</nics>
<dns>
<servers>
<host>
<address>1.1.2.2</address>
</host>
<host>
<address>1.2.3.4</address>
</host>
</servers>
<search_domains>
<host>
<address>qa.lab</address>
</host>
<host>
<address><a href="http://google.com">google.com</a></address>
</host>
</search_domains>
</dns>
</network_configuration></pre><br><br><br></div><div dir="ltr">-- <br><span class=""></span><span class=""></span></div></div><div>Thanks & Regards</div>
<div>Tejesh</div>
</div>