Skip to content

Instantly share code, notes, and snippets.

@gowatana
Created November 17, 2022 14:32
Show Gist options
  • Save gowatana/9867c94b3f3335addc76836494e4886b to your computer and use it in GitHub Desktop.
Save gowatana/9867c94b3f3335addc76836494e4886b to your computer and use it in GitHub Desktop.
resource "vcd_vapp" "vapp1" {
name = "tf-vapp-03"
description = "Terraform demo vApp"
}
resource "vcd_vapp_vm" "vapp1-vm1" {
vapp_name = vcd_vapp.vapp1.name
name = "vm01"
catalog_name = "catalog-01"
template_name = "vapp-template-01"
cpus = 2
cpu_cores = 1
memory = 2048
customization {
enabled = true
allow_local_admin_password = true
auto_generate_password = false
admin_password = "VMware1!"
initscript = "systemctl stop iptables; systemctl disable iptables"
}
network {
type = "org"
name = vcd_vapp_org_network.routed-net-1.org_network_name
ip_allocation_mode = "POOL"
is_primary = true
}
}
output "vm1_ip" {
value = vcd_vapp_vm.vapp1-vm1.network[0].ip
}
@gowatana
Copy link
Author

下記の投稿むけ。

VMware Cloud Director 10.4 を Terraform で操作してみる。Part-03 vApp VM のゲスト OS カスタマイズ
https://vm.gowatana.jp/entry/2022/11/17/235833

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment