[Users] Fwd: Sample code for setting NIC - CloudInit

Tejesh M tejeshmk at gmail.com
Wed Feb 19 13:24:40 UTC 2014


Hi,

Can someone share me sample java code for assigning IP address for VM on
eth0 through Java SDK via CloudInit ?

*Something Like this but in Java:*

<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>google.com</address>
             </host>
           </search_domains>
         </dns>
       </network_configuration>




-- 
Thanks & Regards
Tejesh
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ovirt.org/pipermail/users/attachments/20140219/f7bd07ce/attachment-0001.html>


More information about the Users mailing list