Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Terraform want to rebuild VM if I want to increase disk size #310

Open
sylvain987 opened this issue Feb 15, 2023 · 2 comments
Open

Terraform want to rebuild VM if I want to increase disk size #310

sylvain987 opened this issue Feb 15, 2023 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@sylvain987
Copy link

Terraform Version

[svc_terraform@frparadm73 infra-test]$ terraform version
Terraform v1.2.9
on linux_amd64
+ provider registry.terraform.io/hashicorp/local v2.2.3
+ provider registry.terraform.io/hashicorp/null v3.1.1
+ provider registry.terraform.io/hashicorp/outscale v0.8.2
+ provider registry.terraform.io/hashicorp/vault v3.8.2

Terraform Configuration Files

// Création de la VM
resource "outscale_vm" "VM" {

....
    // Disque système
    block_device_mappings {
        device_name = "/dev/sda1"
        bsu {
            volume_size           = 50
            volume_type           = "gp2"
            delete_on_vm_deletion = true
        }
    }

    // Disque applicatif
    block_device_mappings {
        device_name = "/dev/sdb"
        bsu {
            volume_size           = 40
            volume_type           = "gp2"
            iops                  = null
            delete_on_vm_deletion = true
        }
    }
...

Debug Output

  # module.VM["VM-FRONT-POC-AZa-DEMO-01"].outscale_vm.VM-AFD must be replaced
-/+ resource "outscale_vm" "VM-AFD" {
...
      ~ block_device_mappings {
            # (1 unchanged attribute hidden)

          ~ bsu {
              - iops                  = 0 -> null
              ~ volume_size           = 20 -> 40 # forces replacement
                # (2 unchanged attributes hidden)
            }
        }
...
Plan: 1 to add, 0 to change, 1 to destroy.

Crash Output

Expected Behavior

Resize disk without destroy/create the VM

Actual Behavior

Destroy/Recreate the VM

Steps to Reproduce

terraform init
terraform plan

Additional Context

We have create a module to create a VM with a private IP (outscale_nic) and a VM (outscale_vm). If the disk is full, we want to increase the disk. We know that the resizing is with the VM stop but Terraform when to destroy the VM. For now, we bypass that by increase the disk with the CLI and change the configuration/state Terraform after that.

Weird point, after changing the size of the disk with the CLI, Terraform do not see the modification (even after terraform refresh).

References

@sylvain987 sylvain987 added the bug Something isn't working label Feb 15, 2023
@outscale-toa
Copy link
Member

Hi @sylvain987,

Thanks for reaching us, we are looking at your issue

Best regards,

@outscale-toa
Copy link
Member

Hi @sylvain987

Actually update volume or block device mapping (size/iops) is not implemented in terraform provider yet.
We have an issue on it #200
When we will be able to hot update volume (without stop/start VM) we will implement update volume in terraform provider.

Best regards,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Development

No branches or pull requests

2 participants