Closed deefdragon closed 1 year ago
I don't get the question. The cloud Network Config part of the vm resource seems to work as intended on my end, or was at least ~3 weeks ago.
Cloudinit is apperently notoriously inconsistent between oses and versions.
I'm running Ubuntu 22.04, and have gotten an explicit error in my cloud init logs that I can't load the network config in via the user data.
I don't get the question. The cloud Network Config part of the vm resource seems to work as intended on my end, or was at least ~3 weeks ago. @4censord
How did you do the cloud Network Config part? tf/cloudconfig files would be interesting to see. Would be great if you could share an example.
Of course.
This is my network-config.tmpl
network:
version: 1
config:
- type: physical
name: enX0
subnets:
- type: static
address: ${ip_address}/24
gateway: ${gateway}
Relevant parts of my terraform files:
resource "xenorchestra_cloud_config" "network_data" {
name = "${local.projekt}/nextcloud network-data"
template = templatefile("${path.module}/templates/network.yaml.tmpl", {
ip_address = "192.168.100.100"
gateway = 192.168.100.254
})
}
resource "xenorchestra_vm" "vm" {
name_label = "name"
template = data.xenorchestra_template.template.id
cpus = 4
memory_max = 8 * local.gib
cloud_config = xenorchestra_cloud_config.user_data.template
cloud_network_config = xenorchestra_cloud_config.network_data.template
network {
network_id = data.xenorchestra_network.network.id
}
disk {
sr_id = data.xenorchestra_sr.storage.id
name_label = "disk"
size = 10 * local.gib
}
}
This is used with a custom cloudinit enabled template based on archlinux.
It looks like this value exists, but is set to be ignored here. Is there some other reason this was disabled or can it be enabled and no longer ignored?
@deefdragon the value you linked to is used (source).
When using cloud-init there are many moving parts (OS/distro type, cloud-init version and other supporting software/packages It's extremely difficult to debug this without the terraform code, cloud-init, terraform and other relevant logs. Please more details on this and I'd specifically like to see the error mentioned below:
I'm running Ubuntu 22.04, and have gotten an explicit error in my cloud init logs that I can't load the network config in via the user data.
@4censord Great, thanks. That worked with the ubuntu 20.04 template.
Closing this since you were able to get it working. If you need more assistance debugging this, feel free to continue the discussion here or in Discord.
If you wish to use network-config to set network settings, you must provide a seperate network config file as the network data can not be loaded from the user data. Xen orchestra passes this data from the frontend via a value called
networkConfig
(akin to thecloudConfig
value). It looks like this value exists, but is set to be ignored here. Is there some other reason this was disabled or can it be enabled and no longer ignored?