=== cpaelzer_ is now known as cpaelzer [12:55] hi all [12:57] 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] 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] 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] minimal : I have my rhel8 template with cloud-init to install [13:13] so have you actually tried creating a VM using terraform and passing user-data to it? [13:13] and my block in terraform : extra_config = { [13:13] "guestinfo.metadata" = base64encode(file("${path.module}/templates/metadata.yaml")) [13:13] "guestinfo.metadata.encoding" = "base64" [13:13] "guestinfo.userdata" = base64encode(file("${path.module}/templates/userdata.yaml")) [13:13] "guestinfo.userdata.encoding" = "base64" [13:13] } [13:14] nothing happens [13:14] and did you log into the created VM and look at /var/log/cloud-init.log to see what happened? [13:15] I have nothing special in the logs [13:16] nothing special? did it setup network config based on the VMware DataSource? [13:16] did it see the user-data and act upon any of it? [13:21] the network is correctly configured [13:22] how does my vm interact with terraform? [13:22] kruster95: and the DataSource that the logs indicate was used? [13:23] on my template, I have not configured a datasource [13:23] I just installed cloud-init [13:23] 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] In the /var/log/cloud-init.log it will indicate which DataSource was used during boot [13:25] "DataSourceOVF.py[DEBUG]: VMware Virtualization Platform found" [13:26] I can see the network configuration in the logs [13:27] ok, so it used the OVF datasource [13:27] so is there any reference to user-data in the logfile? [13:30] no precisely, i think i have a config problem in terraform. [13:30] You probably should read https://cloudinit.readthedocs.io/en/latest/topics/datasources/ovf.html [13:30] there are notes there about VMware specific config settings [13:31] 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] because my custo is in terraform [13:32] custo? [13:33] customization [13:33] create users [13:33] install package [13:34] terraform simplly passes this to VMware [13:34] 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] have you setup VMTools? [13:38] yes it is correctly configured [13:40] 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] 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] so does /var/run/vmware-imc directory exist on the booted VM and does it contain anything? [21:26] 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? === Paul is now known as Paul88 [22:07] 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] 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] Thank you Ryan