diff --git a/data/publiccloud/terraform/azure.tf b/data/publiccloud/terraform/azure.tf index 6d6f9a86df56..e7412b3c8aea 100644 --- a/data/publiccloud/terraform/azure.tf +++ b/data/publiccloud/terraform/azure.tf @@ -51,6 +51,10 @@ variable "sku" { default = "gen2" } +variable "root-disk-size" { + default = 30 +} + variable "extra-disk-size" { default = "100" } @@ -141,7 +145,7 @@ resource "azurerm_image" "image" { os_type = "Linux" os_state = "Generalized" blob_uri = "https://${var.storage-account}.blob.core.windows.net/sle-images/${var.image_id}" - size_gb = 30 + size_gb = var.root-disk-size } } @@ -175,7 +179,7 @@ resource "azurerm_linux_virtual_machine" "openqa-vm" { storage_account_type = "Standard_LRS" # SLE images are 30G by default. Uncomment this line in case we need to increase the disk size # note: value can not be decreased because 30 GB is minimum allowed by Azure - # disk_size_gb = 30 + disk_size_gb = var.root-disk-size } source_image_id = var.image_uri != "" ? var.image_uri : (var.image_id != "" ? azurerm_image.image.0.id : null) diff --git a/data/publiccloud/terraform/ec2.tf b/data/publiccloud/terraform/ec2.tf index 9d9bc4fe11c4..7a6b5adad743 100644 --- a/data/publiccloud/terraform/ec2.tf +++ b/data/publiccloud/terraform/ec2.tf @@ -35,6 +35,10 @@ variable "image_id" { default = "" } +variable "root-disk-size" { + default = 20 +} + variable "extra-disk-size" { default = "1000" } @@ -111,7 +115,7 @@ resource "aws_instance" "openqa" { ebs_block_device { device_name = "/dev/sda1" - volume_size = 20 + volume_size = var.root-disk-size volume_type = "gp3" } diff --git a/data/publiccloud/terraform/gce.tf b/data/publiccloud/terraform/gce.tf index 1672ccb45098..b903bd19239b 100644 --- a/data/publiccloud/terraform/gce.tf +++ b/data/publiccloud/terraform/gce.tf @@ -53,6 +53,10 @@ variable "project" { default = "suse-sle-qa" } +variable "root-disk-size" { + default = 20 +} + variable "extra-disk-size" { default = "1000" } @@ -124,7 +128,7 @@ resource "google_compute_instance" "openqa" { device_name = "${var.name}-${element(random_id.service.*.hex, count.index)}" initialize_params { image = var.image_id - size = 20 + size = var.root-disk-size } } diff --git a/lib/publiccloud/provider.pm b/lib/publiccloud/provider.pm index 5960265e9361..638f32257eb2 100644 --- a/lib/publiccloud/provider.pm +++ b/lib/publiccloud/provider.pm @@ -431,6 +431,10 @@ sub terraform_prepare_env { else { $file = get_var('PUBLIC_CLOUD_TERRAFORM_FILE', "publiccloud/terraform/$file.tf"); assert_script_run('curl ' . data_url("$file") . ' -o ' . TERRAFORM_DIR . '/plan.tf'); +<<<<<<< HEAD +======= + assert_script_run('curl ' . data_url("publiccloud/cloud-init.yaml") . ' -o ' . TERRAFORM_DIR . "/cloud-init.yaml") if (get_var('PUBLIC_CLOUD_CLOUD_INIT')); +>>>>>>> a015ca600 (Add posibility to set system disk size in PublicCloud) } $self->terraform_env_prepared(1); } @@ -537,9 +541,9 @@ sub terraform_apply { $cmd .= "-var 'region=" . $self->provider_client->region . "' "; $cmd .= "-var 'name=" . $self->resource_name . "' "; $cmd .= "-var 'project=" . $args{project} . "' " if $args{project}; - $cmd .= "-var 'enable_confidential_vm=true' " if ($args{confidential_compute} && is_gce()); - $cmd .= "-var 'enable_confidential_vm=enabled' " if ($args{confidential_compute} && is_ec2()); $cmd .= "-var 'vm_create_timeout=" . $terraform_vm_create_timeout . "' " if $terraform_vm_create_timeout; + my $root_size = get_var('PUBLIC_CLOUD_ROOT_DISK_SIZE'); + $cmd .= "-var 'root-disk-size=" . $root_size ."' " if ($root_size); $cmd .= sprintf(q(-var 'tags=%s' ), escape_single_quote($self->terraform_param_tags)); if ($args{use_extra_disk}) { $cmd .= "-var 'create-extra-disk=true' "; diff --git a/variables.md b/variables.md index 6619ccebc335..1cabc472d19f 100644 --- a/variables.md +++ b/variables.md @@ -386,6 +386,7 @@ PUBLIC_CLOUD_INFRA | boolean | false | Would trigger special flow in [check_regi PUBLIC_CLOUD_INFRA_RMT_V4 | string | "" | Defines IPv4 registration server in test infra. Must be used together with PUBLIC_CLOUD_INFRA. (DO NOT use the variable if you don't know what is about) PUBLIC_CLOUD_INFRA_RMT_V6 | string | "" | Defines IPv6 registration server in test infra. Must be used together with PUBLIC_CLOUD_INFRA. (DO NOT use the variable if you don't know what is about) PUBLIC_CLOUD_GEN_RESOLVER | boolean | 0 | Control use of `--debug-resolver` option during maintenance updates testing . In case option was used also controls uploading of resolver case into the test +PUBLIC_CLOUD_ROOT_DISK_SIZE | int | | Set size of system disk in GiB for public cloud instance. Default size is 30 for Azure and 20 for GCE and EC2 ### Wicked testsuite specific variables