Terraform
-
Hi,
I am reading https://xen-orchestra.com/blog/virtops1-xen-orchestra-terraform-provider/ and https://registry.terraform.io/providers/terra-farm/xenorchestra/latest/docs, and I can't find information how to set the IP address of the machine in the terraform plan.
Is there a way to do it?
Thanks in advance.
-
Pinging @ddelnano about this

-
I didn't try the provider, but there is an option
cloud_network_config, you should be able to pass network config as in Xen Orchestra UI using cloud-init. -
@ruskofd is right. You should be able to use the
cloud_network_configattribute to achieve this.The following code is untested but should launch a vm with a static IP. Please see the xenorchestra_vm resource docs and the cloud-init networking v1 docs for more details.
resource "xenorchestra_vm" "static_ip_vm" { .... cloud_network_config = <<EOF network: version: 1 config: - type: physical name: eth0 subnets: - type: static address: STATIC_IP/24 gateway: GATEWAY_IP dns_nameservers: - 8.8.8.8 EOF }Let me know if you have any questions or issues using
cloud_network_config,As for the blog post, the VM would have been assigned an ip address via dhcp (assuming the guest OS had cloud-init installed which was true for the VM template in the blog post).
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login