-
Notifications
You must be signed in to change notification settings - Fork 112
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Using Cloud-Init to set an static IP in the virtual machine. #667
Comments
Hello @donkerm, tl;dr this is a very specific thing and depends on guest VM. You need to check what datasource does cloud-init use in your case and adjust it. At least some time ago the default was DatasourceOVF which was pretty limited (https://github.com/canonical/cloud-init/blob/master/cloudinit/sources/DataSourceOVF.py) There is also a more advanced VMware tailored datasource - https://github.com/vmware/cloud-init-vmware-guestinfo After that - the best option is to probably look at logs in guest machine and see if cloud-init was triggered, which datasource it used and if it got the data. Another option - you could join VMware {Code} slack space https://code.vmware.com/web/code/join and join I will close this for now, but feel free to add details. |
Hi all, I wanted to help the community and describe what I ran into and how I got this working. The problem that I had was the OVA machine I tried to use. My working configuration: versions.tf
variables.tf
main.tf
userdata.tmpl
Things I ran into: Also I needed to: Thanks for the feedback and support. |
Could somebody tell me the correct way to use cloud-init with this vcd provider?
I tried a lot of possibilities, but I can't get it working.
I can't find this option described in the documentation and maybe it's not possible.
Looking at #510 it should work.?
Please advise?
Terraform Version
Terraform v0.12.18
vCloud 10.1
Affected Resource(s)
Static network configuration.
Terraform Configuration Files
In vm.tf
guest_properties = {
"user-data" = base64encode(file("test.yaml"))
}
network {
adapter_type = "VMXNET3"
type = "org"
name = vcd_vapp_org_network.direct-net.org_network_name
ip_allocation_mode = "MANUAL"
ip = "192.168.178.3"
mac = "de:ad:c0:de:ca:fe"
is_primary = true
connected = true
}
In test.yaml
network:
version: 2
renderer: networkd
ethernets:
ens192:
addresses: [192.168.178.3/24]
gateway4: 192.168.178.1
dhcp4: false
nameservers:
addresses: [8.8.8.8]
path: /etc/netplan/50-cloud-init.yaml
No error and virtual machine template has Cloud-Init installed together with VMWare tools (latest).
Expected Behavior
Configuring an IP on the interface ens192.
Actual Behavior
No error's but also no configuration has been done.
The text was updated successfully, but these errors were encountered: