VMware Aria Automation Tools

 View Only
Expand all | Collapse all

Cloud-init network config

  • 1.  Cloud-init network config

    Posted Sep 19, 2023 12:43 PM

    Has anybody ever succeed in getting the network configuration for static IPs done with the native cloud-init network config part (not using write_files and run_cmd, but "network: [...]")

    https://cloudinit.readthedocs.io/en/latest/reference/network-config.html

    In my case the network configuration is currently handled using the "customizeGuestOs: true" flag. This is working von Ubuntu, RHEL and SLES.

    However I wanted to try out the above mentioned way, because I have some specific routing configurations which I could set more easily that way. But neither the version 1 and 2 configs are working for me. Cloud-init seems to ignore that part and falls back to setting the first NIC to DHCP.

    It would be great if anybody could share a working example. Thanks!

     



  • 2.  RE: Cloud-init network config

    Posted Sep 21, 2023 08:02 PM

    It is possible. It also depends on your linux flavor what config you need.

    The network has to be defined in a separate definition. Look into metadata.

    Some details you can find : https://cloudinit.readthedocs.io/en/latest/reference/datasources/vmware.html 

    And if you want to go away from the OVF as data transport take a look at this. https://kb.vmware.com/s/article/91809 

    It is a great read.

    Enjoy.

     

     



  • 3.  RE: Cloud-init network config

    Posted Sep 27, 2023 05:08 PM

    Afaik this cannot be achieved using the cloudConfig property in Aria Automation, as it is only user-data. See the statement in the cloud-init documentation link you've provided:

    "User data cannot change an instance’s network configuration. In the absence of network configuration in any of the above sources, cloud-init will write out a network configuration that will issue a DHCP request on a “first” network interface."



  • 4.  RE: Cloud-init network config



  • 5.  RE: Cloud-init network config

    Posted Sep 28, 2023 07:25 AM

    Yeah correct, nice read! You can overcome the OOTB limitation of cloudConfig being just user data using cloud-init's VMware datasource with guestinfo transport by leveraging am Extensibility Orchestrator workflow instead on relying on the default OVF datasource with the clunky ISO transport.

    This raises the question if this is really easier than just using write_files and run_cmd within the cloudConfig property of a Cloud Template (I understood that it was a requirement of V00Z). But if you want to use cloud-init's network config, then this is the way...

    Anyway, it would be really nice if the VMware datasource would make it into Aria Automation's OOTB functionality to be able to take advantage of it directly.



  • 6.  RE: Cloud-init network config

    Posted Sep 28, 2023 07:31 AM

    I read the blog post too and it looks quite good, but complex too. I agree that this should become part of Aria Automation itself. Maybe at some point in the future. 



  • 7.  RE: Cloud-init network config

    Posted Oct 10, 2023 02:54 PM

    It is not that complex. Just different.

    Only the blog post is doing a part. You need to simplify it and add one variable.

    If there is an interest i can make a small post how to implement it in a few steps (lniux only atm).



  • 8.  RE: Cloud-init network config

    Posted Oct 21, 2023 06:42 PM

    Í´am understanding right? In Aria Automation i just can use the cloud-init user-data like write_files, runcmd, fs_setup, bootcmd....

    I cannot use the network metadata in a cloud template in the cloudconfig?..

    So i should build the cloudconfig with the runcmd for customization, like hostname network config??



  • 9.  RE: Cloud-init network config

    Posted Oct 21, 2023 07:45 PM

    If you like to have a lot of work. Or just implement the no-cd version. Just create a second variable and push it as meta into the vm.



  • 10.  RE: Cloud-init network config

    Posted Oct 21, 2023 09:03 PM

    Yeah ok, but these Option is not Official come from VMWare... I mean for Tests or not customer Environment it is ok to do. And also complex too..

    It's very frustrating when this isn't well documented from VMWare that for now just cloud-init userdata can be integrated in cloud template in Aria Automation,

    Anyway, it would be really great when you can create a small post how to implement the no-cd version



  • 11.  RE: Cloud-init network config

    Posted Oct 25, 2023 05:57 PM

    You may consider referring to article  vRA with Cloud-init and Static Networking | vnuggets 



  • 12.  RE: Cloud-init network config

    Posted Nov 16, 2023 03:00 PM

    i have tried these from vnugget. for example: Hostname, Timezone works…, but Networkconfig is empty.

    Which Modules are added in the Template in the cloud.cfg???



  • 13.  RE: Cloud-init network config

    Posted Nov 16, 2023 05:16 PM

    You need to get creative for network.

    That needs to be in a separate variable. And in the workflow you added to the guestinfo.metadata

    Like i have a separate variable in the definition machine.

     

          twh_CloudConfig:
            local-hostname: ${self.resourceName}
            instance-id: ${self.resourceName}
            secret: ${secret.demo}
            network:
              version: 2
              ethernets:
                ens192:
                  dhcp4: false
                  gateway4: ${resource.Cloud_vSphere_Network_1.gateway}
                  addresses:
                    - ${resource.Cloud_Machine_1.networks[0].address}/${resource.Cloud_vSphere_Network_1.prefixLength}
                  nameservers:
                    search: twinhosting.class
                    adresses: ${resource.Cloud_vSphere_Network_1.dns}

     

     
     


  • 14.  RE: Cloud-init network config

    Posted Nov 16, 2023 05:26 PM

    which sepwrate variable do you mean?? In the blueprint itself or for the guestinfo.metadata?

    How you create the variable in cloud assembly for the guestinfo.metadata??



  • 15.  RE: Cloud-init network config

    Posted Nov 16, 2023 06:30 PM

    The variable is created in the blueprint. Just any name you like.

    And then in vRO you have a workflow that uses that variable. See previous posts about this from me.