-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfull-clone.tf
156 lines (117 loc) · 3.19 KB
/
full-clone.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
# Proxmox Full-Clone
# ---
# Create a new VM from a clone
resource "proxmox_vm_qemu" "control-plane1" {
# VM General Settings
target_node = "pve"
vmid = "201"
name = "control-plane1"
desc = "Description"
# VM Advanced General Settings
onboot = true
# VM OS Settings
clone = "ubuntu-server-jammy"
# VM System Settings
agent = 1
# VM CPU Settings
cores = 6
sockets = 1
cpu = "host"
# VM Memory Settings
memory = 6144
# VM Network Settings
network {
bridge = "vmbr0"
model = "virtio"
}
# VM Cloud-Init Settings
os_type = "cloud-init"
# (Optional) IP Address and Gateway
# ipconfig0 = "ip=0.0.0.0/0,gw=0.0.0.0"
# (Optional) Default User
ciuser = "root"
# (Optional) Add your SSH KEY
sshkeys = <<EOF
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPekPB/rnjpJYUmc/WW2WDcIEK1gt0SE+hGsRsBwEi8c pjconnol@LAPTOP-GSTHBNE5
EOF
provisioner "local-exec" {
when = create
command = "echo \"The IP of vm '${self.name}' is '${self.default_ipv4_address}'\""
}
}
resource "proxmox_vm_qemu" "worker-node1" {
# VM General Settings
target_node = "pve"
vmid = "202"
name = "worker-node1"
desc = "Description"
# VM Advanced General Settings
onboot = true
# VM OS Settings
clone = "ubuntu-server-jammy"
# VM System Settings
agent = 1
# VM CPU Settings
cores = 6
sockets = 1
cpu = "host"
# VM Memory Settings
memory = 6144
# VM Network Settings
network {
bridge = "vmbr0"
model = "virtio"
}
# VM Cloud-Init Settings
os_type = "cloud-init"
# (Optional) IP Address and Gateway
# ipconfig0 = "ip=0.0.0.0/0,gw=0.0.0.0"
# (Optional) Default User
ciuser = "root"
# (Optional) Add your SSH KEY
sshkeys = <<EOF
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPekPB/rnjpJYUmc/WW2WDcIEK1gt0SE+hGsRsBwEi8c pjconnol@LAPTOP-GSTHBNE5
EOF
provisioner "local-exec" {
when = create
command = "echo \"The IP of vm '${self.name}' is '${self.default_ipv4_address}'\""
}
}
resource "proxmox_vm_qemu" "worker-node2" {
# VM General Settings
target_node = "pve"
vmid = "203"
name = "worker-node2"
desc = "Description"
# VM Advanced General Settings
onboot = true
# VM OS Settings
clone = "ubuntu-server-jammy"
# VM System Settings
agent = 1
# VM CPU Settings
cores = 6
sockets = 1
cpu = "host"
# VM Memory Settings
memory = 6144
# VM Network Settings
network {
bridge = "vmbr0"
model = "virtio"
}
# VM Cloud-Init Settings
os_type = "cloud-init"
# (Optional) IP Address and Gateway
# ipconfig0 = "ip=0.0.0.0/0,gw=0.0.0.0"
# (Optional) Default User
ciuser = "root"
# (Optional) Add your SSH KEY
sshkeys = <<EOF
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPekPB/rnjpJYUmc/WW2WDcIEK1gt0SE+hGsRsBwEi8c pjconnol@LAPTOP-GSTHBNE5
EOF
provisioner "local-exec" {
when = create
command = "echo \"The IP of vm '${self.name}' is '${self.default_ipv4_address}'\""
}
}