Skip to content
This repository was archived by the owner on Mar 1, 2023. It is now read-only.

Force a recreation when root volume of an instance is changed #120

@jbg

Description

@jbg

When we change the volume pointed to by the volume block that has boot_index = 0, we have to manually pass -replace=gcore_instance.foo to Terraform when planning to cause the instance to be destroyed and recreated, as otherwise we get the error Error: Cannot detach a root device volume (HTTP 400).

This creates a problem because we run Terraform in automation. When the instance should be updated, the image_id of the volume is changed by our automation, which recreates the volume and should recreate the instance from the new image, but because of this bug we have to manually intervene every time to add -replace.

The Terraform providers for most other clouds automatically force a replacement of a resource when attributes (such as root volume) require it. It would be great if this provider could do the same.

Metadata

Metadata

Assignees

No one assigned

    Labels

    CloudIssues related to Gcore Cloud

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions