История изменений
Исправление iSage, (текущая версия) :
Такой вариант устроит? Если да - напиши мне в почту isage.dna at gmail.com
resource "virtualbox_natnetwork" "vmnet10" {
name = "vmnet10"
dhcp = true
network = "192.168.6.0/24"
}
resource "virtualbox_vm" "squid" {
count = 2
name = format("node%02d", count.index + 1)
image = "virtualbox.box"
cpus = 1
memory = "256 mib"
network_adapter {
type = "hostonly"
host_interface = "vboxnet0"
}
network_adapter {
type = "natnetwork"
nat_network = "vmnet10"
}
}
$ ./terraform show
# virtualbox_natnetwork.vmnet10:
resource "virtualbox_natnetwork" "vmnet10" {
dhcp = true
id = "vmnet10"
name = "vmnet10"
network = "192.168.6.0/24"
}
# virtualbox_vm.squid[0]:
resource "virtualbox_vm" "squid" {
cpus = 1
id = "33b77412-e417-44f0-9576-f1be3b674704"
image = "virtualbox.box"
memory = "256 mib"
name = "node01"
status = "running"
network_adapter {
device = "IntelPro1000MTServer"
host_interface = "vboxnet0"
ipv4_address = "192.168.56.111"
ipv4_address_available = "yes"
mac_address = "080027417123"
status = "up"
type = "hostonly"
}
network_adapter {
device = "IntelPro1000MTServer"
ipv4_address = "192.168.6.13"
ipv4_address_available = "yes"
mac_address = "0800279E2056"
nat_network = "vmnet10"
status = "up"
type = "natnetwork"
}
}
# virtualbox_vm.squid[1]:
resource "virtualbox_vm" "squid" {
cpus = 1
id = "50f1de45-9d93-41dd-855a-38b78b8cd651"
image = "virtualbox.box"
memory = "256 mib"
name = "node02"
status = "running"
network_adapter {
device = "IntelPro1000MTServer"
host_interface = "vboxnet0"
ipv4_address = "192.168.56.110"
ipv4_address_available = "yes"
mac_address = "08002755B360"
status = "up"
type = "hostonly"
}
network_adapter {
device = "IntelPro1000MTServer"
ipv4_address = "192.168.6.12"
ipv4_address_available = "yes"
mac_address = "0800272FA943"
nat_network = "vmnet10"
status = "up"
type = "natnetwork"
}
}
Исходная версия iSage, :
Такой вариант устроит? Если да - напиши мне в почту isage.dna gmail.com
resource "virtualbox_natnetwork" "vmnet10" {
name = "vmnet10"
dhcp = true
network = "192.168.6.0/24"
}
resource "virtualbox_vm" "squid" {
count = 2
name = format("node%02d", count.index + 1)
image = "virtualbox.box"
cpus = 1
memory = "256 mib"
network_adapter {
type = "hostonly"
host_interface = "vboxnet0"
}
network_adapter {
type = "natnetwork"
nat_network = "vmnet10"
}
}
$ ./terraform show
# virtualbox_natnetwork.vmnet10:
resource "virtualbox_natnetwork" "vmnet10" {
dhcp = true
id = "vmnet10"
name = "vmnet10"
network = "192.168.6.0/24"
}
# virtualbox_vm.squid[0]:
resource "virtualbox_vm" "squid" {
cpus = 1
id = "33b77412-e417-44f0-9576-f1be3b674704"
image = "virtualbox.box"
memory = "256 mib"
name = "node01"
status = "running"
network_adapter {
device = "IntelPro1000MTServer"
host_interface = "vboxnet0"
ipv4_address = "192.168.56.111"
ipv4_address_available = "yes"
mac_address = "080027417123"
status = "up"
type = "hostonly"
}
network_adapter {
device = "IntelPro1000MTServer"
ipv4_address = "192.168.6.13"
ipv4_address_available = "yes"
mac_address = "0800279E2056"
nat_network = "vmnet10"
status = "up"
type = "natnetwork"
}
}
# virtualbox_vm.squid[1]:
resource "virtualbox_vm" "squid" {
cpus = 1
id = "50f1de45-9d93-41dd-855a-38b78b8cd651"
image = "virtualbox.box"
memory = "256 mib"
name = "node02"
status = "running"
network_adapter {
device = "IntelPro1000MTServer"
host_interface = "vboxnet0"
ipv4_address = "192.168.56.110"
ipv4_address_available = "yes"
mac_address = "08002755B360"
status = "up"
type = "hostonly"
}
network_adapter {
device = "IntelPro1000MTServer"
ipv4_address = "192.168.6.12"
ipv4_address_available = "yes"
mac_address = "0800272FA943"
nat_network = "vmnet10"
status = "up"
type = "natnetwork"
}
}