Merge pull request #1257 from apichick/fixes-compute-vm-boot-disk

Fixes related to boot_disk in compute-vm module
This commit is contained in:
apichick 2023-03-16 16:24:25 +01:00 committed by GitHub
commit e949216bb6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
19 changed files with 89 additions and 52 deletions

View File

@ -310,9 +310,11 @@ module "simple-vm-example" {
zone = "europe-west1-b" zone = "europe-west1-b"
name = "test" name = "test"
boot_disk = { boot_disk = {
image = "projects/debian-cloud/global/images/family/cos-97-lts" initialize_params = {
type = "pd-balanced" image = "projects/debian-cloud/global/images/family/cos-97-lts"
size = 10 type = "pd-balanced"
size = 10
}
} }
} }
``` ```

View File

@ -30,9 +30,11 @@ module "mgmt_server" {
}] }]
service_account_create = true service_account_create = true
boot_disk = { boot_disk = {
image = var.mgmt_server_config.image initialize_params = {
type = var.mgmt_server_config.disk_type image = var.mgmt_server_config.image
size = var.mgmt_server_config.disk_size type = var.mgmt_server_config.disk_type
size = var.mgmt_server_config.disk_size
}
} }
metadata = { metadata = {
startup-script = <<EOT startup-script = <<EOT

View File

@ -81,9 +81,11 @@ module "server" {
} }
service_account_create = true service_account_create = true
boot_disk = { boot_disk = {
image = var.image initialize_params = {
type = var.disk_type image = var.image
size = var.disk_size type = var.disk_type
size = var.disk_size
}
} }
group = { group = {
named_ports = { named_ports = {

View File

@ -234,9 +234,11 @@ module "test-vm" {
zone = "${var.region}-b" zone = "${var.region}-b"
name = "nginx-test" name = "nginx-test"
boot_disk = { boot_disk = {
image = "projects/cos-cloud/global/images/family/cos-stable" initialize_params = {
type = "pd-ssd" image = "projects/cos-cloud/global/images/family/cos-stable"
size = 10 type = "pd-ssd"
size = 10
}
} }
metadata = { metadata = {
user-data = module.cos-nginx.cloud_config user-data = module.cos-nginx.cloud_config

View File

@ -46,9 +46,11 @@ module "test-vm" {
service_account = module.service-account-sql.email service_account = module.service-account-sql.email
service_account_scopes = ["https://www.googleapis.com/auth/cloud-platform"] service_account_scopes = ["https://www.googleapis.com/auth/cloud-platform"]
boot_disk = { boot_disk = {
image = "projects/debian-cloud/global/images/family/debian-10" initialize_params = {
type = "pd-ssd" image = "projects/debian-cloud/global/images/family/debian-10"
size = 10 type = "pd-ssd"
size = 10
}
} }
encryption = var.service_encryption_keys != null ? { encryption = var.service_encryption_keys != null ? {
encrypt_boot = true encrypt_boot = true

View File

@ -134,10 +134,11 @@ module "vm_example" {
} }
] ]
boot_disk = { boot_disk = {
image = "projects/debian-cloud/global/images/family/debian-10" initialize_params = {
type = "pd-ssd" image = "projects/debian-cloud/global/images/family/debian-10"
size = 10 type = "pd-ssd"
encrypt_disk = true size = 10
}
} }
tags = ["ssh"] tags = ["ssh"]
encryption = { encryption = {

View File

@ -73,9 +73,11 @@ module "nodes" {
}] }]
boot_disk = { boot_disk = {
image = var.node_image initialize_params = {
type = "pd-ssd" image = var.node_image
size = var.boot_disk_size type = "pd-ssd"
size = var.boot_disk_size
}
} }
attached_disks = [{ attached_disks = [{

View File

@ -32,9 +32,11 @@ module "mgmt_server" {
}] }]
service_account_create = true service_account_create = true
boot_disk = { boot_disk = {
image = var.mgmt_server_config.image initialize_params = {
type = var.mgmt_server_config.disk_type image = var.mgmt_server_config.image
size = var.mgmt_server_config.disk_size type = var.mgmt_server_config.disk_type
size = var.mgmt_server_config.disk_size
}
} }
tags = ["ssh"] tags = ["ssh"]
} }

View File

@ -30,9 +30,11 @@ module "mgmt_server" {
}] }]
service_account_create = true service_account_create = true
boot_disk = { boot_disk = {
image = var.mgmt_server_config.image initialize_params = {
type = var.mgmt_server_config.disk_type image = var.mgmt_server_config.image
size = var.mgmt_server_config.disk_size type = var.mgmt_server_config.disk_type
size = var.mgmt_server_config.disk_size
}
} }
} }

View File

@ -289,7 +289,9 @@ module "proxy-vm" {
subnetwork = module.vpc.subnet_self_links[format("%s/%s", var.region, var.subnetwork)] subnetwork = module.vpc.subnet_self_links[format("%s/%s", var.region, var.subnetwork)]
}] }]
boot_disk = { boot_disk = {
image = "projects/cos-cloud/global/images/family/cos-stable" initialize_params = {
image = "projects/cos-cloud/global/images/family/cos-stable"
}
} }
create_template = true create_template = true
metadata = { metadata = {

View File

@ -302,7 +302,9 @@ module "vm-onprem" {
instance_type = "f1-micro" instance_type = "f1-micro"
name = "onprem" name = "onprem"
boot_disk = { boot_disk = {
image = "ubuntu-os-cloud/ubuntu-1804-lts" initialize_params = {
image = "ubuntu-os-cloud/ubuntu-1804-lts"
}
} }
metadata = { metadata = {
user-data = module.config-onprem.cloud_config user-data = module.config-onprem.cloud_config

View File

@ -23,9 +23,11 @@ module "gw" {
instance_type = "f1-micro" instance_type = "f1-micro"
boot_disk = { boot_disk = {
image = "projects/ubuntu-os-cloud/global/images/family/ubuntu-2004-lts", initialize_params = {
type = "pd-ssd", image = "projects/ubuntu-os-cloud/global/images/family/ubuntu-2004-lts",
size = 10 type = "pd-ssd",
size = 10
}
} }
network_interfaces = [ network_interfaces = [

View File

@ -161,7 +161,9 @@ module "test-vm" {
name = "${var.name}-test" name = "${var.name}-test"
instance_type = "e2-micro" instance_type = "e2-micro"
boot_disk = { boot_disk = {
image = "projects/ubuntu-os-cloud/global/images/family/ubuntu-2104" initialize_params = {
image = "projects/ubuntu-os-cloud/global/images/family/ubuntu-2104"
}
} }
network_interfaces = [{ network_interfaces = [{
network = module.vpc-onprem.self_link network = module.vpc-onprem.self_link

View File

@ -58,9 +58,11 @@ module "vm" {
google-logging-enabled = true google-logging-enabled = true
} }
boot_disk = { boot_disk = {
image = "projects/cos-cloud/global/images/family/cos-stable" initialize_params = {
type = "pd-ssd" image = "projects/cos-cloud/global/images/family/cos-stable"
size = 10 type = "pd-ssd"
size = 10
}
} }
tags = ["ssh"] tags = ["ssh"]
} }

View File

@ -41,9 +41,11 @@ module "vm" {
google-logging-enabled = true google-logging-enabled = true
} }
boot_disk = { boot_disk = {
image = "projects/cos-cloud/global/images/family/cos-stable" initialize_params = {
type = "pd-ssd" image = "projects/cos-cloud/global/images/family/cos-stable"
size = 10 type = "pd-ssd"
size = 10
}
} }
tags = ["dns", "ssh"] tags = ["dns", "ssh"]
} }

View File

@ -25,9 +25,11 @@ module "vm-nginx-tls" {
google-logging-enabled = true google-logging-enabled = true
} }
boot_disk = { boot_disk = {
image = "projects/cos-cloud/global/images/family/cos-stable" initialize_params = {
type = "pd-ssd" image = "projects/cos-cloud/global/images/family/cos-stable"
size = 10 type = "pd-ssd"
size = 10
}
} }
tags = ["http-server", "https-server", "ssh"] tags = ["http-server", "https-server", "ssh"]
} }

View File

@ -41,9 +41,11 @@ module "vm-nginx-tls" {
google-logging-enabled = true google-logging-enabled = true
} }
boot_disk = { boot_disk = {
image = "projects/cos-cloud/global/images/family/cos-stable" initialize_params = {
type = "pd-ssd" image = "projects/cos-cloud/global/images/family/cos-stable"
size = 10 type = "pd-ssd"
size = 10
}
} }
tags = ["http-server", "ssh"] tags = ["http-server", "ssh"]
} }

View File

@ -54,9 +54,11 @@ module "vm" {
google-logging-enabled = true google-logging-enabled = true
} }
boot_disk = { boot_disk = {
image = "projects/cos-cloud/global/images/family/cos-stable" initialize_params = {
type = "pd-ssd" image = "projects/cos-cloud/global/images/family/cos-stable"
size = 10 type = "pd-ssd"
size = 10
}
} }
tags = ["nva", "ssh"] tags = ["nva", "ssh"]
} }

View File

@ -132,9 +132,11 @@ module "instance-group" {
addresses = null addresses = null
}] }]
boot_disk = { boot_disk = {
image = "projects/cos-cloud/global/images/family/cos-stable" initialize_params = {
type = "pd-ssd" image = "projects/cos-cloud/global/images/family/cos-stable"
size = 10 type = "pd-ssd"
size = 10
}
} }
tags = ["http-server", "ssh"] tags = ["http-server", "ssh"]
metadata = { metadata = {