[12:55] <kruster95> hi all 
[12:57] <kruster95> i want to use cloud-init and terraform to configure my virtual server (vmware), i am looking for some documentation, if you can give me a hand. thank you
[13:04] <minimal> kruster95: well basically you either need a pre-existing VM image that has cloud-init enabled or you need to build a VM yourself. The VMware DataSource changed/a new one was added recently so not sure if any official Linux distro cloud images have the new DataSource yet. Which distro are you using?
[13:05] <minimal> Once you have a suitable VM image then when you create a VM using terraform you supply the user-data as part of the terraform action
[13:13] <kruster95> minimal : I have my rhel8 template with cloud-init to install
[13:13] <minimal> so have you actually tried creating a VM using terraform and passing user-data to it?
[13:13] <kruster95> and my block in terraform :   extra_config = {
[13:13] <kruster95>     "guestinfo.metadata"          = base64encode(file("${path.module}/templates/metadata.yaml"))
[13:13] <kruster95>     "guestinfo.metadata.encoding" = "base64"
[13:13] <kruster95>     "guestinfo.userdata"          = base64encode(file("${path.module}/templates/userdata.yaml"))
[13:13] <kruster95>     "guestinfo.userdata.encoding" = "base64"
[13:13] <kruster95>   }
[13:14] <kruster95> nothing happens
[13:14] <minimal> and did you log into the created VM and look at /var/log/cloud-init.log to see what happened?
[13:15] <kruster95> I have nothing special in the logs
[13:16] <minimal> nothing special? did it setup network config based on the VMware DataSource?
[13:16] <minimal> did it see the user-data and act upon any of it?
[13:21] <kruster95> the network is correctly configured
[13:22] <kruster95> how does my vm interact with terraform?
[13:22] <minimal> kruster95: and the DataSource that the logs indicate was used?
[13:23] <kruster95> on my template, I have not configured a datasource
[13:23] <kruster95> I just installed cloud-init
[13:23] <minimal> your VM does not interact with Terraform, Terraform is used to create the VM via which hypervisor (VMware in this case) is used and it passes the cloud-init metadata and network config and user-data to the hypervisor to pass on (in some way) to the VM's cloud-init
[13:24] <minimal> In the /var/log/cloud-init.log it will indicate which DataSource was used during boot
[13:25] <kruster95> "DataSourceOVF.py[DEBUG]: VMware Virtualization Platform found"
[13:26] <kruster95> I can see the network configuration in the logs
[13:27] <minimal> ok, so it used the OVF datasource
[13:27] <minimal> so is there any reference to user-data in the logfile?
[13:30] <kruster95> no precisely, i think i have a config problem in terraform.
[13:30] <minimal> You probably should read https://cloudinit.readthedocs.io/en/latest/topics/datasources/ovf.html
[13:30] <minimal> there are notes there about VMware specific config settings
[13:31] <minimal> why focus on terraform as the likely problem? I suspect it is either the cloud-init settings for the OVF DataSource or the VMware configuration
[13:32] <kruster95> because my custo is in terraform
[13:32] <minimal> custo?
[13:33] <kruster95> customization
[13:33] <kruster95> create users 
[13:33] <kruster95> install package
[13:34] <minimal> terraform simplly passes this to VMware
[13:34] <minimal> in the OVF document I referenced did you read this? "On VMware platforms, VMTools use is required for OVF datasource configuration settings as well as vCloud and vSphere admin configuration."
[13:34] <minimal> have you setup VMTools?
[13:38] <kruster95> yes it is correctly configured
[13:40] <minimal> I'm not familiar with VMware, so are there some logs where you can check if (a) VMware received the user-data from Terraform and (b) if VMware supplied the user-data to cloud-init?
[13:56] <minimal> kruster95: in cloud-init code for OVF DS I see this comment: "When the VM is powered on, the "VMware Tools" daemon copies the customization specification file to /var/run/vmware-imc directory. cloud-init code needs to search for the file in that directory which indicates that required metadata and userdata files are now present."
[13:56] <minimal> so does /var/run/vmware-imc directory exist on the booted VM and does it contain anything?
[21:26] <Paul> hello, was trying to determine which stage OVF data is actually read in, my suspicion is that it is read in the local stage, but I can't seem to find that documented.  Does anyone know if this is true and where it might be documented?
[22:07] <Paul88> yea, think i confirmed it, it checks for the OVF data between starting "init-local" (cloud-init-local.service), and when it says it is starting "init" (cloud-init.service) in the logs. 
[22:13] <rharper> Paul88: it's not clearly documented,  in the context of cloud init,  in code, seeing the sources.DEP_FILESYSTEM indicates that it runs as soon as cloud-init init --local runs and searches for datasources that are detectable without networking, https://github.com/canonical/cloud-init/blob/main/cloudinit/sources/DataSourceOVF.py#L710  
[22:13] <Paul88> Thank you Ryan